Page 1 of 1

Delay when killing vlc while recording video AND audio

Posted: 19 May 2010 12:17
by ralf.butler
Hi there,

can someone explain me why the killing the vlc recording of a video with audio takes by far more time than killing one without audio? This is how I record:

Code: Select all

#!/bin/bash DURATION=21600 cvlc --color --run-time=$DURATION v4l2:///dev/video2:width=320:height=240 :input-slave=alsa://hw:0,0 :v4l2-standard=0 :sout='#transcode{vcodec=mp4v,vb=1500,scale=1,acodec=mpga,ab=128,sfilter=marq}:std{access=file,mux=mp4,dst=output.mp4}' --sub-filter marq --marq-marquee "%D %H:%M:%S" --marq-position 6 & PID=$! # Takes up to 20min to kill vlc kill $PID wait $PID
'kill -9' would kill immediately, but the video can not be played afterwards ('no moov box error').

In contrast the same recording without audio (remove :input-slave=alsa://hw:0,0 and replace acodec=mpga,ab=128 with acodec=none) is killed with no delay.

Code: Select all

#!/bin/bash DURATION=21600 cvlc --color --run-time=$DURATION v4l2:///dev/video2:width=320:height=240 :v4l2-standard=0 :sout='#transcode{vcodec=mp4v,vb=1500,scale=1,acodec=none,sfilter=marq}:std{access=file,mux=mp4,dst=output.mp4}' --sub-filter marq --marq-marquee "%D %H:%M:%S" --marq-position 6 & PID=$! # Takes up to 20min to kill vlc kill $PID wait $PID
So it seems that the audio recording is the cause for the delay. Has someone an idea how I can avoid that delay issue?

Thank you,
Ralf

Re: Delay when killing vlc while recording video AND audio

Posted: 26 May 2010 01:44
by ralf.butler
bump

Re: Delay when killing vlc while recording video AND audio

Posted: 26 May 2010 18:44
by Rémi Denis-Courmont
I'm afraid this is a limitation of the ALSA input. I don't know if there's an easy way to fix this.

Re: Delay when killing vlc while recording video AND audio

Posted: 30 May 2010 00:01
by ralf.butler
Thanks Remi. Would oss make any difference?

Re: Delay when killing vlc while recording video AND audio

Posted: 30 May 2010 09:23
by Rémi Denis-Courmont
I don't know.

Re: Delay when killing vlc while recording video AND audio

Posted: 08 Jun 2010 14:20
by ralf.butler
Hi Remi,

I just tested it with oss and there are massive delays as well. E.g. after a 6hrs recording it takes up to 15minutes till vlc is terminated. Is it really a limitation of the input? Do you have more information about that? I've the impression that it is related to vlc, perhaps it syncs the audio to video at the end, or does some quality assurance. I have no idea what's going on there. But I would appreciate if you could refer to more information

In my case I need to record video and audio for 6hrs before starting the next 6hrs recording. A few seconds delay in between is fine, but not minutes. Do you know an alternative way?

Thanks a lot,
Ralf

Re: Delay when killing vlc while recording video AND audio

Posted: 08 Jun 2010 19:04
by Rémi Denis-Courmont
I don't know. I suspected a problem with the ALSA/OSS task getting stuck in the audio driver (if no data comes), but there may be another problem.