extracting h264 raw video stream from mp4 or flv with ffmpeg generate an invalid stream

后端 未结 1 839
遥遥无期
遥遥无期 2020-12-30 03:33

I\'m trying to extract the video stream from an mp4 or flv h264 video (youtube video) using ffmpeg. The original video (test.flv) play without trouble with ffplay , ffprobe

相关标签:
1条回答
  • 2020-12-30 03:55

    To extract a raw video from an MP4 or FLV container you should specify the -bsf:v h264_mp4toannexb or -vbfs h264_mp4toannexb option.

    ffmpeg -i test.flv -vcodec copy -an -bsf:v h264_mp4toannexb test.h264
    

    The raw stream without H264 Annex B / NAL cannot be decode by player. With that option ffmpeg perform a simple "mux" of each h264 sample in a NAL unit.

    0 讨论(0)
提交回复
热议问题