Sound device still blocked after killing vlc process

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

Sound device still blocked after killing vlc process

Postby ralf.butler » 03 Feb 2010 02:34

Hi All,

I repeatedly (endless loop) capture 6hrs of video and audio input with vlc:

Code: Select all

while [ 0 -eq 0 ]; do cvlc --run-time=21600 v4l2:///dev/video0 input-slave=alsa://hw:0,0 :v4l2-standard=0 :sout='#transcode{vcodec=mp4v,vb=800,scale=1,acodec=mpga,ab=128,sfilter=marq}:std{access=file,mux=mp4,dst=/tmp/out.mp4}' --sub-filter marq --marq-marquee "%D %H:%M:%S" --marq-position 6 & sleep 21605 # wait 5 sec in addition pid=$(ps ax | grep vlc | awk '{ print $1 }') kill $pid wait $pid done
These commands are part of a bash script 'record.sh' which is called once by fcron after the computer starts. fcrontab -l:

Code: Select all

SHELL=/bin/bash @volatile,first(1) 300m ~/record.sh > /dev/null 2>&1
Once started, everything works fine. Video and audio signals are encoded and recorded. When the first 6hrs passes by the vlc process is killed and the next vlc recording process is stared.

But here is the problem. The second and all following vlc recordings triggered by endless loop do not contain audio.
I have the impression that the sound device is still occupied. Probably I do not properly kill the recording process and I guess that invoking the script 'record.sh' via fcrontab contributes to the problem as well.

Is there someone who has an idea if the problem has something to do with vlc'?

Thank you,
Ralf

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

Re: Sound device still blocked after killing vlc process

Postby ralf.butler » 05 Feb 2010 02:17

Can anyone help me out with that. So far I found no solution.

Thanks,
Ralf

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

Re: Sound device still blocked after killing vlc process

Postby Rémi Denis-Courmont » 06 Feb 2010 11:38

Check that VLC is indeed completely killed with `ps faux`.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

mrtipale
Blank Cone
Blank Cone
Posts: 14
Joined: 16 Dec 2009 13:19
VLC version: many
Operating System: linux, windows
Location: Mumbai, Paris
Contact:

Re: Sound device still blocked after killing vlc process

Postby mrtipale » 11 Feb 2010 11:05

vlc do not release device & file quickly. I had similar prob on windows/linuxmachine. file access in win is diff from lin. still i recoommened to put some delay after u did

sleep1
#kill vlc_pid
sleep 2
skill vlc
kill -9 vlc_pid

This should solve ur problem. Trick worked for me on CentOS 5 & Win Xp pro.
Cheers,
Mahendra
mrtipale

mrtipale
Blank Cone
Blank Cone
Posts: 14
Joined: 16 Dec 2009 13:19
VLC version: many
Operating System: linux, windows
Location: Mumbai, Paris
Contact:

Re: Sound device still blocked after killing vlc process

Postby mrtipale » 11 Feb 2010 12:39

But if I use ur command in below manner, its not recording audio :

cvlc v4l2:///dev/video0 input-slave=alsa://hw:0,0 --sout='#transcode{vcodec=mp4v,vb=800,scale=1,acodec=mpga,ab=128}:duplicate{dst=std{access=file,mux=mp4,dst=/tmp/123.mp4}}'

it records only video, any suggestion?
mahendra@mahendra tmp]$ mp4info 123.mp4
mp4info version 1.5.0.1
tv.mp4:
Track Type Info
1 video MPEG-4 Simple @ L1, 9.132 secs, 1025 kbps, 640x480 @ 27.814279 fps

my audio recorder is fine. as
arecord -t wav -q -d 10 test.wav
records sounds very well.
I 've some china made webcam on OS FC11.
i was even thinking of running both video & audio recorders in sync & mixing tracks with other tool ..

want to explore vlc more.
Cheers,
Mahendra
mrtipale


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 36 guests