Burning dvbsub's from a Multi-program Transport Stream
Posted: 24 Nov 2010 14:05
I want to transcode a multi-program dvb transport-stream to .flv for streaming. It's also important that I can burn dvbsub's into the flash video. After a lot of hacking around I eventually came up with the following command line (for vlc 1.1.4)
The point of the first transcode step is that my stream also contain teletext subtitles which vlc can't handle and this acts as a kind of filter that only allows
dvbsub titles through. Also I need to use duplicate/select because --sout-all means that --program doesn't seem to work.
My remaining problem is that I actually have two dvbsub tracks and this command line overlays both of them which looks dreadful. I haven't been able to find any clever way to pick only one or the other. In particular, --sub-track seems to be just ignored or is overruled by --sout-all. So to get one or other track I need to specify the precise pid of the track I want, e.g.
which is fair enough, but means I have to set in an additional processing step to analyse and extract the pids for each program. For example, I can run over the output of with some regexps to find pids, but that seems a bit ugly. Is there any combination of --program, select, --sub-track etc. which is equivalent to "always give me the audio and video for this program and the first dvbsub track"?
Code: Select all
vlc mux1.ts --demux=ts --noaudio --novideo --play-and-exit --intf dummy --sout-all --sout '#duplicate{dst="transcode{senc=dvbsub}:transcode{vcodec=h264,acodec=aac,vb=200,venc=x264{profile=baseline,preset=superfast},soverlay,deinterlace,audio-sync,ab=96,width=466,height=240,samplerate=44100}:std{access=file,mux=ffmpeg{mux=flv},dst='s.flv'}",select="program=213"'
dvbsub titles through. Also I need to use duplicate/select because --sout-all means that --program doesn't seem to work.
My remaining problem is that I actually have two dvbsub tracks and this command line overlays both of them which looks dreadful. I haven't been able to find any clever way to pick only one or the other. In particular, --sub-track seems to be just ignored or is overruled by --sout-all. So to get one or other track I need to specify the precise pid of the track I want, e.g.
Code: Select all
vlc mux1.ts --demux=ts --intf dummy --play-and-exit --noaudio --novideo --sout-all --sout '#duplicate{dst="transcode{vcodec=h264,vb=200,venc=x264{profile=baseline,preset=superfast},soverlay,deinterlace,audio-sync,ab=96,width=466,height=240,samplerate=44100,acodec=aac,threads=0}:std{access=file,mux=ffmpeg{mux=flv},dst=s.flv'}",select="es=0x83f,es=0x849,es=0x858"'
Code: Select all
ffmpeg -i mux1.ts