ffmpeg - 使用 FFMPEG 将 HEVC 视频多路复用为 MPEG 传输流

标签 ffmpeg command-line-arguments mpeg hevc transport-stream

我想将 HEVC 编码的视频多路复用到 MPEG-Transportstream 中。

我有一个用 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 

关于ffmpeg - 使用 FFMPEG 将 HEVC 视频多路复用为 MPEG 传输流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40109358/

相关文章:

ffmpeg.exe 在 3gp 文件转换 flv 时不起作用

java - 如何从命令行对目录中的所有文件运行 Java 程序

c++ - MPEG ADTS格式识别

ffmpeg - AVFrame 中给定宏 block 的 YUV 值

c++ - 在 Visual Studio C++ 上使用 ffmpeg 库编码视频时出现断言错误

linux - Cmake 将命令行参数添加到二进制文件

c++ - 如何使用 libmpg123 控制一首歌的速度?

file - 使用 ffmpeg 连接文件并没有像我预期的那样工作。为什么?

linux - 将 ffmpeg 结果重定向到另一个文件

Python 参数解析 : both optional and positional value for an argument