简体   繁体   中英

FFMPEG: Convert WebM VP8/VP9 multi-resolution video to MP4 (H.264)

I have been trying to convert a multi-resolution WebM video ( VP9/VP8/H.264 ) (1280 x 1080 till the half, thereafter 1080 x 1280) to MP4 container with H.264 encoding for video.

When transcoded with FFMPEG is locking into the frame size it's encountering at the start of the video (1280 x 1080 in this case) when transcoded with libvpx (for VP8 and VP9) and libx264 (for H264).

The only instance i could get it right was when the Input WebM was having H.264 video and opus Audio, and ffmpeg was instructed to just copy the video stream and trans-code the Audio to aac only.

Is there way in make ffmpeg support multi-resolution video transcoding?

How to generate a sample video: On a Chrome or Firefox (on a device that supports auto rotation and has different resolution on portrait and landscape) that supports mediaRecorder API goto this link: https://webrtc.github.io/samples/src/content/getusermedia/record/ , start recording a video, while recording the video, change orientation, stop recording and download the video. file)

Discussion Reference: https://groups.google.com/a/webmproject.org/forum/#!topic/webm-discuss/IgumDyMAHY0

FFmpeg, as of time of writing, does not support resolution-changes mid-stream while encoding. There is a patchset to introduce this ability. motivated for raw video and VP8/9 encoders, but it stands abandoned.

Vlc Media Player from videolan.org can convert vp9 to h264. Under the Media menu, choose Convert/Save. One of the convert options is mp4 container with h264/mp3.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM