[FFmpeg-user] pan filter confusion

Tobias Rapp t.rapp at noa-archive.com
Mon Nov 27 14:38:39 EET 2017


On 27.11.2017 12:00, Carles Vila wrote:
>>
>> [0:1] is the input stream mapping to the complex filter chain. With
>> this syntax, it references the second stream from the first file. For
>> your particular file, it's indeed the audio stream. You could use
>> "[0:a]", just in case the order of video and audio streams are swapped
>> (or undetermined, as in VOBs).
>>
>>> Carles$ ffmpeg -i MEAT01_01A_ENG_ME_DV_5.1_24HD_TC.mov -filter_complex
>>> "[0:1]pan=2c|c0=c0+c1|c1=c2+c3" -s 640x360 -pix_fmt yuv420p
>> proxy_stereo.mp4
>>
>> While this result looks okay:
>>
>>> Stream mapping:
>>>    Stream #0:1 (pcm_s24le) -> pan (graph 0)
>>>    pan (graph 0) -> Stream #0:0 (aac)
>>>    Stream #0:0 -> #0:1 (prores (native) -> h264 (libx264))
>>
>> please do try changing that command line to the more specific mapping
>> variant:
>>
>> $ ffmpeg -i MEAT01_01A_ENG_ME_DV_5.1_24HD_TC.mov -filter_complex
>> "[0:a]pan=2c|c0=c0+c1|c1=c2+c3[a]" -s 640x360 -pix_fmt yuv420p -map 0:v
>> -map "[a]" proxy_stereo.mp4
>>
>> Additionally, if you increase the logging level with "loglevel verbose",
>> the pan
>> filter should show you what it's doing.
>>
>> If that command still doesn't work, can you change the filter
>> expression to
>>    "[0:a]pan=2c|c0=c0+c1|c1=c2+c3[a],volumedetect"
>> so that we can get an impression whether something should be heard?
>>
>>> ffmpeg version 3.1.4 Copyright (c) 2000-2016 the FFmpeg developers
>>
>> This is a bit old. Could you kindly test a recent build from git
>> master, or a recent release? We don't want to help you debug
>> long-solved bugs, if you know what I mean. (If you can't build
>> yourself, binaries are available for many major platforms.)
>>
> 
> 
> Hi Moritz Thanks for your help! but still no luck.
> 
> I found a 3.3.1 binary which I hope is enough up to date. I'm stuck on OSX
> 10.8 on this machine.... I used your syntax and I included the verbose
> option. Here is the output. The volumedetect filter was giving me problems
> regarding unsupported channel layout, I left it out at this time. Reading
> the pan coefficients everything seems ok, but still silent... Maybe the s32
> bit audio format?
> 
> 
> ffmpeg331 -i MEAT01_02A_ENG_ME_DV_5.1_24HD_TC.mov -filter_complex
> "[0:a]pan=2c|c0=c0+c1|c1=c2+c3[a]" -s 640x360 -pix_fmt yuv420p -map 0:v
> -map "[a]" -loglevel verbose proxy_stereo_2A.mp4
> ffmpeg version 3.3.1 Copyright (c) 2000-2017 the FFmpeg developers
>    built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
>    configuration: --prefix=/Volumes/Ramdisk/sw --enable-gpl
> --enable-pthreads --enable-version3 --enable-libspeex --enable-libvpx
> --disable-decoder=libvpx --enable-libmp3lame --enable-libtheora
> --enable-libvorbis --enable-libx264 --enable-avfilter
> --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters
> --enable-libgsm --enable-libvidstab --enable-libx265 --disable-doc
> --arch=x86_64 --enable-runtime-cpudetect
>    libavutil      55. 58.100 / 55. 58.100
>    libavcodec     57. 89.100 / 57. 89.100
>    libavformat    57. 71.100 / 57. 71.100
>    libavdevice    57.  6.100 / 57.  6.100
>    libavfilter     6. 82.100 /  6. 82.100
>    libswscale      4.  6.100 /  4.  6.100
>    libswresample   2.  7.100 /  2.  7.100
>    libpostproc    54.  5.100 / 54.  5.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from
> 'MEAT01_02A_ENG_ME_DV_5.1_24HD_TC.mov':
>    Metadata:
>      major_brand     : qt
>      minor_version   : 537199360
>      compatible_brands: qt
>      creation_time   : 2017-11-09T12:16:50.000000Z
>    Duration: 00:11:13.59, start: 0.000000, bitrate: 179162 kb/s
>      Stream #0:0(eng): Video: prores, 1 reference frame (apch / 0x68637061),
> yuv422p10le(bt709, progressive), 1920x1080, 165325 kb/s, SAR 1:1 DAR 16:9,
> 23.98 fps, 23.98 tbr, 24k tbn, 24k tbc (default)
>      Metadata:
>        creation_time   : 2017-11-09T12:16:50.000000Z
>        handler_name    : Apple Alias Data Handler
>        encoder         : Apple ProRes 422 (HQ)
>        timecode        : 00:00:00:00
>      Stream #0:1(eng): Audio: pcm_s24le (lpcm / 0x6D63706C), 48000 Hz, 12
> channels, s32 (24 bit), 13824 kb/s (default)
>      Metadata:
>        creation_time   : 2017-11-09T12:16:50.000000Z
>        handler_name    : Apple Alias Data Handler
>        timecode        : 00:00:00:00
>      Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
>      Metadata:
>        creation_time   : 2017-11-09T12:16:50.000000Z
>        handler_name    : Apple Alias Data Handler
>        timecode        : 00:00:00:00
> File 'proxy_stereo_2A.mp4' already exists. Overwrite ? [y/N] y
> Stream mapping:
>    Stream #0:1 (pcm_s24le) -> pan (graph 0)
>    Stream #0:0 -> #0:0 (prores (native) -> h264 (libx264))
>    pan (graph 0) -> Stream #0:1 (aac)
> Press [q] to stop, [?] for help
> [graph 1 input from stream 0:0 @ 0x7fe0e1000940] w:1920 h:1080
> pixfmt:yuv422p10le tb:1/24000 fr:24000/1001 sar:1/1 sws_param:flags=2
> [scaler_out_0_0 @ 0x7fe0e1000e60] w:640 h:360 flags:'bicubic' interl:0
> [scaler_out_0_0 @ 0x7fe0e1000e60] w:1920 h:1080 fmt:yuv422p10le sar:1/1 ->
> w:640 h:360 fmt:yuv420p sar:1/1 flags:0x4
> [libx264 @ 0x7fe0e0808600] using SAR=1/1
> [libx264 @ 0x7fe0e0808600] using cpu capabilities: MMX2 SSE2Fast SSSE3
> SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
> [libx264 @ 0x7fe0e0808600] profile High, level 3.0
> [libx264 @ 0x7fe0e0808600] 264 - core 148 - H.264/MPEG-4 AVC codec -
> Copyleft 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1
> ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00
> mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11
> fast_pskip=1 chroma_qp_offset=-2 threads=11 lookahead_threads=1
> sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
> constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1
> weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40
> intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0
> qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> [graph_0_in_0_1 @ 0x7fe0e120e360] tb:1/48000 samplefmt:s32 samplerate:48000
> chlayout:(null)
> [format_out_0_1 @ 0x7fe0e120e8a0] auto-inserting filter 'auto_resampler_0'
> between the filter 'Parsed_pan_0' and the filter 'format_out_0_1'
> [Parsed_pan_0 @ 0x7fe0e120e180] o0 = 1 i0 + 1 i1 + 0 i2 + 0 i3 + 0 i4 + 0
> i5 + 0 i6 + 0 i7 + 0 i8 + 0 i9 + 0 i10 + 0 i11
> [Parsed_pan_0 @ 0x7fe0e120e180] o1 = 0 i0 + 0 i1 + 1 i2 + 1 i3 + 0 i4 + 0
> i5 + 0 i6 + 0 i7 + 0 i8 + 0 i9 + 0 i10 + 0 i11
> [auto_resampler_0 @ 0x7fe0e120f1a0] ch:2 chl:stereo fmt:s32 r:48000Hz ->
> ch:2 chl:stereo fmt:fltp r:48000Hz
> [...]

Seems similar but not exactly the same as a pan filter bug I recently 
stumbled over: http://trac.ffmpeg.org/ticket/6790

In my case the input channel layout is known but output channel layout 
is empty. In your case the output channel layout is known (stereo) but 
the input channel layout is empty (null).

Have not found the time yet to debug this further.

Regards,
Tobias



More information about the ffmpeg-user mailing list