Streaming a specific video track from a file containing multiple video streams

About encoding, codec settings, muxers and filter usage
reyes73a
New Cone
New Cone
Posts: 1
Joined: 19 Jul 2022 17:02

Streaming a specific video track from a file containing multiple video streams

Postby reyes73a » 19 Jul 2022 18:21

Hi,

I have a video file that contains two video streams in it. If I go under Tools-> Media Information-> Codec I can see two streams with different IDs listed. Furthermore, If I go to Video->Video Track I can see the two video tracks listed and I can select either one for viewing purposes or show both (another window will pop up). I am trying to have VLC transcode this original video into two different RTSP streams using the command line (each corresponding to a video track/stream from the original file/stream). Currently I transcode the original video file into an RTSP stream using the following command:

Code: Select all

vlc -q -vvv <File> --sout "#transcode {vcodec=h264,acodec=mpga,ab=128,channels=2,samplerate=44100,scodec=none}:rtp{sdp=rtsp://:8554/test1}"
Right now, if I open the resulting rtsp stream on another VLC instance I only see one video track. Therefore, the transcoding command is automatically picking the first video track and only transcoding that one. So how can I specific which track to transcode?

Similarly, how can I specify which video track to play using the following command:

Code: Select all

vlc -q -vvv testVideo.mpg
Any help is appreciated!!!

Thanks in advance

emcodem
Blank Cone
Blank Cone
Posts: 10
Joined: 05 Jul 2022 12:12

Re: Streaming a specific video track from a file containing multiple video streams

Postby emcodem » 20 Jul 2022 16:44

You didnt mention which kind of file it is. If it is a transport stream you might get away with the --program= option. If not, i believe vlc just cannot do what you want currently, so you'd have to rewrap your file to .ts before doing what you like. But if you do that, you could just use ffmpeg and extract the streams into separate files too or just use ffmpeg directly for what you want to do.

Program option takes service_id as parameter, it should be easy to analyze if you got a .ts stream.
https://wiki.videolan.org/VLC_command-line_help/

Also, similar topic here:
https://forum.videolan.org/viewtopic.php?t=133135


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 10 guests