[FFmpeg-user] pan filter confusion

Carles Vila cvilad at gmail.com
Mon Nov 27 13:00:07 EET 2017


>
> [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
Output #0, mp4, to 'proxy_stereo_2A.mp4':
  Metadata:
    major_brand     : qt
    minor_version   : 537199360
    compatible_brands: qt
    encoder         : Lavf57.71.100
    Stream #0:0(eng): Video: h264 (libx264), 1 reference frame
([33][0][0][0] / 0x0021), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9],
q=-1--1, 23.98 fps, 24k tbn, 23.98 tbc (default)
    Metadata:
      creation_time   : 2017-11-09T12:16:50.000000Z
      handler_name    : Apple Alias Data Handler
      timecode        : 00:00:00:00
      encoder         : Lavc57.89.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([64][0][0][0] / 0x0040), 48000 Hz,
stereo, fltp (24 bit), delay 1024, 128 kb/s (default)
    Metadata:
      encoder         : Lavc57.89.100 aac
frame= 1843 fps= 72 q=-1.0 Lsize=    5797kB time=00:01:16.74 bitrate=
618.8kbits/s speed=2.98x
video:5723kB audio:21kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.916932%
Input file #0 (MEAT01_02A_ENG_ME_DV_5.1_24HD_TC.mov):
  Input stream #0:0 (video): 1843 packets read (1588246000 bytes); 1843
frames decoded;
  Input stream #0:1 (audio): 3572 packets read (131459328 bytes); 3572
frames decoded (3651648 samples);
  Input stream #0:2 (data): 0 packets read (0 bytes);
  Total: 5415 packets (1719705328 bytes) demuxed
Output file #0 (proxy_stereo_2A.mp4):
  Output stream #0:0 (video): 1843 frames encoded; 1843 packets muxed
(5860473 bytes);
  Output stream #0:1 (audio): 3566 frames encoded (3651584 samples); 3567
packets muxed (21640 bytes);
  Total: 5410 packets (5882113 bytes) muxed
[libx264 @ 0x7fe0e0808600] frame I:22    Avg QP:19.02  size: 30292
[libx264 @ 0x7fe0e0808600] frame P:551   Avg QP:23.98  size:  5638
[libx264 @ 0x7fe0e0808600] frame B:1270  Avg QP:29.98  size:  1643
[libx264 @ 0x7fe0e0808600] consecutive B-frames:  5.3%  5.0% 10.3% 79.4%
[libx264 @ 0x7fe0e0808600] mb I  I16..4: 10.9% 40.8% 48.4%
[libx264 @ 0x7fe0e0808600] mb P  I16..4:  3.1% 11.1%  6.8%  P16..4: 12.9%
6.8%  4.9%  0.0%  0.0%    skip:54.5%
[libx264 @ 0x7fe0e0808600] mb B  I16..4:  0.4%  1.5%  1.4%  B16..8: 13.4%
4.3%  1.6%  direct: 1.1%  skip:76.4%  L0:47.7% L1:46.4% BI: 5.9%
[libx264 @ 0x7fe0e0808600] 8x8 transform intra:49.9% inter:56.6%
[libx264 @ 0x7fe0e0808600] coded y,uvDC,uvAC intra: 60.6% 69.4% 53.2%
inter: 5.6% 5.8% 2.6%
[libx264 @ 0x7fe0e0808600] i16 v,h,dc,p: 23% 53%  7% 17%
[libx264 @ 0x7fe0e0808600] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 22% 21%  5%
5%  5%  7%  5%  8%
[libx264 @ 0x7fe0e0808600] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 23% 15%  6%
7%  6%  7%  5%  6%
[libx264 @ 0x7fe0e0808600] i8c dc,h,v,p: 49% 27% 18%  7%
[libx264 @ 0x7fe0e0808600] Weighted P-Frames: Y:2.2% UV:1.8%
[libx264 @ 0x7fe0e0808600] ref P L0: 63.0% 11.0% 16.4%  9.6%  0.1%
[libx264 @ 0x7fe0e0808600] ref B L0: 84.7% 12.2%  3.1%
[libx264 @ 0x7fe0e0808600] ref B L1: 95.0%  5.0%
[libx264 @ 0x7fe0e0808600] kb/s:609.85
[aac @ 0x7fe0e0809e00] Qavg: 65536.000


More information about the ffmpeg-user mailing list