VideoHelp Forum




+ Reply to Thread
Results 1 to 1 of 1
  1. We are implementing a video streaming based on VP9 and x264. We want to offer MPEG DASH and "normal" HTML5 video. That's why VP9 videos must be playable in all major browsers supporting VP9. Currently Chrome, Firefox and Android browser.

    Our conversion tool is ffmpeg.

    Now I'm running into a problem when trying to convert a video with a variable framerate (average framerate 29.970). The original video is named "fit.mov" and you find it attached to this post.

    Unfortunately it's not possible to upload webm videos here, so I've placed conversion results on our server for download:
    http://www.team-andro.com/download/fit-360.webm
    http://www.team-andro.com/download/fit_vor.webm
    http://www.team-andro.com/download/fit_mux-360.webm


    The problem is, that the final video (see "fit_mux-360.webm") is not seekable in Firefox. If you open the video in Firefox, it will start to play. But if you change the position one, two or three times, that will end up with the error message "Video can't be played because the file is corrupt".

    Convserion is done as follows:

    Code:
    ffmpeg -i fit.mov -vf scale=640:360 -r 29.970 -c:v libvpx-vp9 -threads 2 -cpu-used 4 -tile-columns 1 -frame-parallel 1 -keyint_min 150 -g 150 -pass 1 -passlogfile fit-360 -b:v 0 -crf 41 -an -f webm -dash 1 -y /dev/null  
    
    ffmpeg -i fit.mov -vf scale=640:360 -r 29.970 -c:v libvpx-vp9 -threads 2 -cpu-used 3 -tile-columns 1 -frame-parallel 1 -auto-alt-ref 1 -keyint_min 150 -g 150 -pass 2 -passlogfile fit-360 -b:v 0 -crf 41 -an -f webm  -dash 1 -y fit-360.webm 
    
    ffmpeg -i fit.mov -vn -ac 2 -c:a libvorbis -b:a 96k -f webm -dash 1 -y fit_vor.webm 
    
    ffmpeg -i fit-360.webm -i fit_vor.webm -flags +global_header -c:v copy -c:a copy -y fit_mux-360.webm
    Some explanations with respect to that:
    - The first two lines are a VP9 2-pass encoding, creating the video part (fit-360.webm)
    - In the third line the audio is created (fit-vor.webm)
    - In the fourth line video and audio are muxed togehther

    Some explanations with respect to video param settings:
    - cpu-used is set to 4 in the 1st and to 3 in the 2nd pass. That's to improve encoding performance.
    - tile-columns 1 and threads 2 make sure that 2 threads can be used during encoding.
    - keyint_min and g are both set to 150. That's done to reach keyframe-alignment which is a requirement of MPEG DASH.
    - r is set to 29.970 to achieve a constant frame rate. That's needed for MPEG DASH, too.


    Analyzing the videos I have noticed the following.

    If I only open the video or only the audio part in Firefox then everything seems fine. Both are searchable. But the muxed video isn't.

    When I take a look at the video part (fit-360.webm) with the help of mediainfo it says the following:

    Video
    ID : 1
    Format : VP9
    Codec ID : V_VP9
    Duration : 2mn 3s
    Bit rate : 447 Kbps
    Width : 640 pixels
    Height : 360 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 29.970 fps
    Bits/(Pixel*Frame) : 0.065
    Stream size : 6.58 MiB (95%)
    Language : English
    Default : Yes
    Forced : No


    That's what I'm expecting: Constant framerate at 29.970 fps

    For the muxed video (fit_mux-360.webm) mediainfo doesn't say the same:

    Video
    ID : 1
    Format : VP9
    Codec ID : V_VP9
    Bit rate : 427 Kbps
    Width : 640 pixels
    Height : 360 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Language : English
    Default : Yes
    Forced : No

    Now the video seems to have a variable framerate, which is not what I would expect.


    Can somebody explain that behaviour and tell me what I'm doing wrong?

    Thank you in advance.
    Image Attached Files
    Quote Quote  



Similar Threads

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