传输流 - 记录 MPEG2
我用 DVB 调谐器(MPEG 传输流)录制了一个频道,我能够查找频道内的 PAT/PMT 表并确定 VideoPID 和 AudioPID。 现在我想将一个视频/音频流录制到“普通”MPEG“*.mpg”文件中。
如果我在互联网上查找,我不会得到任何...嗯“简单”信息如何做到这一点,有人对我有提示吗?我不想使用 FFDShow 或任何外部工具,我想为自己编写该部分......:)
问候 基督教
I recorded a Channel with my DVB-Tuner (MPEG Transport Stream), i´m able to lookup the PAT/PMT Tables inside of the Channel and determ the VideoPIDs and AudioPIDs.
Now i want to record one Video/Audio stream to a "normal" MPEG "*.mpg" File.
If i lookup the internet i dont get any ... hmm "simple" Informations how to make this, does anybody have an hint for me ? I dont want to use FFDShow or any external tool, i want to code the part for myself... :)
Greets
Christian
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我知道您已经提取了 PAT 和 PMT 表。现在如果你想录制一个音频/视频流,你必须捕获特定PID的TS包。您可以从各个正在运行的通道(A/V 流)的 PMT 表中找到 PID。假设您发现特定通道的音频在 PID X 上作为 TS 数据包传输,那么您可以捕获具有 PID X 的所有 PID 数据包。一旦获得 PID X 的传输数据包,您就可以取出基本流从这些收集到的数据包中,这将是您的编码数据。现在您可以使用任何独立解码器/播放器播放此基本流。
谢谢,
海豚
I understand you already have extracted the PAT and the PMT tables. Now if you want to record one audio/video stream, you have to capture TS packets of a particular PID. You can find the PID from the PMT table of the various running channels ( A/V streams ). Lets say you have find that the Audio of a particular channel is transmitting as TS packets on PID X, then you can capture all the PID packets with PID X. Once you have the transport packets of PID X, you can take out the elementary stream out of these collected packets which will be your encoded data. Now you can play this elementary stream using any of the standalone decoders/players.
Thanks,
Dolphin
你的回答可能就是如何将TS流转换成PS流(.mpg)。
如概述所示,您需要执行以下操作:
识别所需视频和音频所在的正确 PID。通常,此信息位于 PAT/PMT 中,或者您可以通过 DVBsnoop 或 libdvbpsi 等外部工具提取该信息。
需要将TS包解包成PES包或者音频帧和视频图片。您必须保留数据包的PTS / DTS 值。
订购数据包(您感兴趣的 PS 格式)。您可以在此处使用 mlex 或此类工具。
我在这里已经做了深入的回答:
传输流和传输流mpeg 文件格式
You answer is possibly amounts to how does one convert the TS stream into PS stream (.mpg).
As in outline, you need to do following:
Identify the correct PID where your desired video and audio is. Usually, this information is there in PAT/PMT or you can just extract that information by external tools like DVBsnoop or libdvbpsi.
You need to de-packetize the TS packets into PES packets or Audio frames and Video pictures. you must preserve the PTS / DTS value of of the Packets.
order the packets (of your interest in PS format). you can use mlex or such tools here.
I have answered in depth here:
transport stream & mpeg file format