VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. I have a large library of videos which I am trying to convert to hevc for playback on a Roku Ultra. Per Roku's official streaming specifications (https://developer.roku.com/docs/specs/media/streaming-specifications.md#supported-video-codecs) the maximum level that it can support is 5.1. I have tested this and while higher levels do work, there are playback issues like tearing and hanging, so I need to stick with the 5.1 level. I am using FFmpeg to perform the conversions.

    Here's my issue; I have been playing with both software (libx265) and hardware (hevc_nvenc) to do the conversions. However, I keep running into issues where the conversion will fail because the set level (5.1) isn't sufficient for the bit rate. For example, if I run the following:

    Code:
    -c:v libx265 -vf scale=3840:2160 -preset veryslow -crf 23 -profile:v main -x265-params "level-idc=5.1" -c:a copy
    I get the error:

    Code:
    x265 [error]: frame rate is out of range for specific level
    If I run:
    Code:
    -c:v hevc_nvenc -vf scale=3840:2160 -preset:v 18 -tune:v 1 -profile:v 0 -level:v 153 -tier:v 1 -rc:v 1 -cq:v 23  -c:a copy
    I get:

    Code:
    InitializeEncoder faile: invalid param (8): Invalid Level
    The maddening thing is that if i remove the Level 5.1 arguments, let the encode complete (which results in a Level 6 / 5.2 / etc.), then re-encode it again with the Level 5.1 argument, it works fine because the bitrate has dropped to a level which is supported by Level 5.1. Obviously, this isn't a good option because the loss levels go through the roof by re-encoding twice.

    My question is two-fold; first, is there anything I could be doing differently to get this to function in one pass, second, is it possible to set the level on an existing file without re-encoding? This would let me convert everything to whatever level the encoder determines is needed, drop the bitrate to an appropriate level, then manually set the level to 5.1.
    Quote Quote  
  2. You can try to change level only, without reencoding, with clever Ffmpeg-GUI, main section.
    Quote Quote  
  3. Originally Posted by ProWo View Post
    You can try to change level only, without reencoding, with clever Ffmpeg-GUI, main section.
    Thank you, this does appear to work! The question I have now is whether you or anyone else knows the raw commands to do this natively. I am using FFmpeg Batch to run these conversions in bulk and would like to create a preset to do this following conversion. I did not see any option in Clever FFmpeg-GUI to create a log file showing the commands being passed nor did I see anything in Windows Event Log...

    EDIT: I figured it out. Basically, what you need to do is run the stream through the bitstream filter like so:

    Code:
    -c:v copy -bsf:v hevc_metadata=level=153 -c:a copy
    Last edited by copperheadclgp; 16th Nov 2022 at 13:58.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!