Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
18th January 2022, 15:29 | #1 | Link |
Registered User
Join Date: Dec 2003
Posts: 485
|
Video stuttering when skipping ahead (converted with ffmpeg)
I have been encoding 4K HDR10 video with similar ffmpeg settings as below, just tweaked in theory for 1080p for some older footage I need to convert. I play most of my content thru the NVidia Shield and never have issues. Until now. I have a H.264 AVC video that I am converting to H.265 and it plays fine on VLC on Windows, but when I play this one and a couple other similar videos that are 1080p on the Shield, they seem to play OK, until I jump ahead. The audio keeps working, but the video will either not move for a while or will but the video will stutter. And keep doing that. If I jump back 10 seconds or so it will start playing normally again. Never saw this before. Below is the command I'm running essentially:
ffmpeg.exe -i <input_video>.mkv -c:v libx265 -x265-params level=51:high-tier=1:repeat-headers=1:colorprim=bt709:transfer=bt709:colormatrix=bt709:crf=13:chromaloc=0:no-sao=1:info=0:range=limited:vbv-maxrate=17500:vbv-bufsize=17500 -vf crop=1920:816:0:0 -preset slower -pix_fmt yuv420p10le -sn -an <output_video>.hevc So when that had this issue tried extracting all the frames as images and then ran the below but same deal: ffmpeg.exe -framerate 24000/1001 -f image2 -i img%09d.bmp -c:v libx265 -x265-params level=51:high-tier=1:repeat-headers=1:colorprim=bt709:transfer=bt709:colormatrix=bt709:crf=13:chromaloc=0:no-sao=1:info=0:range=limited:vbv-maxrate=17500:vbv-bufsize=17500 -vf crop=1920:816:0:0 -preset slower -pix_fmt yuv420p10le -sn -an <output_video>.hevc Any thoughts on what's going on? Thanks. JR |
22nd January 2022, 01:21 | #4 | Link |
Registered User
Join Date: Dec 2003
Posts: 485
|
By the way, my source was 8 bit so changed the pix_fmt but that didn't help but still makes sense to do. What would the thought be if...
1. The converted video put in an mkv container plays super fast and no hickups by itself. I can't even fast forward thru the footage with it immediately playing. No audio of course. 2. If I add in the DTS audio file untouched, and the ass subtitles which are text and always make them, it starts up again. Should I assume something is wrong with the DTS file? |
22nd January 2022, 03:13 | #6 | Link |
Registered User
Join Date: Dec 2003
Posts: 485
|
OK I have --repeat-headers but will try your other suggestions. See you in a couple days when it's done.
Note the video is fine as encoded when I have no audio in the MKV. When I add the audio then it starts playing odd various times when I jump around. Audio is DTS XLL on these issue items if that helps at all. Not sure if the NVidia Shield has issue with this audio file though it plays fine. Even while the video is stuttering the audio keeps chugging along. |
23rd January 2022, 03:28 | #7 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
|
Quote:
|
|
23rd January 2022, 22:04 | #8 | Link |
Registered User
Join Date: Dec 2003
Posts: 485
|
I switched the DTS Master to AAC. Obviously not the same bitrate but no the stuttering couldn't be reproduced. Still had the lag in the video starting at times when jumping ahead a bunch but no stuttering playback. Thinking this must be the player. On a PC with VLC it's fine. One a NVidia Shield Pro 2019 on VLC it's fine. On Emby this happens. All are direct playing, no transcoding.
Last edited by jriker1; 23rd January 2022 at 22:18. |
24th January 2022, 03:17 | #9 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
|
Quote:
Lag in random access is most common with very long GOP sizes. The default --keyint 250 can require decoding a lot of frames to be able to display an arbitrary one near the end of the GOP, as all frames that frame references need to be decodes, and all the frames those frames reference. If that's it, lowering --keyint should proportionally reduce worst-case random access time. |
|
24th January 2022, 16:54 | #10 | Link |
Registered User
Join Date: Dec 2003
Posts: 485
|
Got derailed with my other testing so running now. Added in keyint=24:min-keyint=24.
Do we think this would help the playback issue when jumping around though pretty convinced it's due to the audio. Also there was a mention about how it was multiplexed. Would mkvtoolnix be an issue multiplexing the content? |
25th January 2022, 02:32 | #12 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
|
Quote:
|
|
25th January 2022, 12:54 | #13 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 322
|
Quote:
Last edited by excellentswordfight; 25th January 2022 at 14:00. |
|
25th January 2022, 22:15 | #14 | Link | |
Registered User
Join Date: Dec 2003
Posts: 485
|
Quote:
ffmpeg.exe -i "<source>.mkv" -c:v libx265 -x265-params level=51:hdr10=1:hdr-opt=1:high-tier=1:repeat-headers=1:colorprim=bt2020:transfer=smpte2084:colormatrix=bt2020nc:master-display=G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,0):crf=13:chromaloc=2:no-sao=1:info=0:range=limited:vbv-maxrate=17500:vbv-bufsize=17500 -vf crop=3840:1600:0:280 -preset slower -pix_fmt yuv420p10le -sn -an "<output>.hevc" Last edited by jriker1; 25th January 2022 at 22:18. |
|
26th January 2022, 01:39 | #15 | Link |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
|
OH! I bet High-tier is the problem. Lots of consumer decoders don't handle it well, and may go into a weird mode just from that flag. Your bitrates caps are well below the Main Tier thresholds, so just use Main. With a CRF of 13 and a 17.5 Mbps max bitrate, you're probably getting something pretty close to CBR.
Level 5.1, which you are using, can go up to 40 Mbps, so there's no reason to use High Tier unless you want to go above that. For 17.5 Mbps, you might as well use Level 5.0 (max of 25 Mbps), which might boost compatibility or performance on some older devices. |
26th January 2022, 09:29 | #16 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 322
|
Quote:
But yes having that low crf value and vbv doesnt seems like that great, but that should be more in terms of encoding quality then decoding compat, right? Was thinking that it was related to ref-frames, as you are using a low resolution for that level, with a low preset I thought that x265 would behave like x264 and use ref 16. But it doesnt looks like x265 go above 5 with that command line... But it might be something to try out. What happens if you remove the vbv settings and set high-tier=0, and use level 4.1 (that would automatically set vbv to 20Mbps)? Last edited by excellentswordfight; 26th January 2022 at 09:32. |
|
26th January 2022, 18:16 | #17 | Link | ||||
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,752
|
Quote:
Quote:
Quote:
It's been a big problem that x264 historically didn't enforce Profile and Level constraints, resulting in out of spec files that had big playback issues with hardware decoders. x265 did the right thing here, where you have to use an override to violate spec compliance. Quote:
Unlike classic x264, where setting --level would just set that flag in the bitstream but not change any defaults or validate that settings were legal. |
||||
26th January 2022, 19:59 | #18 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 322
|
Quote:
|
|
26th January 2022, 22:09 | #19 | Link |
Registered User
Join Date: Dec 2003
Posts: 485
|
Not done encoding yet, however I think ffmpeg is ignoring the high tier setting. At least this is part of the output I copied from the screen:
Press [q] to stop, [?] for help x265 [info]: HEVC encoder version 3.5+21-8a15ef537 x265 [info]: build info [Windows][GCC 11.2.0][64 bit] 8bit+10bit+12bit x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 x265 [info]: Main profile, Level-5.1 (Main tier) x265 [info]: Thread pool created using 8 threads x265 [info]: Slices |
Tags |
ffmpeg, h.265 |
Thread Tools | Search this Thread |
Display Modes | |
|
|