audio-sync with #duplicate to separate raw output files
Posted: 28 Nov 2013 15:42
I'm using VLC to receive a 30Mbps H.264 RTP stream, which I would then like to decode and output to separate files of raw audio and video data.
This is the command line I use:
This works, except when the network stream is corrupted. If VLC can't decode a frame it simply drops it, so I end up with the raw audio file being of longer duration than the raw video file. There is no way to correct this because I don't know which frames of video were dropped.
If I open the stream in the normal VLC desktop interface then it corrects this problem by duplicating video frames to fill the gaps left by the frames it could not decode.
I had a look for a command line option to do this and found two:
Having still not mastered the intricacies of the VLC command line, I've used them in places that seem correct and don't cause complaints from VLC:
However, that doesn't seem to have any effect, other than causing VLC to output some errors:
Google and the forum search don't find any complaints about the audio-sync options not working, so I assume it's because of the way I'm separating the audio and video. Does #duplicate cause the two transcodes to behave totally separately? If so, can someone suggest an alternative command line that will achieve what I'm trying to do?
VLC reports its version as: 2.0.8 Twoflower (2.0.8a-0-g68cf50b)
I'm running Ubuntu 12.04 with kernel 3.2.0-54-generic, in case that's relevant.
Many thanks.
This is the command line I use:
Code: Select all
vlc -vvv -I dummy --extraintf http --http-port=9090 /home/npf/in.sdp --sout '#duplicate{dst="transcode{vcodec=UYVY}:std{mux=raw,access=file,dst=/tmp/video.uyvy422}",select="noaudio",dst="transcode{acodec=s16l}:std{mux=raw,access=file,dst=/tmp/audio.s16l}",select="novideo"}'
If I open the stream in the normal VLC desktop interface then it corrects this problem by duplicating video frames to fill the gaps left by the frames it could not decode.
I had a look for a command line option to do this and found two:
which appears to be related to the 'transcode' output module, and;audio-sync
When this option is enabled, VLC will drop/duplicate video frames to synchronize the video track on the audio track.
which I suppose is an '--sout' option.--sout-transcode-audio-sync, --no-sout-transcode-audio-sync
Synchronise on audio track (default disabled)
This option will drop/duplicate video frames to synchronise the video track on the audio track. (default disabled)
Having still not mastered the intricacies of the VLC command line, I've used them in places that seem correct and don't cause complaints from VLC:
Code: Select all
vlc -vvv -I dummy --extraintf http --http-port=9090 /home/npf/in.sdp --sout-transcode-audio-sync --sout '#duplicate{dst="transcode{vcodec=UYVY,audio-sync}:std{mux=raw,access=file,dst=/tmp/video.uyvy422}",select="noaudio",dst="transcode{acodec=s16l,audio-sync}:std{mux=raw,access=file,dst=/tmp/audio.s16l}",select="novideo"}'
Code: Select all
[0x7ffde8004bd8] stream_out_transcode stream out debug: drift is too high, resetting master sync
[0x7ffddc000ff8] avcodec encoder warning: almost fed libavcodec with two frames with the same PTS (4846610504)
VLC reports its version as: 2.0.8 Twoflower (2.0.8a-0-g68cf50b)
I'm running Ubuntu 12.04 with kernel 3.2.0-54-generic, in case that's relevant.
Many thanks.