Burning dvbsub's from a Multi-program Transport Stream

About encoding, codec settings, muxers and filter usage
csr
Blank Cone
Blank Cone
Posts: 13
Joined: 20 Sep 2006 09:24

Burning dvbsub's from a Multi-program Transport Stream

Postby csr » 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)

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"'
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.

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"'
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

Code: Select all

ffmpeg -i mux1.ts
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"?

csr
Blank Cone
Blank Cone
Posts: 13
Joined: 20 Sep 2006 09:24

Re: Burning dvbsub's from a Multi-program Transport Stream

Postby csr » 02 Dec 2010 08:50

Just as followup if anyone's interested, I found that the above command line occasionally stalls, whereas if I pipe the result to ffmpeg for remuxing it works better, so the above would end with

Code: Select all

mux=ts,dst='-'}",select="program=213"' | ffmpeg -i - -async 2 -acodec copy -vcodec copy -f flv s.flv
I would have thought that

Code: Select all

mux=ffmpeg{mux=flv}
would have exactly the same effect as piping to ffmpeg, but perhaps they use two different versions of ffmpeg's flash-muxer.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 5 guests