[Cin] sox to lpcm

Andrew Randrianasulu randrianasulu at gmail.com
Sun Jan 21 12:14:59 CET 2024


here is my current dvd.sh

#!/bin/bash
sdir=`dirname $0`
dir=`cd "$sdir"; pwd`
echo "running /dev/shm//dvd_20240120-153459/dvd.sh"

rate=`soxi -r $dir/dvd.wav`
channels=`soxi -c $dir/dvd.wav`
bits=`soxi -b $dir/dvd.wav`

PATH=$PATH:/dev/shm/new-git/cinelerra/cinelerra-5.1/bin
sox $dir/dvd.wav  -V -t raw -x $dir/dvd-1.lpcm
mplex -f 8 -L $rate:$channels:$bits -o $dir/dvd.mpg $dir/dvd.m2v $dir/dvd-1.lpcm
#ffmpeg -i $dir/dvd.m2v -i $dir/dvd.wav -c:v copy -c:a pcm_dvd -fflags
+genpts  -f dvd $dir/dvd.mpg

rm -rf $dir/iso
mkdir -p $dir/iso

export VIDEO_FORMAT=PAL
dvdauthor -x - <<eof
<dvdauthor dest="$dir/iso">
  <vmgm>
    <fpc> jump title 1; </fpc>
  </vmgm>
  <titleset>
    <titles>
    <video format="pal" aspect="4:3" resolution="720x576"/>
    <audio format="pcm" lang="en"/>
    <pgc>
      <vob file="$dir/dvd.mpg" chapters="0:00:00.0"/>
    </pgc>
    </titles>
  </titleset>
</dvdauthor>
eof

echo To burn dvd, load blank media and run:
echo growisofs -dvd-compat -Z /dev/dvd -dvd-video $dir/iso
kill $$

====

basically my attempt at making ffmpeg working as muxer failed, so I
used soxi for getting info from wav file, and
then sox for converting audio and mplex (with soxi generated info) to
get final mpeg and dvdauthor it.


On Sun, Jan 21, 2024 at 12:49 PM Andrew Randrianasulu
<randrianasulu at gmail.com> wrote:
>
> command line:
>
> sox  /dev/shm/dvd_20240120-153459/dvd.wav -V -t raw -x
> /dev/shm/dvd_20240120-153459/dvd-1.lpcm
>
> I set output file to different name so I can compare pcm directly
> produced by cingg and sox-converted version.
>
> detailed output:
>
> sox  /dev/shm/dvd_20240120-153459/dvd.wav -V -t raw -x
> /dev/shm/dvd_20240120-153459/dvd-1.lpcm
> sox:      SoX v14.4.2
> sox INFO formats: detected file format type `wav'
>
> Input File     : '/dev/shm/dvd_20240120-153459/dvd.wav'
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 24-bit
> Duration       : 00:01:00.00 = 2880000 samples ~ 4500 CDDA sectors
> File Size      : 17.3M
> Bit Rate       : 2.30M
> Sample Encoding: 24-bit Signed Integer PCM
> Endian Type    : little
> Reverse Nibbles: no
> Reverse Bits   : no
>
> sox INFO sox: Overwriting `/dev/shm/dvd_20240120-153459/dvd-1.lpcm'
> sox INFO formats: `/dev/shm/dvd_20240120-153459/dvd-1.lpcm':
> overriding machine byte-order
>
> Output File    : '/dev/shm/dvd_20240120-153459/dvd-1.lpcm' (raw)
> Channels       : 2
> Sample Rate    : 48000
> Precision      : 24-bit
> Duration       : 00:01:00.00 = 2880000 samples ~ 4500 CDDA sectors
> Sample Encoding: 24-bit Signed Integer PCM
> Endian Type    : big
> Reverse Nibbles: no
> Reverse Bits   : no
> Comment        : 'Processed by SoX'
>
> sox INFO sox: effects chain: input        48000Hz  2 channels
> sox INFO sox: effects chain: output       48000Hz  2 channels
>
> =====
>
> so, modern sox (-w/-s options were deprecated and replaced by others -
> thankfully we do not need them if input file autodetected) can process
> wav files into lpcm suitable for mplex
>
> So, guide is much simpler in sense in cingg you just change audio to
> wav/24 bits, then run sox, and change mplex line to one including -L
> freq:channels:bits specification. May be you can even prepare text
> patch and apply it to dvd.sh ?
>
>  Oh, and in case of 24-bit audio at 48 khz you definitely want to
> lower your video bitrate ...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dvd.sh
Type: application/x-shellscript
Size: 992 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20240121/f15845b7/attachment.sh>


More information about the Cin mailing list