Video_player_for_3DS
Video_player_for_3DS copied to clipboard
Hardware Decoder data copy spikes desyncs the video?
Hi,
I know the hardware decoder is in beta. It does seem it is able to provide better and accurate colors like better blacks and overall details. The problem is that the audio/video is not synched and every few seconds, the graph from the Y button reports a spike that causes the video to sync/desync/skip frame? Not really sure how to describe it. This issue does not happen on the software decoder.
Right now my solution is to encode videos to 240p and use the software decoder which plays it smoothly. However, the hardware decoder seem to do a better job at handling colors but with this tiny issue.
Not sure how easy it is to fix it, but wanted to let you know.
This is the command line I'm using to encode my videos using ffmpeg:
ffmpeg -c:v h264_cuvid -i {h264_input_video} -c:v h264_nvenc -preset slow -c:a libfdk_aac -b:v 1M -b:a 256K -ac 2 -vf scale=-1:240 {h264_output_video}
Could you send me screenshot of graph that shows spike?
Here is playing the video in HW decoder mode. The video skips frames on those spikes. This happens periodically (maybe it's related to the buffers?)
Here's the graph when playing in SW decoder mode. The video plays very smoothly.
Hmm, can you see spike only in blue line not red line?
Hmm, can you see spike only in blue line not red line?
Is there a way to filter the line? The issue just happen in the HW decoder blue line spikes. The red line doesn't seem to matter. In the SW decoder you can see the blue line is very smooth so playback is actually good.
There is no way to filter the line. ok, I'll try to fix it.
I can't use nvidia GPU right now so I couldn't encode video using command that you provide.
However, I found that if I encode video following command, the video won't play smoothly in hardware decoding (plays smoothly in software decoding).
ffmpeg -i {input} -c:v libx264 -preset slow -c:a aac -b:v 1M -b:a 256K -ac 2 -s 426x240 {output}
I also found if I encode video following command, the video play smoothly in hardware and software decoding.
ffmpeg -i {input} -c:v h264_mf -preset slow -c:a aac -b:v 1M -b:a 256K -ac 2 -s 426x240 {output}
To investigate more, could you send me sample video that encoded by h264_nvenc?
How do you switch to software mode on a new Nintendo 3DS?
Use blue one.
oki thx
what if you take a look at thirdtube's code?
Workaround : encode your video without using B-frames.
ffmpeg -i {input_file_name} -acodec copy -vcodec h264 -crf 20 -s {width}x{height} -bf 0 {output_file_name}
Hi,
Thanks for the workaround. I ended up using -bf 0
as I couldn't find an equivalent for NVidia's h264_nvenc encoder. It seems -bf
is ffmpeg's generic argument to specify B-Frames and it seems to have fixed the issue entirely.
My command now looks like this:
ffmpeg -i {input} -c:v h264_nvenc -preset slow -c:a libfdk_aac -b:a 256K -af "volume=4" -bf 0 -g 48 -ac 2 {output}
The video files are encoded and plays back fine.
Other unrelated issues I found to this one is that the audio only works if it's 2-channel, hence the -ac 2
argument. And also, for some strange issue, the video/audio desyncs after a while. It is mostly noticeable when people are talking. Seeking fixes it temporarily but the issue happens again after a while. I'll open a new issue for this.
Thank you fore telling me, I updated command line.
Hardware decoder bug has been fixed in v1.5.2.