VideoHelp Forum
+ Reply to Thread
Results 1 to 23 of 23
Thread
  1. Hello VideoHelp community!
    I have been looking into Fast Forward and Rewind in Mp4 videos.
    I am using MediaCoder to encode and after a bit of reading I now know that the lower the valuer of GOP the faster the seeking is, so I keep it around 33.

    This applies perfectly when I encode with NVENC and using the H264 format.
    But when I try with the H265, fast forward becomes impossible regardless of how low the GOP is.
    I have read a suggestion that with H265, the parameter open-GOP should be disabled,
    but that's disabled in Mediacoder by default, right?

    Does anyone know if there is anything else I can do to achieve fast seeking times in H265?
    Thank you!
    Quote Quote  
  2. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    Hi,
    there are two parameters if I'm not wrong - --min-keyint which is minimal interval between keyframes, and --keyint that is max interval between keyframes. First is usually equal to fps of video, the second parameter can be 3x fps even 20 x is possible. Of course it has impact on skipping of videos. Larger more demanding on computing. It has to calculate all frame from nearest keyframe to current position. On slower machines it can take long time. But there are (on sw players (on PC)) usually possibility for fast skip, so when you skip at anywhere on video, it will play not exactly from position which you selected, but from nearest (previous keyframe).

    Bernix
    Last edited by Bernix; 24th Jan 2018 at 08:37. Reason: typo
    Quote Quote  
  3. @Bernix Thank you for replying. Yes this it true min-keyint and keyint do exactly that.
    In Handbrake for example in the video tab, in "extra options" i add "keyint=33"min-keyint=16" and this gets me fast seek.
    The problem is that this doesnt work when instead of H264 I switch to H265.
    Also as I am trying to make all of this work in MediaCoder, (since mediacoder is utilizing the GPU instead of the CPU and it is incredibly fast) would you have to know how to force the keyint / min-keyint parameters in Mediacoder?
    So far I had reached the conclusion that the GOP value is the keyint parameter.
    Correct?
    Quote Quote  
  4. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    Hi,
    you are using Nvenc HEVC? Not sure you can set min-keyint or keyint there, you can only do something with IDR frames, to force them, don't know if it helps at all. If you playing your video on PC, so I suggesting you set up player for fast skip.

    Bernix
    Quote Quote  
  5. Yes I am using NVENC in MediaCoder. The GOP value seemed to work for me (the lower the better) but it works only with h264 not H265.
    Last edited by Ibizanhound; 24th Jan 2018 at 09:21.
    Quote Quote  
  6. Since keyint and open-gop were already mentioned:

    1. Note that HEVC/H.265 decoding is usually slower than AVC/H.264 decoding. If possible use a fast decoder (e.g. LAV Video 64 in either software or hardware mode depending on your hardware)
    2. You are not just seeking but fast forwarding? Maybe because of the GOP structure the player cannot skip any frames. Only not referenced frames can be skipped.
    Quote Quote  
  7. I just spent the whole day experimenting with different settings in Mediacoder, even though I can make the NVENC work with H264 format,
    which means really fast encoding times and fast forward ability thanks to setting the value of GOP at 33 in the NVENC settings,
    still I feel the quality of H265 is slightly better,
    but unfortunately despite my efforts the GOP value doesn't seem to affect the H265 format in order to be able to seek fast enough to support a fast forward feature.
    At least in windows media player...
    I am suspecting it might have to do with the level of compression that H265 has as a format by default.

    Could anyone guide me on how to set windows media player to use a fast decoder?
    Quote Quote  
  8. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    Hi,
    Windows media player is very limited, doubt it is possible there. But for sure possible in Potplayer and VLC, most probably in MPC-BE. With first two I can help you. IMHO Problem is also that you can't do too much about keyframes in NVENC HEVC. As mentioned just something about force IDR frames.
    And AFAIK Potplayer, MPC-BE and VLC are far better than Windows Media Player.
    Example how to do it in Potplayer. F5 you are in preferences, then click on Playback and choose tab Time Jump here in bottom part check Jump to keyframe.
    Let me know, if it helped you.

    Bernix
    Quote Quote  
  9. Originally Posted by Ibizanhound View Post
    Does anyone know if there is anything else I can do to achieve fast seeking times in H265?
    As Bernix suggested you must reduce GOP length and/or introduce Random Access Points however both leading to worse compression gain (increase bitrate) - for production usually single frame Intra coding is used for frame accurate access - you must rethink what is most important for you - seek speed or compression gain (bitrate vs quality). You may find this paper useful https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.2073-0-201502-I!!PDF-E.pdf

    Constraint on IRAP access unit
    Since the HEVC standard does not allow encoding a trailing picture access unit before any leading
    picture access unit that has an earlier display order than the trailing picture access unit, the following
    constraint is imposed to satisfy the constraint on the GOP structure described above.
    When a leading picture access unit appears in a bitstream, an IRAP picture access unit shall appear
    only at the beginning of a CVS.
    To have frequent random access points, multiple access units associated with a recovery point SEI
    message may be present in a CVS. In this case, it is encouraged to encode a CVS in such a way that
    recovery_poc_cnt and exact_match_flag of the recovery point SEI message can be set equal to 0
    and 1, respectively.
    Quote Quote  
  10. Thank you Pandy and Bernix.
    So do you have any program to recommend to achieve frequent random access points?
    Quote Quote  
  11. --keyint already achieves that. Don't overthink it. OpenGOP can increase compression a bit but that is currently not the problem you have.
    Quote Quote  
  12. Sneaker, i know about keyint, can you tell me though in which program i can encode in H265 format, using NVENC and setting my own custom keyint value? Thank you.
    Quote Quote  
  13. Thank you Sneaker! StaxRip looks promising, I can't quite find the keyint parameter in it though and when I add --keyint 33 I get an error. Some help please?
    Last edited by Ibizanhound; 25th Jan 2018 at 18:18.
    Quote Quote  
  14. Slice Decision->GOP Length
    Quote Quote  
  15. Oh ok, I had found that already.
    Basically I also have tried this already with Mediacoder and Handbrake always managing to find only the GOP parameter in the NVENC encoder.
    Unfortunately like I 've mentioned above, even though the GOP value does make fast seek possible in H264 format, but it doesn't do the same for H265.
    Quote Quote  
  16. Marsia Mariner
    Guest
    deleted Deleted DELETED
    Last edited by Marsia Mariner; 26th Jan 2018 at 10:53. Reason: t.w.o.t.
    Quote Quote  
  17. Originally Posted by Ibizanhound View Post
    Oh ok, I had found that already.
    Basically I also have tried this already with Mediacoder and Handbrake always managing to find only the GOP parameter in the NVENC encoder.
    Unfortunately like I 've mentioned above, even though the GOP value does make fast seek possible in H264 format, but it doesn't do the same for H265.
    Tell us (if this is not a secret) purpose for this fast seek - perhaps you need different approach? Divide GOP length by framerate and this how accurate your seek can be, don't use open GOP as this may add unwanted overhead to seek time, finally you may select encoding profile optimized for fast decoding (each mentioned technique will add some unavoidable increase in bitrate or reduce quality).
    Quote Quote  
  18. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    Sorry but can't find anything in this NVENC HEVC ffmpeg support.

    Encoder hevc_nvenc [NVIDIA NVENC hevc encoder]:
    General capabilities: delay
    Threading capabilities: none
    Supported pixel formats: yuv420p nv12 p010le yuv444p yuv444p16le bgr0 rgb0 cuda
    hevc_nvenc AVOptions:
    -preset <int> E..V.... Set the encoding preset (from 0 to 11) (default medium)
    default E..V....
    slow E..V.... hq 2 passes
    medium E..V.... hq 1 pass
    fast E..V.... hp 1 pass
    hp E..V....
    hq E..V....
    bd E..V....
    ll E..V.... low latency
    llhq E..V.... low latency hq
    llhp E..V.... low latency hp
    lossless E..V.... lossless
    losslesshp E..V.... lossless hp
    -profile <int> E..V.... Set the encoding profile (from 0 to 4) (default main)
    main E..V....
    main10 E..V....
    rext E..V....
    -level <int> E..V.... Set the encoding level restriction (from 0 to 186) (default auto)
    auto E..V....
    1 E..V....
    1.0 E..V....
    2 E..V....
    2.0 E..V....
    2.1 E..V....
    3 E..V....
    3.0 E..V....
    3.1 E..V....
    4 E..V....
    4.0 E..V....
    4.1 E..V....
    5 E..V....
    5.0 E..V....
    5.1 E..V....
    5.2 E..V....
    6 E..V....
    6.0 E..V....
    6.1 E..V....
    6.2 E..V....
    -tier <int> E..V.... Set the encoding tier (from 0 to 1) (default main)
    main E..V....
    high E..V....
    -rc <int> E..V.... Override the preset rate-control (from -1 to INT_MAX) (default -1)
    constqp E..V.... Constant QP mode
    vbr E..V.... Variable bitrate mode
    cbr E..V.... Constant bitrate mode
    vbr_minqp E..V.... Variable bitrate mode with MinQP (deprecated)
    ll_2pass_quality E..V.... Multi-pass optimized for image quality (deprecated)
    ll_2pass_size E..V.... Multi-pass optimized for constant frame size (deprecated)
    vbr_2pass E..V.... Multi-pass variable bitrate mode (deprecated)
    cbr_ld_hq E..V.... Constant bitrate low delay high quality mode
    cbr_hq E..V.... Constant bitrate high quality mode
    vbr_hq E..V.... Variable bitrate high quality mode
    -rc-lookahead <int> E..V.... Number of frames to look ahead for rate-control (from 0 to INT_MAX) (default 0)
    -surfaces <int> E..V.... Number of concurrent surfaces (from 0 to 64) (default 0)
    -cbr <boolean> E..V.... Use cbr encoding mode (default false)
    -2pass <boolean> E..V.... Use 2pass encoding mode (default auto)
    -gpu <int> E..V.... Selects which NVENC capable GPU to use. First GPU is 0, second is 1, and so on. (from -2 to INT_MAX) (default any)
    any E..V.... Pick the first device available
    list E..V.... List the available devices
    -delay <int> E..V.... Delay frame output by the given amount of frames (from 0 to INT_MAX) (default INT_MAX)
    -no-scenecut <boolean> E..V.... When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts (default false)
    -forced-idr <boolean> E..V.... If forcing keyframes, force them as IDR frames. (default false)
    -spatial_aq <boolean> E..V.... set to 1 to enable Spatial AQ (default false)
    -temporal_aq <boolean> E..V.... set to 1 to enable Temporal AQ (default false)
    -zerolatency <boolean> E..V.... Set 1 to indicate zero latency operation (no reordering delay) (default false)
    -nonref_p <boolean> E..V.... Set this to 1 to enable automatic insertion of non-reference P-frames (default false)
    -strict_gop <boolean> E..V.... Set 1 to minimize GOP-to-GOP rate fluctuations (default false)
    -aq-strength <int> E..V.... When Spatial AQ is enabled, this field is used to specify AQ strength. AQ strength scale is from 1 (low) - 15 (aggressive) (from 1 to 15) (default 8)
    -cq <float> E..V.... Set target quality level (0 to 51, 0 means automatic) for constant quality mode in VBR rate control (from 0 to 51) (default 0)
    -aud <boolean> E..V.... Use access unit delimiters (default false)
    -bluray-compat <boolean> E..V.... Bluray compatibility workarounds (default false)
    -init_qpP <int> E..V.... Initial QP value for P frame (from -1 to 51) (default -1)
    -init_qpB <int> E..V.... Initial QP value for B frame (from -1 to 51) (default -1)
    -init_qpI <int> E..V.... Initial QP value for I frame (from -1 to 51) (default -1)
    -qp <int> E..V.... Constant quantization parameter rate control method (from -1 to 51) (default -1)
    -weighted_pred <int> E..V.... Set 1 to enable weighted prediction (from 0 to 1) (default 0)

    So there is something like slices outside of this for NVENC HEVC or is it independently on NVENC capabilities?

    Bernix
    Quote Quote  
  19. Code:
    -no-scenecut <boolean> E..V.... When lookahead is enabled, set this to 1 to disable adaptive I-frame insertion at scene cuts (default false)
    -zerolatency <boolean> E..V.... Set 1 to indicate zero latency operation (no reordering delay) (default false)
    -strict_gop <boolean> E..V.... Set 1 to minimize GOP-to-GOP rate fluctuations (default false)
    -aud <boolean> E..V.... Use access unit delimiters (default false)
    -bluray-compat
    All above active will improve seek-ability.

    Code:
    -forced-idr <boolean> E..V.... If forcing keyframes, force them as IDR frames. (default false)
    may improve seek-ability

    sane/reasonable value of
    Code:
    -qp <int> E..V.... Constant quantization parameter rate control method (from -1 to 51) (default -1)
    with
    Code:
    -rc <int> E..V.... Override the preset rate-control (from -1 to INT_MAX) (default -1)
    constqp E..V.... Constant QP mode
    may also improve overall time characteristic.
    Quote Quote  
  20. Doesn't make sense to me.
    -no-scenecut will keep the encoder from inserting additional key frames. Less key frames means slower seeking.
    -zerolatency should disable b frames. Often b frames are encoded so they are discardable, i.e. they can be skipped when seeking. Again: that would slow down seeking if a player is smart. (But I don't know how this works exactly in NVENC(*).)
    -strict_gop .. No idea why this would improve seeking. At least on average it shouldn't make any difference.
    -aud shouldn't make any difference.
    -blu-ray compat ???
    -forced-idr shouldn't make any difference (unless muxer/demuxer is broken)
    Quote Quote  
  21. Member Bernix's Avatar
    Join Date
    Apr 2016
    Location
    Europe
    Search Comp PM
    I think there is something wrong, even exported properly from ffmpeg. Doesn't understand
    -init_qpB <int> E..V.... Initial QP value for B frame (from -1 to 51) (default -1)
    As I think, nvenc Hevc doesn't support b-frames at all. Weird...

    Bernix
    Quote Quote  
  22. 3 years and some months later,
    while trying to solve a different issue,
    I discovered this pack of codecs https://shark007.net/advanced.html and it completely fixed the extremely slow seak problem I had when using Windows Media Player and mp4 videos encoded with H265.

    Hope you find this helpful as much as I did!
    Cheers!
    Quote Quote  



Similar Threads

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