开发者

Transport Stream - Record MPEG2

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


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


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:

  1. 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.

  2. 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.

  3. 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜