[MEncoder-users] fixing a/v sync --continued

Miroslav Rovis m.rovis at inet.hr
Sun Jul 15 01:19:24 CEST 2007


Indeed, this line:
( dd if=/dev/zero bs=1764 skip=20 ; \
cat audiodump.wav ) | cat > audiodump_different.wav
gives no reasonable file out for me...
I got it wrong...
I'd like to correct my previous mail here.
Negative delay means you need to _add_ to the audio to get it in sync,
(because in my case e.g. it plays _faster_ then the video...) But I
won't rewrite the previous mail...
Pls. take it into account that I corrected that bit here, gentle reader...

And I am now working with bs=1730, which so far looks right for my 48000
audio, 2 channels, bits/sample: 16... ...[something]little-endian
whatever... PCM... (I don't get it all yet... portable wave file)
So far every chunk that I split it into with command
cat the_file.wav | split -d -b[here insert 1/10 of the file, see below]
- the_file_wav
(which produces 10 equal chunks of the file)...
$ mkdir SPLIT
$ cd SPLIT/
$ ls -l ../my_audio-dump.wav
-rw-r--r-- 1 miroa users 1320288300 2007-07-14 20:47 my_audio-dump.wav
$ cat ../my_audio-dump.wav | split -d -b132028830 - my_audio-dump.wav
$ ls -1
-rw-r--r-- 1 miroa users 132028830 2007-07-14 20:47 my_audio-dump.wav00
-rw-r--r-- 1 miroa users 132028830 2007-07-14 20:47 my_audio-dump.wav01
...
-rw-r--r-- 1 miroa users 132028830 2007-07-14 20:47 my_audio-dump.wav09
...

So far every chunk that I split it into is playable with
mplayer the_chunk_of_the_file -demuxer rawaudio
Wasn't the case with all of the other numbers I experimented with...

I did employ dd.
 dd if=my_audio-dump.wav00 bs=1730 skip=0 count=10000 |  cat >
my_audio-dump.wav0000_TEST_bs1730_count10000
dd if=my_audio-dump.wav00 bs=1730 skip=10000 count=10000 |  cat >
my_audio-dump.wav0001_TEST_bs1730_count10000
etc.
This is the command by which I cut out about 0.2 sec that I need to add
at around 0:05:00 of the video to sync it properly in:
dd if=my_audio-dump.wav0003_TEST_bs1730_count1000001 bs=1730 count=20 |
 cat >  my_audio-dump.wav0003_TEST_bs1730_count1000001_dup

And then cat'd these two together to add 0.2 sec:
cat my_audio-dump.wav0003_TEST_bs1730_count1000001_dup
my_audio-dump.wav0003_TEST_bs1730_count1000001 >
my_audio-dump.wav0003_TEST_bs1730_count1000001_CORR

That much I did so far to sort that annoyingly out-of-sync video out...

I hope this helps to some novice at least... Sorry for the experts to
which this is certainly boring. I know I would've been happy had I found
this explanation somewhere when I badly needed it...

Will absolutely appreciate if anyone knows and has the will to explain
how to do this better!

Thanks for the patience, and it's late and I'm tired. Maybe I added new
mistakes in the lines above.
Miro



More information about the MEncoder-users mailing list