Menu

Movie files enable cache.

sys king
2018-02-05
2018-04-13
  • sys king

    sys king - 2018-02-05

    When movie file encoding to h264 without -force_key_frames or use -g 1 -coder 0 flag while the ffmpeg encoding, usually make player's timeline drag performance very slow, but the image sequence with cache does not.

    Encode examples(with -force_key_frames, -g 1 -coder 0 ) [better performance]

    ffmpeg -i "input.mov" -c:v libx264 -crf 15 -profile:v main -force_key_frames "expr:gte(t,n_forced*2)" -g 1 -coder 0 -pix_fmt yuv420p -x264opts min-keyint=1:ref=1 -movflags faststart -f mov "output.mov"
    
    -forcekeyframe "expr:gte(t,nforced2)" : Make playback frame more correct
    -g 1 -coder 0                         : Make movie playback drag faster
    

    Flag Description

    -g <integer> (FFmpeg)
    Keyframe interval, also known as GOP length. This determines the maximum distance between I-frames. Very high GOP lengths will result in slightly more efficient compression, but will make seeking in the video somewhat more difficult. 
    
    -coder 0 (FFmpeg) 
    CABAC is the default entropy encoder used by x264. Though somewhat slower on both the decoding and encoding end, it offers 10-15% improved compression on live-action sources and considerably higher improvements on animated sources, especially at low bitrates. It is also required for the use of trellis quantization. Disabling CABAC may somewhat improve decoding performance, especially at high bitrates. CABAC is not allowed in Baseline Profile.
    

    But most of people don't use "-force_key_frames" and "-g 1 -coder 0" flag to encode movie file, so if any possible to enable cache movie files (forward caching, but limit cache size ), could be better ui dragging feedback of the timeslider, i think.

    This will very helpful.

     
  • ggarra13

    ggarra13 - 2018-02-05

    I am unable to reproduce the behavior you mention with the conversion line in your message. I see the movie plays back fine and the cache behaves as it usually does. Also, seeking works fine.

     
  • sys king

    sys king - 2018-04-13

    Hi gga, thank for your reply.

    This issuse is not about the how to encode movie file codec, just for the cached playback.

    I see you mention the movie file playback have cache frame support.

    When I play the image sequence (EXR) doesn't get any slow down when I drag the time slider, but movie file does.

    If the all movie or image frames is cached, player should alway use cache frame data (if memory is not a problem) to render on the screen, so image sequence and movie drag time slider performance should be same, but movie file with cached all frame drag time slider performance is slower than image sequences.

    Or just another issue, not about the cache?

     
    • ggarra13

      ggarra13 - 2018-04-13

      When I play the image sequence (EXR) doesn't get any slow down when I drag the time slider, but movie file does.

      I don't see this behavior. Only when stereo movies are played I see a minor slowdown when switching frames (sliding in the timeline).

       

Log in to post a comment.

MongoDB Logo MongoDB