[FFmpeg-user] afreqshift
Michael Koch
astroelectronic at t-online.de
Wed Oct 21 21:14:50 EEST 2020
Hi,
I'm just testing the new afreqshift filter.
In my first test I did use only *.wav audio files. This test was successful.
In my next test I'm using MP4 files. First I make a test video with a
5kHz tone:
ffmpeg -f lavfi -i sine=f=5000:r=48000:d=5 -f lavfi -i color=black
-lavfi showspectrum=legend=1 -y test.mp4
Now I try to shift the frequency down by 4kHz:
ffmpeg -i test.mp4 -lavfi afreqshift=-4000,showspectrum=legend=1 -y out.mp4
The spectrum display is showing the expected 1kHz, but what I hear is 5kHz.
What's wrong with my command line? Why is the output of the afreqshift
filter not mapped to the output file?
Michael
C:\Users\astro\Desktop>c:\ffmpeg\ffmpeg -f lavfi -i
sine=f=5000:r=48000:d=5 -f lavfi -i color=black -lavfi
showspectrum=legend=1 -y test.mp4
ffmpeg version 2020-10-21-git-289e964873-full_build-www.gyan.dev
Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev3, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp
--enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
--enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi
--enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg
--enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype
--enable-libfribidi --enable-libvidstab --enable-libvmaf
--enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid
--enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va
--enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan
--enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine
--enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc
--enable-libilbc --enable-libgsm --enable-libopencore-amrnb
--enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa
--enable-libbs2b --enable-libflite --enable-libmysofa
--enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 60.100 / 56. 60.100
libavcodec 58.111.101 / 58.111.101
libavformat 58. 62.100 / 58. 62.100
libavdevice 58. 11.102 / 58. 11.102
libavfilter 7. 88.100 / 7. 88.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, lavfi, from 'sine=f=5000:r=48000:d=5':
Duration: N/A, start: 0.000000, bitrate: 768 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
Input #1, lavfi, from 'color=black':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #1:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 320x240
[SAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 (pcm_s16le) -> showspectrum (graph 0)
showspectrum (graph 0) -> Stream #0:0 (libx264)
Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 000001a6b13d0fc0] using SAR=1/1
[libx264 @ 000001a6b13d0fc0] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001a6b13d0fc0] profile High 4:4:4 Predictive, level 3.2,
4:4:4, 8-bit
[libx264 @ 000001a6b13d0fc0] 264 - core 161 r3018 db0d417 - H.264/MPEG-4
AVC codec - Copyleft 2003-2020 - 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=4 threads=12
lookahead_threads=2 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=25 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
Output #0, mp4, to 'test.mp4':
Metadata:
encoder : Lavf58.62.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p,
924x640 [SAR 1:1 DAR 231:160], q=-1--1, 46.88 fps, 12k tbn, 46.88 tbc
Metadata:
encoder : Lavc58.111.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono,
fltp, 69 kb/s
Metadata:
encoder : Lavc58.111.101 aac
[Parsed_sine_0 @ 000001a6b1372040] EOF timestamp not reliableitrate=
0.1kbits/s speed=6.67x
frame= 234 fps=0.0 q=-1.0 Lsize= 72kB time=00:00:05.01 bitrate=
117.6kbits/s speed=6.45x
video:36kB audio:29kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 10.633892%
[libx264 @ 000001a6b13d0fc0] frame I:1 Avg QP:18.87 size: 11825
[libx264 @ 000001a6b13d0fc0] frame P:60 Avg QP:14.80 size: 157
[libx264 @ 000001a6b13d0fc0] frame B:173 Avg QP:17.49 size: 85
[libx264 @ 000001a6b13d0fc0] consecutive B-frames: 0.9% 1.7% 0.0% 97.4%
[libx264 @ 000001a6b13d0fc0] mb I I16..4: 28.0% 62.2% 9.8%
[libx264 @ 000001a6b13d0fc0] mb P I16..4: 0.1% 0.1% 0.0% P16..4:
0.3% 0.1% 0.0% 0.0% 0.0% skip:99.3%
[libx264 @ 000001a6b13d0fc0] mb B I16..4: 0.0% 0.0% 0.0% B16..8:
0.6% 0.0% 0.0% direct: 0.0% skip:99.3% L0:50.9% L1:48.1% BI: 1.0%
[libx264 @ 000001a6b13d0fc0] 8x8 transform intra:63.0% inter:3.0%
[libx264 @ 000001a6b13d0fc0] coded y,u,v intra: 5.3% 0.0% 0.0% inter:
0.0% 0.0% 0.0%
[libx264 @ 000001a6b13d0fc0] i16 v,h,dc,p: 77% 23% 1% 0%
[libx264 @ 000001a6b13d0fc0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 65% 6% 29%
0% 0% 0% 0% 0% 0%
[libx264 @ 000001a6b13d0fc0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 37% 29% 25%
1% 1% 2% 3% 1% 2%
[libx264 @ 000001a6b13d0fc0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000001a6b13d0fc0] ref P L0: 73.5% 8.1% 12.0% 6.5%
[libx264 @ 000001a6b13d0fc0] ref B L0: 69.6% 29.3% 1.1%
[libx264 @ 000001a6b13d0fc0] ref B L1: 95.1% 4.9%
[libx264 @ 000001a6b13d0fc0] kb/s:57.68
[aac @ 000001a6b13d4840] Qavg: 62732.414
C:\Users\astro\Desktop>c:\ffmpeg\ffmpeg -i test.mp4 -lavfi
afreqshift=-4000,showspectrum=legend=1 -y out.mp4
ffmpeg version 2020-10-21-git-289e964873-full_build-www.gyan.dev
Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 10.2.0 (Rev3, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static
--disable-w32threads --disable-autodetect --enable-fontconfig
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp
--enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
--enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi
--enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg
--enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype
--enable-libfribidi --enable-libvidstab --enable-libvmaf
--enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid
--enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va
--enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan
--enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine
--enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc
--enable-libilbc --enable-libgsm --enable-libopencore-amrnb
--enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa
--enable-libbs2b --enable-libflite --enable-libmysofa
--enable-librubberband --enable-libsoxr --enable-chromaprint
libavutil 56. 60.100 / 56. 60.100
libavcodec 58.111.101 / 58.111.101
libavformat 58. 62.100 / 58. 62.100
libavdevice 58. 11.102 / 58. 11.102
libavfilter 7. 88.100 / 7. 88.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.62.100
Duration: 00:00:05.02, start: 0.000000, bitrate: 117 kb/s
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 /
0x31637661), yuv444p, 924x640 [SAR 1:1 DAR 231:160], 58 kb/s, 46.88 fps,
46.88 tbr, 12k tbn, 93.75 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
mono, fltp, 47 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream mapping:
Stream #0:1 (aac) -> afreqshift (graph 0)
showspectrum (graph 0) -> Stream #0:0 (libx264)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 000001cf9fc32ec0] using SAR=1/1
[libx264 @ 000001cf9fc32ec0] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 000001cf9fc32ec0] profile High 4:4:4 Predictive, level 3.2,
4:4:4, 8-bit
[libx264 @ 000001cf9fc32ec0] 264 - core 161 r3018 db0d417 - H.264/MPEG-4
AVC codec - Copyleft 2003-2020 - 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=4 threads=12
lookahead_threads=2 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=25 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
Output #0, mp4, to 'out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.62.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv444p,
924x640 [SAR 1:1 DAR 231:160], q=-1--1, 46.88 fps, 12k tbn, 46.88 tbc
(default)
Metadata:
encoder : Lavc58.111.101 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
mono, fltp, 69 kb/s (default)
Metadata:
handler_name : SoundHandler
encoder : Lavc58.111.101 aac
frame= 236 fps=0.0 q=-1.0 Lsize= 72kB time=00:00:05.01 bitrate=
117.8kbits/s dup=1 drop=0 speed= 6.7x
video:38kB audio:27kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 10.648475%
[libx264 @ 000001cf9fc32ec0] frame I:1 Avg QP:17.09 size: 11790
[libx264 @ 000001cf9fc32ec0] frame P:59 Avg QP:13.85 size: 157
[libx264 @ 000001cf9fc32ec0] frame B:176 Avg QP:17.41 size: 98
[libx264 @ 000001cf9fc32ec0] consecutive B-frames: 0.4% 0.0% 1.3% 98.3%
[libx264 @ 000001cf9fc32ec0] mb I I16..4: 48.2% 41.7% 10.0%
[libx264 @ 000001cf9fc32ec0] mb P I16..4: 0.0% 0.1% 0.0% P16..4:
0.4% 0.1% 0.0% 0.0% 0.0% skip:99.4%
[libx264 @ 000001cf9fc32ec0] mb B I16..4: 0.0% 0.0% 0.0% B16..8:
1.5% 0.0% 0.0% direct: 0.0% skip:98.4% L0:62.6% L1:36.9% BI: 0.4%
[libx264 @ 000001cf9fc32ec0] 8x8 transform intra:44.4% inter:4.5%
[libx264 @ 000001cf9fc32ec0] coded y,u,v intra: 5.6% 0.0% 0.0% inter:
0.0% 0.0% 0.0%
[libx264 @ 000001cf9fc32ec0] i16 v,h,dc,p: 90% 10% 1% 0%
[libx264 @ 000001cf9fc32ec0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 58% 5% 36%
1% 0% 0% 0% 0% 0%
[libx264 @ 000001cf9fc32ec0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 31% 25%
1% 1% 2% 3% 1% 2%
[libx264 @ 000001cf9fc32ec0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 000001cf9fc32ec0] ref P L0: 74.2% 7.4% 11.9% 6.6%
[libx264 @ 000001cf9fc32ec0] ref B L0: 56.7% 42.8% 0.5%
[libx264 @ 000001cf9fc32ec0] ref B L1: 96.7% 3.3%
[libx264 @ 000001cf9fc32ec0] kb/s:60.88
[aac @ 000001cf9fcd90c0] Qavg: 63059.797
More information about the ffmpeg-user
mailing list