使用 FFMPEG 将 HEVC 视频复用到 MPEG 传输流中

Multiplex a HEVC-Video into a MPEG-Transportstream with FFMPEG

我想将 HEVC 编码视频多路复用到 MPEG 传输流中。

我有一个使用 x265 编码器编码的视频。

x265 raw.y4m --output coded.hevc

我想将此视频多路复用到 MPEG 传输流中。 我以这种方式尝试过:

ffmpeg -fflags +genpts -i coded.hevc -c:v copy -f mpegts transportstream.ts 

不幸的是,出现了这个错误消息,transportstream.ts 是空的。

[mpegts @ 0x1fa76a0] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mpegts @ 0x1fa76a0] first pts value must be set
av_interleaved_write_frame(): Invalid data found when processing input

就我的目的而言,有必要将这两个步骤分开进行。你能帮我找出多路复用视频的正确参数吗?

提前致谢。

两步过程有效:

ffmpeg -i coded.hevc -c copy coded.mp4

ffmpeg -i coded.mp4 -c:v copy transportstream.ts