Scripting batch CD transcode to flac randomly drops tracks

*nix specific usage questions
rmvb
Blank Cone
Blank Cone
Posts: 47
Joined: 19 Oct 2011 11:14
Operating System: Linux

Scripting batch CD transcode to flac randomly drops tracks

Postby rmvb » 15 Dec 2016 13:05

Hi
I'm failing to have this job done in ubuntu 14.04 (vlc 2.1.6)
I'm afraid this is not a vlc bug (sorry), only my poor scripting skills.
I added a sleep 10 in the loop, but it randomly forgets tracks, never the same ones.
Any help please ?
Here is the script, which is tweaked from the wiki to have the CD as input source, because source being a CD, I cannot follow the instruction stating to save the script in the source folder.

Code: Select all

#!/bin/bash #user id u=`id -u` #CD path p="/run/user/$u/gvfs/cdda:host=sr0/" acodec="flac" arate="128" sr=44100 ext="flac" mux="flac" vlc="/usr/bin/cvlc" fmt="wav" for i in $p*$fmt; do #prepend path $p to *$fmt from cvflac2ogg.sh echo $i >> /home/sarah/Musique/log n="`basename -z -s .$fmt $i`" # -z wrongly removes spaces, but goodly removes newline echo $n echo -e $n f=./${n%%.${fmt}} #n%% from cvflac2ogg.sh; May not be required here echo $f echo -e $f $vlc -vvv "$i" --sout "#transcode{vcodec=none,acodec=$acodec,ab=$arate,channels=2,samplerate=$sr}:standard{mux=$mux,dst=\"$f.$ext\",access=file{no-overwrite}}" vlc://quit sleep 10 done #Other options & Windows: https://wiki.videolan.org/Transcode#Non-Interactive_Batch_Transcoding_.28Linux.29
Here is what happened on my last run:
CD has 11 tracks (Pink Floyd Pulse Cd1 - Live recording, this may be useful to know)
Only tracks 3/4/6/8/9/11 were extracted, longer than genuine, with no data in the end. flacFiles lenght below are reported by rythmbox (vlc doesn't show length of these files), but maybe this is unrelated issue:
Track 1.wav=13:35 -> no file
Track 2=4:20 -> no file
Track 3=4:09 -> flacFile=4:26
Track 4=5:15 -> flacFile=5:34
Track 5=6:52 -> no file
Track 6=6:56 -> flacFile=7:49
Track 7=4:39 -> no file
Track 8=4:30 -> flacFile=5:51
Track 9=10:49 -> flacFile=13:27
Track 10=7:52 -> no file
Track 11=7:07 -> flacFile=10:15 (e.g. this one on another PC shows KO 10:29 in rythmbox and OK 7:07 when imported with audacity)
I already noticed this length longer than expected before, when doing one by one with the GUI.
I couldn't find any light searching for "warn" or "error" in the console, although -vvv.
Although, I found the following matches, that are consistent with output created/not created:
Track 11[.wav]=>11
Track11=>8 (4 match my echos)
Track 10[.wav]=>2 ("adding item" then "Creating an input for")
Track10 =>4 (match my echos)
Track 9[.wav]=>11
Track9=>8
Track 8[.wav]=>11
Track8=>8
Track 7[.wav]=>2
Track7=>4
Track 6[.wav]=>11
Track6=>8
Track 5[.wav]=>2
Track5=>4
Track 4[.wav]=>11
Track4=>8
Track 3[.wav]=>11
Track3=>8
Track 2[.wav]=>2
Track2=>4
Track 1[.wav]=>2
Track1=>4

My small log/tracking file shows

Code: Select all

/run/user/1000/gvfs/cdda:host=sr0/Track 10.wav /run/user/1000/gvfs/cdda:host=sr0/Track 11.wav /run/user/1000/gvfs/cdda:host=sr0/Track 1.wav /run/user/1000/gvfs/cdda:host=sr0/Track 2.wav /run/user/1000/gvfs/cdda:host=sr0/Track 3.wav /run/user/1000/gvfs/cdda:host=sr0/Track 4.wav /run/user/1000/gvfs/cdda:host=sr0/Track 5.wav /run/user/1000/gvfs/cdda:host=sr0/Track 6.wav /run/user/1000/gvfs/cdda:host=sr0/Track 7.wav /run/user/1000/gvfs/cdda:host=sr0/Track 8.wav /run/user/1000/gvfs/cdda:host=sr0/Track 9.wav
Any help will be greatly appreciated. Thanks you
[EDIT] : the log for e.g. track2 and track3 look very different. Should I post them here ? (w | w/o the hex code on each line ?)

rmvb
Blank Cone
Blank Cone
Posts: 47
Joined: 19 Oct 2011 11:14
Operating System: Linux

Re: Scripting batch CD transcode to flac randomly drops tracks

Postby rmvb » 20 Dec 2016 14:55

I did the job track at once with the GUI.
This is not a very powerful laptop.
Then trying to run same kind of script to convert the flac's to ogg's, I met the same weird behaviour : some track were not converted. I moved the yet-done flac's to another folder and re-ran the script, which again dropped some files... an so on until they are all done.


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 9 guests