Delay when killing vlc while recording video AND audio

About encoding, codec settings, muxers and filter usage
ralf.butler
Blank Cone
Blank Cone
Posts: 24
Joined: 29 Aug 2009 23:53

Delay when killing vlc while recording video AND audio

Postby ralf.butler » 19 May 2010 12:17

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

ralf.butler
Blank Cone
Blank Cone
Posts: 24
Joined: 29 Aug 2009 23:53

Re: Delay when killing vlc while recording video AND audio

Postby ralf.butler » 26 May 2010 01:44

bump

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Delay when killing vlc while recording video AND audio

Postby Rémi Denis-Courmont » 26 May 2010 18:44

I'm afraid this is a limitation of the ALSA input. I don't know if there's an easy way to fix this.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

ralf.butler
Blank Cone
Blank Cone
Posts: 24
Joined: 29 Aug 2009 23:53

Re: Delay when killing vlc while recording video AND audio

Postby ralf.butler » 30 May 2010 00:01

Thanks Remi. Would oss make any difference?

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Delay when killing vlc while recording video AND audio

Postby Rémi Denis-Courmont » 30 May 2010 09:23

I don't know.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

ralf.butler
Blank Cone
Blank Cone
Posts: 24
Joined: 29 Aug 2009 23:53

Re: Delay when killing vlc while recording video AND audio

Postby ralf.butler » 08 Jun 2010 14:20

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

Rémi Denis-Courmont
Developer
Developer
Posts: 15266
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Delay when killing vlc while recording video AND audio

Postby Rémi Denis-Courmont » 08 Jun 2010 19:04

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.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 31 guests