Page 1 of 1

Set Video Track Via Command Line

Posted: 17 Aug 2009 02:58
by webwhammy
Please forgive me if the question I'm asking is answered elsewhere as I did indeed search the VLC forum, documentation and command-line help.

I'm running VLC media player 1.0.1 Goldeneye on Window XP 32bit.

How do I specify the video track from the command-line?

I'm opening a file by the name of 00333.m2ts and when opened, three video tracks are playing simultaneously. I only want to play video track 1 and audio track 5.

I'm able to achieve the desired result from the GUI Menu by clicking 'Video->Video Track->Disable' which stops all three video tracks and then clicking 'Video->Video Track->Track 1'. However, I need to be able to achieve this from the command-line options.

I would like to be able to set the video track by option similar to :video-track=1.

Does such an option exist?

I'm already successfully setting the audio track as follows:
:audio-track=5

The media information is as follows:

Stream 0
Type: Video
Original ID: 4113
Codec: WVC1
Resolution: 1920x1080
Display resolution: 1920x1080
Frame rate: 23.976023

Stream 1
Type: Audio
Original ID: 4352
Codec: dts
Channels: 3F2R/LFE
Sample rate: 48000 Hz
Bitrate: 1536 kb/s

Stream 2
Type: Audio
Original ID: 4353
Codec: dts

Stream 3
Type: Audio
Original ID: 4354
Codec: dts

Stream 4
Type: Audio
Original ID: 4355
Codec: dts

Stream 5
Type: Audio
Original ID: 4356
Codec: dts

Stream 6
Type: Audio
Original ID: 4357
Codec: dts

Stream 7
Type: Audio
Original ID: 4358
Codec: dts

Stream 8
Type: Audio
Original ID: 4359
Codec: dts

Stream 9
Type: Audio
Original ID: 4360
Codec: dts

Stream 10
Type: Audio
Original ID: 4361
Codec: dts

Stream 11
Type: Audio
Original ID: 6656
Codec: dts

Stream 12
Type: Audio
Original ID: 6657
Codec: dts

Stream 13
Type: Video
Original ID: 6912
Codec: WVC1
Resolution: 720x480
Display resolution: 720x480
Frame rate: 23.976023

Stream 14
Type: Video
Original ID: 6913
Codec: WVC1
Resolution: 720x480
Display resolution: 720x480
Frame rate: 23.976023

Please help!

Thank you! :D

Re: Set Video Track Via Command Line

Posted: 17 Aug 2009 21:50
by VLC_help
There isn't option for video tracks.
http://trac.videolan.org/vlc/ticket/2407

Re: Set Video Track Via Command Line

Posted: 17 Aug 2009 23:22
by webwhammy
Thank you for the reply! :D

I did find a work-around that requires trans-coding and would like to share it in case anybody else may find it useful.

:audio-track=5 :sout=#transcode{vcodec=h264,vb=15999,scale=0.373,acodec=mpga,ab=192,channels=2,audio-sync}:duplicate{dst=std{access=file,mux=ts,dst=f:\de.mpg},select="es=4113,es=4357"}

In the above command-line the part that isolates the video track/stream I want is as follows:

select="es=4113"

where 'es' stands for elementary stream and the number that follows the equal sign is the ID of the stream/track.

The ID of the streams/tracks can be found in the VLC GUI interface Menu by clicking 'Tools->Codec Information' during play-back of media.

That codec/media information is what I had submitted in my first post and using the 'es module' I have identified additional data as follows:

stream 0 ID: 4113 Video Track 0 Feature Presentation
stream 1 ID: 4352 Audio Track 0 English
stream 2 ID: 4353 Audio Track 1 Spanish
stream 3 ID: 4354 Audio Track 2 French
stream 4 ID: 4355 Audio Track 3 Japanese
stream 5 ID: 4356 Audio Track 4 French
stream 6 ID: 4357 Audio Track 5 German
stream 7 ID: 4358 Audio Track 6 Italian
stream 8 ID: 4359 Audio Track 7 Spanish
stream 9 ID: 4360 Audio Track 8 English Commentary
stream 10 ID: 4361 Audio Track 9 English Commentary
stream 11 ID: 6656 Audio Track 10 Unknown
stream 12 ID: 6657 Audio Track 11 Unknown
stream 13 ID: 6912 Video Track 1 Commentary
stream 14 ID: 6913 Video Track 2 Commentary

I hope this information might help someone else in the community.

Thanks again! :P

Re: Set Video Track Via Command Line

Posted: 18 Aug 2009 13:53
by InsureMan
Still trying to have a DVD when started by Command line play a predetermined track. Typically a DVD will have 3 Audio Tracks, eg Track1 2.0, Track 2 Dolby 5.1, or Track 3 DTS 5.1.

From what I can find in the Forum one of the pieces of code that is discussed is using something like :

--audio-track=<integer> Audio track
Stream number of the audio track to use (from 0 to n).
Or

--audio-track-id=<integer> Audio track ID
Stream ID of the audio track to use.

I have tried both options and the DVD loads ok but try as I might I can not have the DVD load Track 3 for example.

My Example:
mstrPlay = DVDPath & " :no-video-title-show :Audio-Track=3 : -f : --aspect-ratio=" & """16:9" & """"
mvarRetVal = Shell(mstrPlay, 1)

Can someone provide some advice on how you go about starting a DVD by command line so that I can choose the Audio Track to load.

Re: Set Video Track Via Command Line

Posted: 22 Aug 2009 20:04
by webwhammy
It has been my experience that the command-line options are case-sensitive. Change
:Audio-Track=3
to :audio-track=3.

Also, when the GUI shows
Track 3
the command-line equivalent is track 2 (track 1=0, 2=1, 3=2 and so on). The GUI starts at track one and the command-line at track zero.

I hope this helps. :D

Re: Set Video Track Via Command Line

Posted: 25 Aug 2009 12:27
by InsureMan
Able to confirm that what you suggested worked, command-line options are case-senitive and the tracks are number from 0. Track 1=0

Many thanks