Created by dan on Tuesday 27th October, 2009 at 9:28 AM
Tags: Linux, Ubuntu, VLC
Well, it all started when I had the need to record a multicast DVB transport stream in to a standard transport stream file (.ts) using VLC on Ubuntu Server. After some looking around, I found a simple command which I thought done the job perfectly:
vlc -vvv udp:@239.192.4.2:5004 --sout file/ts:STREAM.ts
So the above would pull in the RTSP stream running over port 5004 on 239.192.4.2 and output the stream as a file called 'STREAM.ts'. At the same time, the top level of verbosity is enabled to provide as much information as possible.
This worked as required, and threw the content of the stream in to a file. Now, more recently, I've found the need to grab and subtitles that are running through the multicasted transport stream. Unfortunately, the above command did not do this.
After much Googling, I found out that VLC by default will record the first elementary streams (or PIDs), the audio and video. There was one line I found to make the magic happen, which may cause issues in various circumstances, but done the job for me. As far as I can make out, it'll record ALL PIDs that come through the transport stream.
vlc -vvv udp:@239.192.4.2:5004 --sout file/ts:STREAM_WITH_SUBTITLES.ts --sout-all
With the command above, I found VLC to print some information a few seconds in to recording, which related to subtitles. Upon playing back the content in VLC player on a Mac, the option for the subtitle tracks appeared, and they worked as expected.
I hope this helped some of you out, as it took me a while to figure this one.