ffmpeg cannot recognize the '-af' option - ffmpeg

The ffmpeg cannot recognize the '-af' option. How can I fix this?
$ ffmpeg -i 01.wav -af pan=1:c0=c1 01mono.wav
ffmpeg version 0.10.12-7:0.10.12-1~precise1 Copyright (c) 2000-2014 the FFmpeg developers
built on Apr 26 2014 09:49:36 with gcc 4.6.3
configuration: --arch=amd64 --disable-stripping --enable-pthreads --enable-runtime-cpudetect --extra-version='7:0.10.12-1~precise1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
libavutil 51. 35.100 / 51. 35.100
libavcodec 53. 61.100 / 53. 61.100
libavformat 53. 32.100 / 53. 32.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 61.100 / 2. 61.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 52. 0.100 / 52. 0.100
[wav # 0x19dd680] max_analyze_duration 5000000 reached at 5015510
Input #0, wav, from '01.wav':
Duration: 00:40:20.40, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
Unrecognized option 'af'
Failed to set value 'pan=1:c0=c1' for option 'af'

Your ffmpeg is too old. See the FFmpeg Download page and get a static build, or refer to a compile guide. FFmpeg development is very active, so it is recommended to always use a recent build.

Related

How to convert wav audio file to aac in python?

I have a project about audio compression, I've been working with pydub I am using the function export() to write and save the file it works perfectly fine from aac to wav but doesn't the other way around it gives me this error : (From what I understood, ffmpeg doesn't support the aac format for this function )
Encoding failed. ffmpeg/avlib returned error code: 1
Command:['ffmpeg', '-y', '-f', 'wav', '-i', '/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmp7rv9zmjx', '-f', 'm4a', '/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmpco06cpgo']
Output from ffmpeg/avlib:
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with Apple clang version 12.0.0 (clang-1200.0.32.27)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1_4 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 51.100 / 56. 51.100
libavcodec 58. 91.100 / 58. 91.100
libavformat 58. 45.100 / 58. 45.100
libavdevice 58. 10.100 / 58. 10.100
libavfilter 7. 85.100 / 7. 85.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 7.100 / 5. 7.100
libswresample 3. 7.100 / 3. 7.100
libpostproc 55. 7.100 / 55. 7.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from '/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmp7rv9zmjx':
Duration: 00:00:01.82, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
[NULL # 0x7fbbb7008200] Requested output format 'm4a' is not a suitable output format
/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmpco06cpgo: Invalid argument
aac
Command:['ffmpeg', '-y', '-f', 'wav', '-i', '/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmp7rv9zmjx', '-f', 'adts', '/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmpco06cpgo']
m4a
Command:['ffmpeg', '-y', '-f', 'wav', '-i', '/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmp7rv9zmjx', '-f', 'ipod', '/var/folders/n1/x3tb_rg17pdgss5jb_zr7v380000gn/T/tmpco06cpgo']

Is there any way to combine PNGs as a Quicktime-compatible MP4 from FFMPEG?

Is there any way to get combine PNGs as a Quicktime-compatible MP4 from FFMPEG?
I'm using this command currently:
ffmpeg -i frame%03d.png -pix_fmt yuv420p output.mp4
This is the video works fine in VLC and can be uploaded to Youtube/Vimeo/Facebook fine but Quicktime complains that it "cannot be opened":
A few questions (e.g. https://apple.stackexchange.com/questions/166553/why-wont-video-from-ffmpeg-show-in-quicktime-imovie-or-quick-preview) about this at various sources, but none of the answers seem to work and they all seem to boil to down to some variant of "use yuv420p" or a couple of other flags. None of which seems to work. Apparently it may have changed in later (post-Yosemite) versions of MacOS?
So what (if anything) is the magic incantation that make this work with later versions of Quicktime?
Thanks all
ffprobe output below FYI:
ffprobe version 4.2.2 Copyright (c) 2007-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/xxx/Downloads/output (14).mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.20.100
Duration: 00:00:02.72, start: 0.000000, bitrate: 677 kb/s
Stream #0:0(und): Video: h264 (High 4:4:4 Predictive) (avc1 / 0x31637661), yuv444p, 1714x1630, 672 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler

I have a problem withInvalid file index 1 in filtergraph description

This is my code:
ffmpeg -i wireframe-spendo.mov palette.png -filter_complex fps=25,scale=800:600:flags=lanczos[x],[x][1:v]paletteuse wireframe-spendo.gif
but after then:
ffmpeg -i wireframe-spendo.mov palette.png -filter_complex fps=25,scale=800:600:flags=lanczos[x],[x][1:v]paletteuse wireframe-spendo.gif
ffmpeg version 4.1.3 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.3 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/openjdk-12.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/openjdk-12.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'wireframe-spendo.mov':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2019-04-17T09:38:24.000000Z
com.apple.quicktime.make: Apple
com.apple.quicktime.model: iMac12,2
com.apple.quicktime.software: Mac OS X 10.13.6 (17G6029)
com.apple.quicktime.creationdate: 2019-04-17T11:37:00+0200
Duration: 00:00:16.42, start: 0.000000, bitrate: 3170 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1476x1074 [SAR 1:1 DAR 246:179], 3163 kb/s, 60 fps, 60 tbr, 6k tbn, 12k tbc (default)
Metadata:
creation_time : 2019-04-17T09:38:24.000000Z
handler_name : Core Media Video
encoder : H.264
output terminal says:
Invalid file index 1 in filtergraph description fps=25,scale=800:600:flags=lanczos[x],[x][1:v]paletteuse.
You forgot a second -i before palette.png.
Each input requires its own -i option.

FFmpeg can't find AV_CODEC_ID_WMAV2

I want decode the wma type file use the FFmpeg,
compiled it with options
--enable-decoder=wmav1 --enable-decoder=wmav2, --enable-encoder=wmav1, --enable-encoder=wmav2 --enable-demuxer=xwma
and the source code i use it like this:
av_register_all();
//avcodec_register_all();
if ((ret = avformat_open_input(&fmt_ctx, src_filename, 0, 0)) < 0) {
LOG("Could not open source file %s, ret:%d", src_filename, ret);
return;
}
if ((ret = avformat_find_stream_info(fmt_ctx, 0)) < 0) {
LOG("Could not find stream information---ret:%d", ret);
return;
}
and avformat_find_stream_info fail with ret:-541478725
and add ffmpeg -i <inputfile> commandline log:
D:\Downloads\ffmpeg-static\bin>ffmpeg.exe -i ring.wma
ffmpeg version N-76684-g1fe82ab Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
libavutil 55. 6.100 / 55. 6.100
libavcodec 57. 15.100 / 57. 15.100
libavformat 57. 14.100 / 57. 14.100
libavdevice 57. 0.100 / 57. 0.100
libavfilter 6. 15.100 / 6. 15.100
libswscale 4. 0.100 / 4. 0.100
libswresample 2. 0.101 / 2. 0.101
libpostproc 54. 0.100 / 54. 0.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, asf, from 'ring.wma':
Metadata:
WMFSDKNeeded : 0.0.0.0000
DeviceConformanceTemplate: L3
WMFSDKVersion : 11.0.6001.7001
IsVBR : 0
PeakValue : 18081
AverageLevel : 1915
Duration: 00:00:07.80, start: 0.000000, bitrate: 206 kb/s
Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 2 channels, fltp,
192 kb/s
any tips?
And which option must be include when i want to decode a special type file?
thank you.
You need --enable-demuxer=asf. xwma is a fringe format which isn't really used very much, wma audio is typically packed in the asf container. These files will still have the '.wma' extension.

python call of ffmpeg misses target file parameter

I'm writing a python GUI for ffmpeg. When calling ffmpeg via subprocess it runs fine as long as the command is like
subprocess.Popen([ffmpeg_converter,
'-i',file,
target_file
])
But when I do the same call with ffmpeg arguments it fails with
"At least one output file must be specified":
option_string = '-q:a 4'
subprocess.Popen([ffmpeg_converter,
'-i',file,
option_string,
target_file
])
It even recognizes the options but does not see the target file. I even replaced the actual target file with someting simple like "test.mp3" but still the same error. Any ideas? (I'm on windows with python 3.3.)
The complete console output is:
ffmpeg version N-57781-g0610d6e Copyright (c) 2000-2013 the FFmpeg developers
built on Nov 1 2013 18:01:35 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 49.100 / 52. 49.100
libavcodec 55. 40.101 / 55. 40.101
libavformat 55. 20.105 / 55. 20.105
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Trailing options were found on the commandline.
Input #0, flac, from 'c:\script\python\testdata\source\01. Es geht los.flac':
Metadata:
ARTIST : Olivia Trummer Trio
TITLE : Es geht los
ALBUM : Westwind
DATE : 2008
track : 01
GENRE : Jazz
COMMENT : EAC FLAC -8
Duration: 00:06:27.25, bitrate: 834 kb/s
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
At least one output file must be specified
I think you need to pass -q:a 4 as separate values -q:a, 4.
Try this:
subprocess.Popen([ffmpeg_converter,
'-i',file,
'-q:a', '4'
target_file
])
You are passing your option string as one argument instead of two.

Resources