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
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.