Split flac by cue file in Debian / Ubuntu / Linux

Update: I found  split2flac,which does all this automatically.

From aidanjm’s stuff :

Lossless audio files can be split by cue file using “shnsplit” (part of the “shntool” package). You will also need the “cuebreakpoints” tool (part of the “cuetools” package) and “cuetag” to transfer the tags.

Continue reading

Burning from the terminal

  • This is what I used to burn the firmware file to a cd with strict ISO9660 mode 1.
genisoimage -v -o YGD8827Av12.iso -V PIONEER -iso-level 1 YGD8827A.BIN

-v verbose

-o isofilename

-V volumelabel

-iso-level 1 allow only 8.3 filenames

YGD8827A.BIN filespec to save in the iso

Or… I can burn files directly to DVD with growisofs:

growisofs -Z /dev/scd0 -v  -V PIONEER -iso-level 1 YGD8827A.BIN
  • to finalize the session
growisofs -M /dev/dvd=/dev/zero

All your CLI CD/DVD burning needs with wodim, genisoimage, growisofs, and cdrdao

Problems with burning mostly happen with the frontend (k3b, gnomebaker, and the dreaded brasero), not so much with the backends (growisofs, wodim or cdrdao). So why not just learn how to do it on the command line?

What devices to use, as $user:

To check the cd/dvd drive options and capabilities for ATAPI devices:

$ wodim –devices
wodim: Overview of accessible drives (2 found) :
———————————————————
0 dev=’/dev/scd0′ rwrw– : ‘AOPEN’ ‘CD-RW CRW2440′
1 dev=’/dev/scd1’ rwrw– : ‘_NEC’ ‘DVD_RW ND-3540A’
———————————————————

Other alternatives are:

$ wodim dev=/dev/scd0 driveropts=help -checkdrive

and

$ wodim -prcap

Here are some useful examples using ’scd0′:

  • Information about a blank CD/DVD:

$ wodim dev=/dev/scd0 -atip

or

$ cdrdao disk-info –device ATA:1,0,0

  • Delete a rewritable disk:

$ wodim -blank=fast -v dev=/dev/scd0

or

$ cdrdao blank –device ATA:1,0,0 –blank-mode minimal

  • Clone a cd:

$ cdrdao copy –fast-toc –device ATA:1,0,0 –buffers 256 -v2

  • Clone a cd on the fly:

$ cdrdao copy –fast-toc –source-device ATA:1,1,0 –device ATA:1,0,0 –on-the-fly –buffers 256 –eject -v2

  • Create an audio cd from wav files with 12x speed:

$ wodim -v -eject -pad -dao speed=12 dev=/dev/scd0 defpregap=0 -audio *.wav

  • Burn a cd from bin/cue files:

$ cdrdao write –speed 24 –device ATA:1,0,0 –eject filenam.cue

  • Burn an ISO image:

$ wodim dev=/dev/scd0 driveropts=burnfree,noforcespeed fs=14M speed=8 -dao -eject -overburn -v something.iso

If you get a driveropts error, it is because burnfree is deprecated for some devices, therefore:

$ wodim dev=/dev/scd0 driveropts=noforcespeed fs=14M speed=8 -dao -eject -overburn -v something.iso

or

$ wodim dev=/dev/scd0 fs=14M speed=8 -dao -eject -overburn -v something.iso

  • Create an ISO image with all files (and subdirs) of a directory.

This can be burned with the command above (burn ISO image):

$ genisoimage -o myImage.iso -r -J -l directory

If you have a DVD burner, you can also use growisofs for burning to DVD, like burning an ISO image to DVD:

$ growisofs -dvd-compat -Z /dev/dvd=image.iso

  • Burn multiple files to DVD:

$ growisofs -Z /dev/dvd -R -J file-1 file-2 file-3 …

  • If there is space left on the DVD, you can append more files:

$ growisofs -M /dev/dvd -R -J file-1 file-2 file-3…

  • To finalise the session, you use:

$ growisofs -M /dev/dvd=/dev/zero

Some mencoder scripts

This mencoder script converts WMV into Xvid AVI:

#!/bin/bash
echo -e "   wmv2avi - converts wmv into Xvid avi \n"
echo -e "wmv2avi [wmv] [bitrate] [lame preset] [output] \n"
WMV=${1}
BITRATE=${2-2000}
LAMEPRESET=${3-standard}
AVI=${4-WMV%%.wmv}.avi
echo -e "\n $WMV --> $AVI \n"
echo -e "video bitrate = $BITRATE"
echo -e "LAME preset = $LAMEPRESET \n"
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=1:turbo:quant_type=mpeg \
-ofps 30000/1001 \
$WMV -o /dev/null
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=2:bitrate=$BITRATE:quant_type=mpeg \
-ofps 30000/1001 \
$WMV -o $AVI
rm divx2pass.log

And this one repeats the process for every WMV file in the dir:

#!/bin/bash
echo -e "   allwmv2avi - converte todos os wmv em Xvid \n "
echo -e "   allwmv2avi [bitrate] [lame preset] \n "
for file in *.wmv
do
BITRATE=${1-2000}
LAMEPRESET=${2-standard}
file=${file%%.wmv}
echo -e "\n $file : video bitrate = $BITRATE , LAME preset = $LAMEPRESET \n"
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=1:turbo:quant_type=mpeg \
-ofps 30000/1001 \
$file.wmv -o /dev/null
mencoder \
-oac mp3lame -lameopts preset=$LAMEPRESET \
-ovc xvid -xvidencopts pass=2:bitrate=$BITRATE:quant_type=mpeg \
-ofps 30000/1001 \
$file.wmv -o $file.avi
rm divx2pass.log
done

Change bitrate, fps, LAME presets.

Also to consider are the options -mc 10 or -noskip.

quant=h263 is better for low bitrates (softer video)