运输流和mpeg文件格式 [英] transport stream & mpeg file format

查看:40
本文介绍了运输流和mpeg文件格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将TS文件转换为mpeg文件.是否有任何文件描述这种过程?我知道TS架构,但是我不知道mpeg的文件架构.有关此主题的任何信息将不胜感激.

谢谢.

解决方案

您可能想要做的是将MPEG-TS(传输流)转换为MPEG-PS(节目流).MPEG-PS是标准.mpg文件的格式,以及DVD视频使用的格式.

您可能应该暂停使用ISO/IEC 13818-1标准.该标准包含所有MPEG-TS和MPEG-PS容器的详细信息(它不涵盖ISO/IEC 13818-2涵盖的编码视频).

幸运的是,这种转换非常简单,因为大多数整个MPEG-PS结构都包含在MPEG-TS格式内.传输流包含一系列188字节的数据包,每个数据包都有一个标头.PES(节目基本流)分组包含在分组有效载荷内.PES数据包包含实际的视频或音频有效负载.PES数据包可以是任何长度,并且大多数情况下它们跨越几个TS数据包.从传输流中对PES数据包进行解复用实际上仅涉及删除TS标头,并正确地将有效载荷数据连接起来以形成PES数据包.

一旦有了PES数据包流,就可以将它们多路复用为标准中规定的程序流"格式.因此,基本上,您不需要解析PES数据包或其内容,只需将它们从一种格式中取出,然后将其插入另一种格式中即可.

尽管转换非常简单,但仍需要进行大量工作,因为您将需要非常熟悉容器标准,并仔细解析位流以使事情变得正确.因此,即使我说转换很简单,也仅是在与其他格式转换相比很简单的情况下,您可能需要进一步深入研究视频数据.

I would like to convert a TS file to mpeg file. Is there any documents describing such process? I know the TS architecture, but I don't know mpeg's file architecture. Any info on this subject will highly appreciated.

Thank you.

解决方案

What you are probably wanting to do is convert from MPEG-TS (Transport Stream) to MPEG-PS (Program Stream). MPEG-PS is the format of a standard .mpg file as well as the format DVD video uses.

You probably should get a hold on the standard which is ISO/IEC 13818-1. This standard contains all of the MPEG-TS and MPEG-PS container details (it does not cover the coded video which is covered in ISO/IEC 13818-2).

Luckily, this conversion is rather simple since most of the entire MPEG-PS structure is contained within the MPEG-TS format. The transport stream contains a series of 188 byte packets that each have a header. PES (Program Elementary Stream) packets are contained within the packet payloads. PES packets contain the actual video or audio payload. A PES packet can be any length and most of the time they span several TS packets. Demuxing the PES packets from the transport stream really just involves removing the TS headers and concatenating the payload data correctly to form the PES packets.

Once you have a stream of PES packets, you will multiplex them into the Program Stream format as laid out in the standard. So basically, you don't need to parse the PES packets or their content, you can just lift them from one format and insert them into the other.

Even though the conversion is fairly simple, it still requires quite a bit of work since you will need to become pretty familiar with the container standard and be meticulous with your parsing of the bitstream to get things right. So even though I say the conversion is simple, that is only in the sense that it is simple compared to other format conversions where you might have to dig down further into the video data.

这篇关于运输流和mpeg文件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆