Page 1 of 1

how to play second video stream in one file? I need your help

Posted: 08 Oct 2018 08:52
by youngJ
Please understand me, English is difficult to me.

Hello guys~

I'm trying to make an android app to play some videos by using libvlc.


in one .avi file, there are two video stream, one audio stream.

I don't know how to convert these two video stream in one .avi file. I can just play first video stream in one .avi file. I can't play second video stream in one .avi file.

please let me know some command line options , or how to check the video streams in one file or some keywords to I have to know to do like what I want do...

Thank you

Re: how to play second video stream in one file? I need your help

Posted: 08 Oct 2018 11:19
by mfkl
not sure I understood what you're trying to achieve but for CLI options have a look here: https://wiki.videolan.org/VLC_command-line_help/

Re: how to play second video stream in one file? I need your help

Posted: 10 Oct 2018 03:09
by youngJ
not sure I understood what you're trying to achieve but for CLI options have a look here: https://wiki.videolan.org/VLC_command-line_help/
Thank you for reply, and I'm sorry for my poor English.
so I try to explain my case again .

I'm making a video player android app with JAVA Language, with Android Studio, with libVLC

I had made a sample app to play this MyVideoFile.avi file.

I can play only Video#1 and Audio in MyVideoFile.avi file.
I don't know how to play Video#2 and Audio in MyVideoFile.avi file.

So my problem is that I don't know how to play Video#2,Audio in MyVideoFile.avi...

Please advise me. I want to play Video#2 and Audio in MyVideoFile.avi.
Which option or method do I have to use ?
please give me some keywords or examples or links~


This is an information about the MyVideoFile.avi file.
This video file has two video streams and one audio stream.

General
Complete name : MyVideoFile.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 38.3 MiB
Duration : 20 s 200 ms
Overall bit rate : 15.9 Mb/s

Video #1
ID : 0
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, RefFrames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : H264
Duration : 20 s 136 ms
Bit rate : 8 029 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Original height : 1 088 pixels
Display aspect ratio : 16:9
Frame rate : 30.045 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.129
Stream size : 19.3 MiB (50%)

Video #2
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, RefFrames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : H264
Duration : 19 s 976 ms
Bit rate : 5 008 kb/s
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 30.036 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.181
Stream size : 11.9 MiB (31%)

Audio
ID : 2
Format : PCM
Format settings : Little / Signed
Codec ID : 1
Duration : 20 s 200 ms
Bit rate mode : Constant
Bit rate : 384 kb/s
Channel(s) : 1 channel
Sampling rate : 24.0 kHz
Bit depth : 16 bits
Stream size : 947 KiB (2%)
Alignment : Aligned on interleaves
Interleave, duration : 50 ms (1.50 video frames)

Re: how to play second video stream in one file? I need your help

Posted: 10 Oct 2018 09:47
by mfkl
Which wrapper are you using for libvlc on android?

In any case you should probably look at video track information and how to switch video track.
this is how vlc-android does it https://code.videolan.org/videolan/vlc- ... yer.c#L761
libvlc doc to set the track https://www.videolan.org/developers/vlc ... 92d3f41520

Re: how to play second video stream in one file? I need your help

Posted: 11 Oct 2018 04:04
by youngJ
Which wrapper are you using for libvlc on android?

In any case you should probably look at video track information and how to switch video track.
this is how vlc-android does it https://code.videolan.org/videolan/vlc- ... yer.c#L761
libvlc doc to set the track https://www.videolan.org/developers/vlc ... 92d3f41520
Thank you so much~ :D