ffmpeg map_channel silencia o segundo arquivo mono

0

Estou com problemas com as opções -map_channel . Eu estou usando dois scripts separados (sim, eu sei que eu poderia fazer isso em um script).

ffmpeg -threads "16" -i example.mov -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.1.0 left.wav -map_channel 0.1.1 right.wav

Esse script começa a transcodificar meu audiostream com dois canais e ambos os arquivos de log parecem que tudo funcionou perfeitamente, mas eu só tenho som no canal 0.1.0, enquanto o canal 0.1.1 é silenciado.

Antes que alguém peça por transcoding log, aqui está o meu primeiro script:

ffmpeg version 0.10.2.git Copyright (c) 2000-2012 the FFmpeg developers
built on Jan 16 2013 15:47:31 with gcc 4.1.2 20080704 (Red Hat 4.1.2-51)
configuration: --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --disable-ffplay --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --extra-cflags=-fPIC --enable-libfreetype
libavutil      51. 55.100 / 51. 55.100
libavcodec     54. 23.100 / 54. 23.100
libavformat    54.  6.101 / 54.  6.101
libavdevice    54.  0.100 / 54.  0.100
libavfilter     2. 77.100 /  2. 77.100
libswscale      2.  1.100 /  2.  1.100
libswresample   0. 15.100 /  0. 15.100
libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/content/flowcenter/qt/preti_hd_eng_15.mp4':
Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: mp42mp41
creation_time   : 2013-09-02 15:48:40
LOGGER: set frames to 22825
Duration: 00:15:13.56, start: 0.000000, bitrate: 4588 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 4328 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
Metadata:
  creation_time   : 2013-09-02 15:48:40
  handler_name    : Apple Video Media Handler
  Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 255 kb/s
Metadata:
  creation_time   : 2013-09-02 15:48:40
  handler_name    : Apple Sound Media Handler
-map_channel is forwarded to lavfi similarly to -af pan=0x4:c0=c0.
[aformat @ 0x3d3c1c0] auto-inserting filter 'auto-inserted resampler 0' between the filter     'Parsed_anull_0' and the filter 'aformat'
[aresample @ 0x3e0e0a0] chl:stereo fmt:s16 r:48000Hz -> chl:mono fmt:s32 r:48000Hz
[pan @ 0x3d3c7c0] o0 = 1 i0
[pan @ 0x3d3c7c0] Pure channel mapping detected: 0
Output #0, wav, to '/content/flowcenter/other/preti_hd_eng_15_0_1_0.wav':
Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: mp42mp41
creation_time   : 2013-09-02 15:48:40
encoder         : Lavf54.6.101
Stream #0:0(eng): Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
Metadata:
  creation_time   : 2013-09-02 15:48:40
  handler_name    : Apple Sound Media Handler
Stream mapping:
Stream #0:1 -> #0:0 (aac -> pcm_s24le)
Executing:
"/home/mfc/ffmpeg/0_1_0.wav.sh" 1316720 "/content/flowcenter/qt/preti_hd_eng_15.mp4" "/content/flowcenter/other/preti_hd_eng_15_0_1_0.wav"
ffmpeg -threads 16 -i /content/flowcenter/qt/preti_hd_eng_15.mp4 -acodec pcm_s24le -ar 48000 -ac  1 -map_channel 0.1.0 /content/flowcenter/other/preti_hd_eng_15_0_1_0.wav
 needed 2 seconds
Moved outputfile to new location
198
File MIME Content-Type:audio/x-wav
get video file informations for /content/flowcenter/other/preti_hd_eng_15_0_1_0.wav
index file for cut is enabled.
execute: /home/mfc/bin/mpeginfo --logfile /dev/null --idx-file "/content/flowcenter/mpeg2idx/988409"  "/content/flowcenter/other/preti_hd_eng_15_0_1_0.wav"
* * * Arthur Kleer, v0.9.F.4, r09.10.2011, compiled on Oct  6 2011 (nike) * * *

E este é para o meu segundo roteiro:

-map_channel is forwarded to lavfi similarly to -af pan=0x4:c0=c1.
[aformat @ 0x2fb31c0] auto-inserting filter 'auto-inserted resampler 0' between the filter  'Parsed_anull_0' and the filter 'aformat'
[aresample @ 0x30850a0] chl:stereo fmt:s16 r:48000Hz -> chl:mono fmt:s32 r:48000Hz
[pan @ 0x2fb37c0] o0 = 0 i0
[pan @ 0x2fb37c0] Pure channel mapping detected: M
Output #0, wav, to '/content/flowcenter/other/preti_hd_eng_15_0_1_1.wav':
Metadata:
major_brand     : mp42
minor_version   : 1
compatible_brands: mp42mp41
creation_time   : 2013-09-02 15:48:40
encoder         : Lavf54.6.101
Stream #0:0(eng): Audio: pcm_s24le ([1][0][0][0] / 0x0001), 48000 Hz, mono, s32, 1152 kb/s
Metadata:
  creation_time   : 2013-09-02 15:48:40
  handler_name    : Apple Sound Media Handler
Stream mapping:
Stream #0:1 -> #0:0 (aac -> pcm_s24le)
Executing:
"/home/mfc/ffmpeg/0_1_1.wav.sh" 1316719 "/content/flowcenter/qt/preti_hd_eng_15.mp4" "/content/flowcenter/other/preti_hd_eng_15_0_1_1.wav"
ffmpeg -threads 16 -i /content/flowcenter/qt/preti_hd_eng_15.mp4 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.1.1 /content/flowcenter/other/preti_hd_eng_15_0_1_1.wav
needed 33 seconds
Moved outputfile to new location
198
File MIME Content-Type:audio/x-wav
get video file informations for /content/flowcenter/other/preti_hd_eng_15_0_1_1.wav
index file for cut is enabled.
execute: /home/mfc/bin/mpeginfo --logfile /dev/null --idx-file "/content/flowcenter/mpeg2idx/988408"  "/content/flowcenter/other/preti_hd_eng_15_0_1_1.wav"
* * * Arthur Kleer, v0.9.F.4, r09.10.2011, compiled on Oct  6 2011 (nike) * * *

Alguém sabe por que isso acontece ou tem alguém uma maneira alternativa de obter um estéreo em dois arquivos mono? Também tentei a opção pan , mas não consegui encontrar uma maneira de descobrir a opção pan (a documentação do ffmpeg não ajuda muito nesse caso)

EDIT: Tentar a mesma coisa com a opção pan funciona bem, mas somente se o arquivo de entrada tiver um audiostream com dois audiochannels, com apenas um audiochannel ffmpeg também cria dois audiochannels, embora deva haver apenas um para criar. Eu sei que poderia fazer isso manualmente para cada clipe, mas gostaria de ter uma solução universal.

roteiro panorâmico: ffmpeg -threads "16" -i example.mov -acodec pcm_s24le -ar 48000 -af pan=1:c0=c0 left.wav -af pan=1:c0=c1 right.wav

    
por sebastian 19.03.2014 / 12:33

0 respostas