[FFmpeg-trac] #4525(ffmpeg:new): Multi-program structure of input is not preserved in MPEG-TS output

FFmpeg trac at avcodec.org
Mon May 15 23:34:45 EEST 2023


#4525: Multi-program structure of input is not preserved in MPEG-TS output
-------------------------------------+-------------------------------------
             Reporter:  Stefano      |                    Owner:  (none)
  Sabatini                           |
                 Type:  enhancement  |                   Status:  new
             Priority:  wish         |                Component:  ffmpeg
              Version:  git-master   |               Resolution:
             Keywords:  mpegts       |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Comment (by Mike G):

 I wish ffmpeg had a true "copy" handling for MPTS.  Many times I just want
 to remux MPTS into a different protocol while keeping all the descriptors
 the same.  You can get close by manually mapping, like

 {{{
 ffmpeg -i  INPUT -codec copy -flush_packets 0 -map p:3 -map p:4 -map p:5
 -map p:6 -program title=Prog3:st=0:st=1:st=2 -program
 title=Prog4:st=6:st=3 -program title=Prog5:st=8:st=4 -program
 title=Prog6:st=7:st=5 -f mpegts OUTPUT
 }}}


 There is an issue with for live streams (like UDP/RTP) since FFmpeg may
 change the stream index (st)  on subsequent probes, so you can't predict
 st=NN arg for bulky MPTS.  If -program could take a PID argument, it would
 be worth a bounty.

 A typical use case could be taking a broadcast TS and send out HLS, but
 while keeping everything about the source intact.  I haven't found a tool
 that can do this, so I had to write my own.  I don't have to even bother
 with any TS data except for finding I-frames for segmenting, everything
 else is just copy as is.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/4525#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list