transport stream - extracting information

半腔热情 提交于 2019-12-08 07:56:44

问题


I have entire mux with four channels dumped in a single *.ts file. I'm demultiplexing that and I can't find any info on how to extract the resolution, framerate, codec, language, channels, etc...

Should I read macroblocks, or do something else?

Thnx.


回答1:


Here is the listing of where to look for the information:

  1. Number of programs, their description etc. : PAT and PMT.

  2. The number of Audio and languages and additional information : SDT, BAT etc.

  3. Codec - refer to PES header - stream_id and look up in MPEG 2 systems standard.

  4. Resolution, and frame rate, 4.2.0/4.2.2 - sequence header in MPEG 2 video elementary stream.

  5. Bitrate - you can only estimate by counting number of packets(x 188bytes) between two PCR packets and the PCR distance.

Append your question for more specific fields.




回答2:


If you are just demultiplexing, it suffices to read the PAT and PMT and split the streams based on their PIDs, and create new PATs and PMTs for the streams.

Something like gstreamer or vlc may be helpful as it already has a lot of code for manipulating transport streams.



来源:https://stackoverflow.com/questions/4240806/transport-stream-extracting-information

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!