压缩 AVI 视频流,同时盲目复制另一个流
我有一堆格式有点奇怪的视频文件。有一个常规视频流,还有一个文本流,用于存储视频帧的精确时间戳(来自 GPS 同步硬件时钟)。以下是 ffmpeg 的输出示例:
Input #0, avi, from 'in.avi':
Duration: 00:00:52.13, start: 0.000000, bitrate: 311033 kb/s
Stream #0.0: Video: rawvideo, rgb32, 658x492, 30 tbr, 30 tbn, 30 tbc
Stream #0.1: Data: 0x0000
视频未压缩,因此我想对其进行压缩。我成功地使用 ffmpeg 来完成该部分。问题是,我想将数据流#0.1 映射到输出文件中,完全不变。我一直在尝试,但我找不到任何方法让 ffmpeg 做到这一点。它只想处理音频、视频和字幕流,并且文本不是有效的字幕格式。制作视频的人刚刚退休,因此更改输入格式不是一个选择。有什么想法吗?
I have a bunch of video files with a slightly weird format. There's a regular video stream, and there's also a text stream, which is being used to store precise time stamps of the video frames (from a GPS-synchronized hardware clock). Here's an example output from ffmpeg
:
Input #0, avi, from 'in.avi':
Duration: 00:00:52.13, start: 0.000000, bitrate: 311033 kb/s
Stream #0.0: Video: rawvideo, rgb32, 658x492, 30 tbr, 30 tbn, 30 tbc
Stream #0.1: Data: 0x0000
The video is uncompressed, so I want to compress it. I'm successfully using ffmpeg
for that part. The problem is, I want to map the Data stream #0.1 into the output file, completely unchanged. I've been trying and trying, but I can't find any way to make ffmpeg
do that. It only wants to deal with Audio, Video, and Subtitle streams, and the text is not in a valid subtitle format. The guy who made the videos just retired, so changing the input format is not an option. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,让我们考虑一下您在这里想要做什么:
好吧,我本来不想回答,但你的问题太开放了。
编辑:我读到 AVI 文件确实具有恒定的帧速率,因此您可以真正使用第一种技术并将第一帧的时间戳写入某个文件。
Well, let's consider what you are trying to do here:
Well, I didn't want to answer with an answer, but your question is too open-ended.
EDIT: I am reading that AVI files ARE indeed of a constant framerate, so you can really use first technique and write timestamp of the first frame to some file.