[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Swftools-common] How can I mix a series of audio files into a SWF/F
From: |
Matthias Kramm |
Subject: |
Re: [Swftools-common] How can I mix a series of audio files into a SWF/FLV file? |
Date: |
Tue, 9 Sep 2008 17:56:49 +0200 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Mon, Sep 08, 2008 at 03:56:00PM -0500, David Trusty <address@hidden> wrote:
> I have a FLV file which contains video only. I want to insert a series of
> audio files
> into it and create a combined audio and video file. I need to do it using a
> script.
>
> Suppose I know that the FLV file was started at time T1 and the audio files
> were started at times T1+x and T1+y, etc. How can I mix the audio in at
> certain times of video?
Hm. Tricky.
Try to convert the audio files to raw first:
sox -r 44100 -c 1 -b file1.wav file1.raw
sox -r 44100 -c 1 -b file2.wav file2.raw
...
Then, you can patch in the starting points using something like this:
dd if=/dev/zero of=silence01.raw bs=D1 count=1
dd if=/dev/zero of=silence12.raw bs=D2 count=1
...
with D1 the time between start of video and start of sound 1 (multiplied
by 44100), and D2 the time between sound 1 and sound 2 (etc.).
Concatenate everything:
cat silence01.raw file1.raw silence12.raw file2.raw ... > sound.raw
Convert back to WAV, and then to SWF:
sox sound.raw -c 1 -b -r 44100 sound.wav
wav2swf -r <fps> sound.wav -o sound.swf
with <fps> the frames per second of your video file.
Then, you can combine video+audio:
swfcombine -Tm video.swf sound.swf
Greetings
Matthias