[FFmpeg-devel] [PATCH 3/5] audioconvert: implement av_bprint_channel_layout().
Nicolas George
nicolas.george at normalesup.org
Wed Jun 6 16:23:56 CEST 2012
L'octidi 18 prairial, an CCXX, Clément Bœsch a écrit :
> OK I did some random tests but it didn't work as smooth as I expected...
>
> First I tried to generate a random sample with:
>
> ./ffmpeg -f lavfi -i "aevalsrc=sin(330*PI*2*t)[a];
> aevalsrc=sin(440*PI*2*t)[b];
> [a][b]amerge" -t 5 out.wav
>
> But it crashed. Actually, it also crashes on master/HEAD.
Fixed by:
http://ffmpeg.org/pipermail/ffmpeg-devel/2012-June/125541.html
> So I created two samples with sth like:
>
> ./ffmpeg -f lavfi -i aevalsrc='sin(330*PI*2*t)' -t 5 ch0.wav
> -f lavfi -i aevalsrc='sin(440*PI*2*t)' -t 5 ch1.wav
>
> And then this:
>
> ./ffmpeg -i ch0.wav -i ch1.wav -filter_complex
> '[0:0][1:0]amerge[out0];
> [0:0][1:0]amerge[out1]' -map '[out0]'
> -map '[out1]' -y out.ogg
>
> This actually crashes after your patchset (master/HEAD + the 5 patches of
> this thread), but works with master/HEAD.
It works for me right now. Complete console output down below.
> With the previous out.ogg (generated from master/HEAD), in your amerge
> branch I tried this:
>
> ./ffmpeg -i out.ogg -filter_complex
> '[0:0][0:1][1:0][1:1]amerge=inputs=4' -f null -
>
> But it crashed again...
I get:
Invalid file index 1 in filtergraph description [0:0][0:1][1:0][1:1]amerge=inputs=4.
And indeed, your command line has only one input: 1:0 does not make sense.
> The only use case I'm interested is: take a video, and merge all the
> streams into one. This is assuming all the streams are mono, OR stereo
> pairs.
I am a little surprised here. I thought you wanted to implement -map_channel
with that.
Regards,
--
Nicolas George
./ffmpeg -loglevel verbose -i /tmp/ch0.wav -i /tmp/ch1.wav -filter_complex '[0:0][1:0]amerge[out0]; [0:0][1:0]amerge[out1]' -map '[out0]' -map '[out1]' -y /tmp/out.ogg
ffmpeg version N-41358-gc57bb5b Copyright (c) 2000-2012 the FFmpeg developers
built on Jun 6 2012 16:18:18 with gcc 4.6.3
configuration: --enable-shared --disable-static --enable-gpl --enable-libx264 --enable-libspeex --enable-libass --assert-level=1
libavutil 51. 56.100 / 51. 56.100
libavcodec 54. 25.100 / 54. 25.100
libavformat 54. 6.101 / 54. 6.101
libavdevice 54. 0.100 / 54. 0.100
libavfilter 2. 78.100 / 2. 78.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
[wav @ 0xc9b100] parser not found for codec pcm_s16le, packets or times may be invalid.
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from '/tmp/ch0.wav':
Duration: 00:00:05.01, bitrate: 705 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
[wav @ 0xd030e0] parser not found for codec pcm_s16le, packets or times may be invalid.
Guessed Channel Layout for Input Stream #1.0 : mono
Input #1, wav, from '/tmp/ch1.wav':
Duration: 00:00:05.01, bitrate: 705 kb/s
Stream #1:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, mono, s16, 705 kb/s
[0:0 @ 0xd86c00] tb:1/44100 samplefmt:s16 samplerate: 44100 ch layout:0x4
[1:0 @ 0xd86f40] tb:1/44100 samplefmt:s16 samplerate: 44100 ch layout:0x4
[0:0 @ 0xd8e9c0] tb:1/44100 samplefmt:s16 samplerate: 44100 ch layout:0x4
[1:0 @ 0xd1ea60] tb:1/44100 samplefmt:s16 samplerate: 44100 ch layout:0x4
[Parsed_amerge_0 @ 0xd26880] Inputs overlap: output layout will be meaningless
[Parsed_amerge_1 @ 0xd0ad20] Inputs overlap: output layout will be meaningless
[Parsed_amerge_0 @ 0xd26880] in0:mono + in1:mono -> out:stereo
[Parsed_amerge_1 @ 0xd0ad20] in0:mono + in1:mono -> out:stereo
Output #0, ogg, to '/tmp/out.ogg':
Metadata:
encoder : Lavf54.6.101
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16, 128 kb/s
Stream #0:1: Audio: flac, 44100 Hz, stereo, s16, 128 kb/s
Stream mapping:
Stream #0:0 (pcm_s16le) -> amerge:
Stream #0:0 (pcm_s16le) -> amerge:
Stream #1:0 (pcm_s16le) -> amerge:
Stream #1:0 (pcm_s16le) -> amerge:
amerge -> Stream #0:0 (flac)
amerge -> Stream #0:1 (flac)
Press [q] to stop, [?] for help
size= 194kB time=00:00:05.01 bitrate= 316.5kbits/s
video:0kB audio:193kB global headers:0kB muxing overhead 0.595136%
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120606/5cf07a81/attachment.asc>
More information about the ffmpeg-devel
mailing list