Page 1 of 1
Does VLC Provide Stream Mapping Capability?
Posted: 25 Jan 2019 01:06
by Greg Frederick
My issue is that when recording with VLC, sometimes Audio = Stream 1, and Video = Stream 2. This is fine for playback if there is no pause in the recording. However, when there is a pause, two recording files are created, and for some reason the audio and video streams will be flipped. The issue I'm having is that when I mux the two recording files (i.e. segments), only part of the muxed output plays back (the other part has the streams flipped and looks/sounds as though it is a corrupt file).
I know it is possible to flip the streams with ffmpeg (ffmpeg.exe -i "input.flv" -map 0:1 -map 0:0 -c copy output.flv). However, I can't find any equivalent in VLC. It seems like there should be a command line tool that would force the video to always map to stream 1, so that this issue doesn't occur. Or at the very least, a command that will check whether segments' streams match, and flip any that don't, prior to muxing them together.
Any help would be greatly appreciated!
Re: Does VLC Provide Stream Mapping Capability?
Posted: 28 Jan 2019 10:21
by InTheWings
There's no stream mapping. Only stream filtering (and pid setup with ts).
Re: Does VLC Provide Stream Mapping Capability?
Posted: 28 Jan 2019 19:02
by Greg Frederick
Hi InTheWings,
Thank you for your response! When you say there is only stream filtering, are your referring to playback? In other words, there is no way to make the streams all match type (i.e. Video always = Stream 1) prior to merging segments?
Re: Does VLC Provide Stream Mapping Capability?
Posted: 29 Jan 2019 00:35
by Greg Frederick
There's no stream mapping. Only stream filtering (and pid setup with ts).
Is is possible to merge files together in a way that lines up media types instead of stream numbers? For instance, typically, merging files lines up stream 0 of file 1 with stream 0 of file 2. When the streams are swapped, this leads to a useless output file. Instead, can I specify instead that whichever stream has a specific attribute (e.g. resolution or codec) from file 1 lines up with the same for file 2? If yes, an example of what that command line looks like would be greatly appreciated
Re: Does VLC Provide Stream Mapping Capability?
Posted: 29 Jan 2019 10:20
by InTheWings
Stream order is only defined by data timings. If you have 2 recordings, yes that can happen.
if that's muxed with ts, video pid is still the same.
other formats, vlc can't remap
Re: Does VLC Provide Stream Mapping Capability?
Posted: 29 Jan 2019 21:52
by Greg Frederick
Stream order is only defined by data timings. If you have 2 recordings, yes that can happen.
if that's muxed with ts, video pid is still the same.
other formats, vlc can't remap
Hi InTheWings,
Thank you again! I apologize for my beginner level ignorance, but I'm still having difficulty understanding. My original files were in FLV format, so I converted them to TS format. I then used the following command to mux them together:
"C:\Program Files\VideoLAN\VLC\vlc.exe" input0.ts input1.ts --sout "#gather:std{access=file,dst=out.ts}" --sout-keep
However, the output file still has the issue caused by the streams being swapped on one of the original two files. What am I missing? Would you be so kind as to modify my command line? It is difficult to find beginner level how-tos for VLC that are up-to-date.
Re: Does VLC Provide Stream Mapping Capability?
Posted: 30 Jan 2019 18:41
by Greg Frederick
Hi InTheWings,
I found this page -
https://wiki.videolan.org/VLC_HowTo/Mer ... _together/, which states "if you are wanting to join streams that do not have matching video/audio, then it is recommended to transcode. Given your advise regarding using TS, I modified the example code to the following:
"C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv input0.ts input1.ts --sout-keep --sout=#gather:transcode{vcodec=h264,vb=960,scale=1,acodec=mp4a,ab=64,channels=2}:standard{access=file,mux=ts,dst=out.ts} --sout-all -I dummy "vlc://quit"
However, when I run that command, the output does not line up the video streams. Is the wiki wrong, or am I missing something? If it has something to do with the PIDs you referenced, would you please explain how to use those to line up the video and audio streams?
Re: Does VLC Provide Stream Mapping Capability?
Posted: 01 Feb 2019 17:50
by Greg Frederick
Is anyone able to help? I greatly appreciate all the hard work you devs put into this product. I just want the opportunity to learn how to better use it.