How to re-multiplex Multiple Program Transport Stream (MPTS) files into a single TS?

依然范特西╮ 提交于 2019-12-08 14:24:32

问题


I have multiple MPTS files recorded from satellite receivers, I need to cherry pick programs/services/PIDS from each file re-multiplex them into a single MPTS file. Optionally I might be able to get away with taking all the services from every file and adding them to the final MPTS (In case anyone knows about a multiplexer that wouldn't allow me to cherry pick programs)

Does anybody know how to do this with open source or free software (like VLC or ffmpeg for example) under either windows or linux?


回答1:


I ended up using the multiplexer package from Oskar Schirmer @ scara.com, which was the only one open source solution I could find, I'm not even sure if this project is being maintained, but it works.

The exact command to cherry pick a PID in a MPTS ts file (to another file) is:

iso13818ts -F 500 --file 1 source.ts --ts 1 2 13 > destination.ts

Where:

  • -F 500 is the time in ms to send the PSI tables (PAT & PMT)
  • --file 1 source.ts specifies an input file (source.ts) and gives it a referral id (1)
  • --ts 1 2 13 tells the command file 1 is a ts, take program 2 and remap it to program 13 on the output
  • standard output is the resulting ts, so it needs to be redirected to a file or piped

With this same command you can remultiplex the multiple MPTS streams at a time (as long as your system can keep up), so a short example would be:

iso13818ts -F 500 --file 1 source1.ts --file 2 source2.ts --ts 1 2 13 --ts 2 1 10 > dest.ts

Which takes program 2 from file 1 and makes it program 13, and program 1 from file 2 and makes it program 10 and puts the resulting TS into dest.ts



来源:https://stackoverflow.com/questions/23964980/how-to-re-multiplex-multiple-program-transport-stream-mpts-files-into-a-single

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