如何从 H.264 视频中提取比特流?

How to extract the bitstream from H.264 video?

我有一个 H.264 视频,我想从中提取比特流。换句话说,我需要知道通过 H.264 标准编码视频后的流。我将在 Matlab 中使用提取的流。我该怎么做(提取比特流)?是否可以使用 ffmpeg?如果可以,命令是什么。

您可以使用

ffmpeg -i in.mp4 -c copy -f h264 stream.264

根据 MA​​TLAB 的预期,您可能需要添加比特流过滤器

ffmpeg -i in.mp4 -c copy -f h264 -vbsf h264_mp4toannexb stream.264