ffmpeg usage to encode a video to H264 codec format

后端 未结 5 1802
醉梦人生
醉梦人生 2021-01-30 06:42

I have a *.mp4 video file(MPEG4 video codec) and I am trying to convert this to a H264 video codec format(raw h.264 format) using ffmpeg on Linux(Version - FFmpeg version SVN-r0

5条回答
  •  再見小時候
    2021-01-30 07:21

    I used these options to convert to the H.264/AAC .mp4 format for HTML5 playback (I think it may help other guys with this problem in some way):

    ffmpeg -i input.flv -vcodec mpeg4 -acodec aac output.mp4
    

    UPDATE

    As @LordNeckbeard mentioned, the previous line will produce MPEG-4 Part 2 (back in 2012 that worked somehow, I don't remember/understand why). Use the libx264 encoder to produce the proper video with H.264/AAC. To test the output file you can just drag it to a browser window and it should playback just fine.

    ffmpeg -i input.flv -vcodec libx264 -acodec aac output.mp4

提交回复
热议问题