I try use the command:
/usr/bin/ffmpeg -i uploads/14940964561.mp4 -vf "drawbox=x=0:y=0:w=1000:h=1000:color=white#0.2:t=max" uploads/output.mp4
Output error
ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/i386-l
inux-gnu --shlibdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth
--enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-lib
freetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-li
brtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-li
bwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --
enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv
libavutil 54. 7.100 / 54. 7.100
libavcodec 56. 1.100 / 56. 1.100
libavformat 56. 4.101 / 56. 4.101
libavdevice 56. 0.100 / 56. 0.100
libavfilter 5. 1.100 / 5. 1.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 0.100 / 3. 0.100
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 0.100 / 53. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '14942588091.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.4.101
Duration: 00:00:08.00, start: 0.000000, bitrate: 350 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 347 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
[Parsed_drawbox_0 # 0x856b8e0] [Eval # 0xbf9ae638] Undefined constant or missing '(' in 'max'
Last message repeated 5 times
[Parsed_drawbox_0 # 0x856b8e0] Error when evaluating the expression 'max'
[Parsed_drawbox_0 # 0x856b8e0] Failed to configure input pad on Parsed_drawbox_0
Error opening filters!
This is message the error correct.
Previously, a message and code is wrong. I'm sorry!
Message error:
I use the Ubuntu 32 bits, but the command in Windows 10 work.
Your ffmpeg is too old.
Easiest method to upgrade is to download a recent, already compiled version. See the FFmpeg Download page for links for Linux, macOS, and Windows.
Related
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 two different machines with two different versions of ffmpeg installed. I'm trying to set the display matrix of a video to have a rotation value by using the -metadata:s:v:0 rotate=$theta filter.
On machine #1
FFMPEG version:
$ ffmpeg -version
ffmpeg version 4.2.1 Copyright (c) 2000-2019 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.8)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.1_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-13.jdk/Contents/Home/include/darwin -fno-stack-check' --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-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
Command:
$ ffmpeg -i 0_degree_rotation.mp4 -vcodec copy -metadata:s:v:0 rotate=90 /tmp/out.mp4
Metadata on output video:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : "Camio"
encoder : Lavf58.29.100
Duration: 00:00:10.71, start: 0.000000, bitrate: 2241 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2239 kb/s, 14.94 fps, 14.94 tbr, 14941 tbn, 29.88 tbc (default)
Metadata:
rotate : 270
handler_name : VideoHandler
Side data:
displaymatrix: rotation of 90.00 degrees
On Machine #2
FFMPEG Version:
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Command:
$ ffmpeg -i /tmp/0_degree_rotation.mp4 -vcodec copy -metadata:s:v:0 rotate=90 /tmp/out.mp4
Metadata on output video
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/out.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : "Camio"
encoder : Lavf56.40.101
Duration: 00:00:10.71, start: 0.000000, bitrate: 2241 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 2239 kb/s, 14.94 fps, 14.94 tbr, 14941 tbn, 29.88 tbc (default)
Metadata:
rotate : 90
handler_name : VideoHandler
Side data:
displaymatrix: rotation of -90.00 degrees
Why does the same command produce a rotation of +90 degrees in one version of ffmpeg and -90 degrees on a different version?
The rotate API was changed in version 3.3. The new API internally uses a different data structure to represent and store the rotation (and flipping) values, and its orientation is opposite to the old API. In general, 2.8 is a very old version, and you should upgrade all machines to 4.2.
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.
I am trying to cut a small section of a video using the following sentence:
ffmpeg.exe -i video.wmv -ss 00:20:02 -to 00:20:09 -crf 22 "C:\test.mp4" -y
However, ffmpeg hangs showing messages like:
[asf # 03327b00] too long payload 0kB time=00:00:00.00 bitrate=N/A speed= 0x
Last message repeated 352 times
[asf # 03327b00] too long payload 0kB time=00:00:00.00 bitrate=N/A speed= 0x
Last message repeated 331 times
I have waited for more than 30 minutes and ffmpeg did not finish the cutting. Does anyone have any idea how to solve this?
Any suggestion will be appreciated
PD. the ffprobe output of the source file is the following:
ffprobe version N-81831-g97e7f03 Copyright (c) 2007-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 32.100 / 55. 32.100
libavcodec 57. 60.101 / 57. 60.101
libavformat 57. 51.102 / 57. 51.102
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 63.100 / 6. 63.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 2.100 / 2. 2.100
libpostproc 54. 0.100 / 54. 0.100
[asf # 03b7afe0] too long payload
Last message repeated 159 times
Input #0, asf, from 'F:\video.wmv':
Metadata:
WMFSDKVersion : 11.0.5721.5145
WMFSDKNeeded : 0.0.0.0000
IsVBR : 0
DeviceConformanceTemplate: M
Duration: 01:41:25.95, start: 0.000000, bitrate: 1649 kb/s
Stream #0:0(eng): Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 640x480, 1500 kb/s, 29.97 fps, 29.97 tbr, 1k tbn, 1k tbc
Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 2 channels, fltp, 128 kb/s
I have written cygwin based shell script to concate 2 .mkv files as below,
#!/bin/sh
ffmpeg -f concat -i concat.txt -codec copy out.mkv
concat.txt contains path to 2 mkv files to be concatenated
file '../temp/1'
file '../temp/2'
when I run script from cygwin terminal I get following error
Rishi#Rishikesh /cygdrive/i/video/Interface_code/Testing_function/bin
$ . script.sh
ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 30 2014 17:13:24 with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable- avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp -- enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 13.100 / 56. 13.100
libavformat 56. 15.102 / 56. 15.102
libavdevice 56. 3.100 / 56. 3.100
libavfilter 5. 2.103 / 5. 2.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, concat, from 'concat.txt':
Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 720x576 [SAR 1:1 DAR 5:4], 25 fps, 25 tbr, 1k tbn, 50 tbc
Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
'NULL # 04780280] Unable to find a suitable output format for 'out.mkv
: Invalid argument
another thing to add, if I run this command from cygwin terminal directly(instead of calling it through script) it runs correctly and creates concatenated output .mkv file
Applying dos2unix command on shell script file solved my problem. Hope it helps someone.