ffmpeg: resulting video from timelapse not playable in quicktime after size change [duplicate] - ffmpeg

I'm trying to use FFMPEG to transcode a video with very large frames (4096 x 4096). It's a short video - just under two minutes, but the source video file is 15.8GB. (The video is an animation designed to be projected onto planetarium domes.)
The source file is a Quicktime MOV containing uncompressed Photo-JPEG images (with audio, too). When I tell FFMPEG to transcode my MOV file into an MP4 file, it simply says:
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Not very helpful, but yes, I've verified that all of the parameters are correct and/or defaults. In fact, if I change the requested output size to 2048x2048, then everything works just fine. That's why I suspect that there's an upper bound in the encoder.
I am kerflummoxed. Any suggestions that result in a successful transcode will be greatly appreciated. (At this point I am also willing to consider alternatives to FFMPEG.)
The Facts
I run FFMPEG from a script:
set srcFile=%1
set dstFile=%srcFile:.mov=.mp4%
ffmpeg -i %srcFile% -movflags faststart -q:a 0 -q:v 0 -pix_fmt yuv420p -sws_flags gauss -s 4096x4096 %dstFile%
The Output
ffmpeg version N-50911-g9efcfbe Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 13 2013 21:26:48 with gcc 4.7.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --ena
ble-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 19.100 / 52. 19.100
libavcodec 55. 0.100 / 55. 0.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 54. 4.100 / 54. 4.100
libavfilter 3. 45.103 / 3. 45.103
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'also-sprach-zarathustra-4k.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2013-01-11 23:41:30
Duration: 00:01:40.57, start: 0.000000, bitrate: 1357694 kb/s
Stream #0:0(eng): Audio: pcm_s16be (twos / 0x736F7774), 44100 Hz, stereo, s16, 1411 kb/s
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj420p, 4096x4096 [SAR 1:1 DAR 1:1], 1356281 kb/s, 30 fps, 30
tbr, 3k tbn, 3k tbc
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
File 'also-sprach-zarathustra-4k.mp4' already exists. Overwrite ? [y/N] y
using SAR=1/1
[libx264 # 003b9c80] frame MB size (256x256) > level limit (36864)
[libx264 # 003b9c80] DPB size (4 frames, 262144 mbs) > level limit (2 frames, 184320 mbs)
[libx264 # 003b9c80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX AVX2 FMA3 LZCNT BMI1 BMI2
x264 [error]: malloc of size 17305600 failed
Output #0, mp4, to 'also-sprach-zarathustra-4k.mp4':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
Stream #0:0(eng): Video: h264, yuv420p, 4096x4096 [SAR 1:1 DAR 1:1], q=-1--1, 90k tbn, 30 tbc
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
Stream #0:1(eng): Audio: none, 44100 Hz, stereo, s16, 128 kb/s
Metadata:
creation_time : 2013-01-11 23:41:30
handler_name : Apple Alias Data Handler
Stream mapping:
Stream #0:1 -> #0:0 (mjpeg -> libx264)
Stream #0:0 -> #0:1 (pcm_s16be -> libvo_aacenc)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
PS: Yes, for those playing at home, it is the theme to 2001 - A Space Odyssey. You can see a 1K YouTube version here: 2001 - A Fulldome Space Odyssey And yes, in a planetarium with a good sound system, it is absolutely EPIC.

I think you're actually running into the limitation of of x264's codec complexity levels.
Brief description of the levels from http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC
As the term is used in the standard, a "level" is a specified set of constraints that indicate a degree of required decoder performance for a profile. For example, a level of support within a profile specifies the maximum picture resolution, frame rate, and bit rate that a decoder may use. A decoder that conforms to a given level must be able to decode all bitstreams encoded for that level and all lower levels.
The max resolution for the highest level (5.2) is 4,096×2,304.
I would look into using HEVC which is specifically designed for these larger format 4K / Ultra-HD resolutions.
http://en.wikipedia.org/wiki/HEVC
Max Resolution for HEVC is currently 8,192x4,320

I suspect your problem is hinted at here:
x264 [error]: malloc of size 17305600 failed
Is this a 32-bit build of ffmpeg? If so, I fear you may be out of luck. 4k video processing really requires >4 GB of memory. Better switch to a 64-bit build and try again.
Of course you actually need to have enough memory available in your computer, too. It could be a lot more than 4 GB, depending on your x264 settings.

Related

ffmpeg error when I try to stream on trovo

When I try to start a stream on the trovo, the error av_interleaved_write_frame(): Unknown error appears.
comand:
ffmpeg -i D:\voi.mp4 -c copy -f flv rtmp://livepush.trovo.live/live/<key>
output:
ffmpeg version n4.4.2-2-g7ffb7d4b04-20220630 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 11.2.0 (crosstool-NG 1.24.0.533_681aaef)
configuration: --prefix=/ffbuild/prefix --pkg-config-flags=--static --pkg-config=pkg-config --cross-prefix=x86_64-w64-mingw32- --arch=x86_64 --target-os=mingw32 --enable-gpl --enable-version3 --disable-debug --disable-w32threads --enable-pthreads --enable-iconv --enable-libxml2 --enable-zlib --enable-libfreetype --enable-libfribidi --enable-gmp --enable-lzma --enable-fontconfig --enable-libvorbis --enable-opencl --disable-libpulse --enable-libvmaf --disable-libxcb --disable-xlib --enable-amf --enable-libaom --enable-libaribb24 --enable-avisynth --enable-libdav1d --enable-libdavs2 --disable-libfdk-aac --enable-ffnvcodec --enable-cuda-llvm --disable-frei0r --enable-libgme --enable-libass --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librist --enable-libtheora --enable-libvpx --enable-libwebp --enable-lv2 --enable-libmfx --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopenmpt --enable-librav1e --enable-librubberband --enable-schannel --enable-sdl2 --enable-libsoxr --enable-libsrt --enable-libsvtav1 --enable-libtwolame --enable-libuavs3d --disable-libdrm --disable-vaapi --enable-libvidstab --disable-vulkan --enable-libx264 --enable-libx265 --enable-libxavs2 --enable-libxvid --enable-libzimg --enable-libzvbi --extra-cflags=-DLIBTWOLAME_STATIC --extra-cxxflags= --extra-ldflags=-pthread --extra-ldexeflags= --extra-libs=-lgomp --extra-version=20220630
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:\voi.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:03:59.70, start: 0.000000, bitrate: 2683 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2511 kb/s, 30 fps, 30 tbr, 30k tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Output #0, flv, to 'rtmp://livepush.trovo.live/live/73846_112160385_112160385?bizid=73846':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.76.100
Stream #0:0(und): Video: h264 (High) ([7][0][0][0] / 0x0007), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 2511 kb/s, 30 fps, 30 tbr, 1k tbn, 30k tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:1(und): Audio: aac (LC) ([10][0][0][0] / 0x000A), 48000 Hz, stereo, fltp, 160 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
av_interleaved_write_frame(): Unknown errortime=00:00:02.19 bitrate=2955.2kbits/s speed=4.21x
[flv # 0000020eada7ecc0] Failed to update header with correct duration.
[flv # 0000020eada7ecc0] Failed to update header with correct filesize.
Error writing trailer of rtmp://livepush.trovo.live/live/73846_112160385_112160385?bizid=73846: Error number -10053 occurred
frame= 86 fps=0.0 q=-1.0 Lsize= 962kB time=00:00:02.77 bitrate=2842.1kbits/s speed=4.22x
video:922kB audio:55kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!
'txSecret' is not recognized as an internal or external command,
operable program or batch file.
'txTime' is not recognized as an internal or external command,
operable program or batch file.
'cert' is not recognized as an internal or external command,
operable program or batch file.
'certTime' is not recognized as an internal or external command,
operable program or batch file.
'flag' is not recognized as an internal or external command,
operable program or batch file.
'timeshift_bps' is not recognized as an internal or external command,
operable program or batch file.
'timeshift_dur' is not recognized as an internal or external command,
operable program or batch file.
'txAddTimestamp' is not recognized as an internal or external command,
operable program or batch file.
'tp_code' is not recognized as an internal or external command,
operable program or batch file.
'tp_sign' is not recognized as an internal or external command,
operable program or batch file.
'dm_sign' is not recognized as an internal or external command,
operable program or batch file.
'pq_sn' is not recognized as an internal or external command,
operable program or batch file.
'txHost' is not recognized as an internal or external command,
operable program or batch file.
I guess this is a problem on the part of trovo. I mean, it is possible that certain restrictions must be observed for streaming on this site, but I do not know which ones specifically.
So how can I fix this?
P.S. on other platforms the stream works for example twitch.
I have tried many commands and different video formats, the result is the same.
I found a solution. You need to specify the video codec -vcodec libx264.
this git helped me: Trovo live streaming
The minimum command to run looks like this: ffmpeg -i "D:\voi.mp4" -vcodec libx264 -f flv "rtmp://livepush.trovo.live/live/<key>"

FFmpeg Convert to JPEG works in VLC but not in Mac Preview?

I'm trying to convert a PNG image to a JPEG image using ffmpeg. As far as I can tell, it's working fine, but it doesn't display properly in Mac Preview.
I'm running the following:
$ ffmpeg -i foo.png foo.jpg
And it produces the following output:
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_1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-11.0.2.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, png_pipe, from 'foo.png':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: png, rgba(pc), 200x231, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (png (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler # 0x7ffeaf00ae00] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'foo.jpg':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: mjpeg, yuvj444p(pc), 200x231, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
Metadata:
encoder : Lavc58.35.100 mjpeg
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
frame= 1 fps=0.0 q=3.7 Lsize=N/A time=00:00:00.04 bitrate=N/A speed= 4.7x
video:12kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
When I open foo.jpg in most applications, such as VLC or Google Chrome, I get exactly what I expected: an image that looks exactly the same as foo.png, the input.
However, this is what is displayed in the Finder preview, and the same this is displayed when I open up the file in "Preview."
~~~I wonder if this has something to do with the deprecated pixel format used, make sure you did set range correctly error, but I'm not sure, especially since the image is fine, the problem seems to be elsewhere.~~~
It seems the deprecated pixel format error is not the issue (that's an internal thing), so I guess I just need to specify pixel formats properly.
Looks like QT / AVFoundation doesn't like fully-sampled chroma in JPEG.
First try
ffmpeg -i foo.png -pix_fmt yuvj422p foo.jpg
else,
ffmpeg -i foo.png -pix_fmt yuvj420p foo.jpg
The warning about deprecated format relates to ffmpeg internals and not the produced output.
You could use the built-in, Apple-supplied sips "Scriptable Image Processing System" tool to do the conversion and thereby avoid the issue and also be less dependent on having to install external tools:
sips -s format jpeg input.png --out output.jpg

ffmpeg recoded mp4 files error on mobiles in Video JS

We are converting seriously old .flv files to MP4 with FFMPEG. These are at least 10 years old.
Back then all were rendered with early versions of Adobe Premiere.
On desktop browsers all the files work and stream (...watching them feels like going back a century!)
But when requesting the videos on the same pages on mobile devices (android and ios) Video JS doesn't even show up.
Perhaps the codec is just too old, but I was wondering if there could be another reason when converting them with this line:
for i in *.flv; do ffmpeg -i "$i" "${i%.*}.mp4"; done
If not, is it possible to detect this in Video JS, so we can show an announcement that the video is only visible on desktops?
I hope someone here has this knowledge!
added on request of llogan
ffmpeg version N-78967-gbaec6d8 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4) configuration: --prefix=/root/ffmpeg_build
--extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 libavutil 55. 19.100 / 55. 19.100 libavcodec 57. 28.100 / 57. 28.100 libavformat 57. 28.100 / 57. 28.100 libavdevice 57. 0.101 / 57. 0.101 libavfilter 6. 39.102 /
6. 39.102 libswscale 4. 0.100 / 4. 0.100 libswresample 2. 0.101 / 2. 0.101 libpostproc 54. 0.100 / 54. 0.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'a_4293_06.mp4': Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf57.28.100 Duration: 00:01:40.10, start: 0.023220, bitrate: 492 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240, 376 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 123 kb/s (default)
Metadata:
handler_name : SoundHandler At least one output file must be specified
Thanks to #llogan's comments I can answer this one myself.
First, I upgraded ffmpeg to the latest version, and then did some research on the -movflags and +faststart.
I found a 2015 article with great info on how to convert .flv to .mp4 (https://addpipe.com/blog/flv-to-mp4/)
So, in order to make the new .mp4 files compatible with mobile devices, you need to add a profile and a level, like this:
in a batch convert:
for i in *.flv; do ffmpeg -y -i "$i" -movflags +faststart -profile:v baseline -level 3.0 "${i%.*}.mp4"; done
and for a single file:
ffmpeg -i filename.flv -movflags +faststart -profile:v baseline -level 3.0 filename.mp4
And then the terminal shows this line when converting:
Starting second pass: moving the moov atom to the beginning of the
file
That is needed, but the addition of the -profile and -level actually made the videos work on the mobile devices.

youtube-dl got a 3gp file, apparently it doesn't contain any video streams. Is there some way to play the video?

I tried downloading a video with youtube-dl with 3gp format. When I try to play it on VLC or any other application it doesn't play. This is the output I get when trying to download it again.
youtube-dl https://youtu.be/lVFq__mrmlQ -f worst -v
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['https://youtu.be/lVFq__mrmlQ', '-f', 'worst', '-v']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2018.03.14
[debug] Python version 3.6.5 (CPython) - Linux-4.15.0-29-generic-x86_64-with-Ubuntu-18.04-bionic
[debug] exe versions: ffmpeg 3.4.2-2, ffprobe 3.4.2-2, phantomjs 2.1.1, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] lVFq__mrmlQ: Downloading webpage
[youtube] lVFq__mrmlQ: Downloading video info webpage
[youtube] lVFq__mrmlQ: Extracting video information
[debug] Invoking downloader on 'https://r4---sn-h5q7dnee.googlevideo.com/videoplayback?signature=5432A7990BB3336616E21753F1D53171D09CBC31.B98E84CF0C51F39C613F53311128CD9E7A3872EA&c=WEB&lmt=1514133618343257&key=yt6&itag=17&fvip=3&mn=sn-h5q7dnee%2Csn-h5q7knes&mm=31%2C29&pl=24&mime=video%2F3gpp&id=o-AKWLZ7MpY1ip3PlxZJ7vXBY-jDqbVpUeI_Bls_o_g-GV&ipbits=0&requiressl=yes&ip=90.174.4.0&gir=yes&mt=1532653244&ms=au%2Crdu&dur=18470.684&initcwndbps=1011250&ei=S29aW5SjH4bIVseNkfgE&expire=1532674987&mv=m&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cexpire&clen=195336027&source=youtube&ratebypass=yes'
[download] Heroes of Might and Magic III - No Might 1v7 FFA (200%)-lVFq__mrmlQ.3gp has already been downloaded
[download] 100% of 186.29MiB
I tried converting it with ffmpeg, but I get the following message:
ffmpeg -i Heroes\ of\ Might\ and\ Magic\ III\ -\ No\ Might\ 1v7\ FFA\ \(200%\)-lVFq__mrmlQ.3gp Heroes\ of\ Might\ and\ Magic\ III\ -\ No\ Might\ 1v7\ FFA\ \(200%\)-lVFq__mrmlQ.mp4
ffmpeg version 3.4.2-2 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu2)
configuration: --prefix=/usr --extra-version=2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --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-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --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-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[mov,mp4,m4a,3gp,3g2,mj2 # 0x562e75c728c0] Could not find codec parameters for stream 0 (Video: mpeg4 (mp4v / 0x7634706D), none, 221 kb/s): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Heroes of Might and Magic III - No Might 1v7 FFA (200%)-lVFq__mrmlQ.3gp':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2017-12-24T16:43:17.000000Z
Duration: 05:07:50.68, bitrate: 84 kb/s
Stream #0:0(und): Video: mpeg4 (mp4v / 0x7634706D), none, 221 kb/s, 30 fps, 30 tbr, 15360 tbn, 15360 tbc (default)
Metadata:
creation_time : 2017-12-24T16:43:17.000000Z
handler_name : IsoMedia File Produced by Google, 5-11-2011
Output #0, mp4, to 'Heroes of Might and Magic III - No Might 1v7 FFA (200%)-lVFq__mrmlQ.mp4':
Output file #0 does not contain any stream
With this information, I don't know how to proceed. I already tried ffmpeg with the max analyzeduration and probesize and it still doesn't work. Any ideas?
EDIT: added list of formats youtube-dl detected.
youtube-dl -F https://youtu.be/lVFq__mrmlQ
[youtube] lVFq__mrmlQ: Downloading webpage
[youtube] lVFq__mrmlQ: Downloading video info webpage
[youtube] lVFq__mrmlQ: Extracting video information
[info] Available formats for lVFq__mrmlQ:
format code extension resolution note
249 webm audio only DASH audio 71k , opus # 50k, 108.83MiB
250 webm audio only DASH audio 85k , opus # 70k, 142.71MiB
171 webm audio only DASH audio 119k , vorbis#128k, 228.14MiB
140 m4a audio only DASH audio 145k , m4a_dash container, mp4a.40.2#128k, 279.77MiB
251 webm audio only DASH audio 152k , opus #160k, 280.97MiB
160 mp4 256x144 144p 114k , avc1.4d400c, 30fps, video only, 91.12MiB
278 webm 256x144 144p 153k , webm container, vp9, 30fps, video only, 176.00MiB
133 mp4 426x240 240p 258k , avc1.4d4015, 30fps, video only, 188.39MiB
242 webm 426x240 240p 261k , vp9, 30fps, video only, 366.78MiB
243 webm 640x360 360p 528k , vp9, 30fps, video only, 751.54MiB
134 mp4 640x360 360p 758k , avc1.4d401e, 30fps, video only, 539.15MiB
244 webm 854x480 480p 896k , vp9, 30fps, video only, 1.43GiB
135 mp4 854x480 480p 1441k , avc1.4d401f, 30fps, video only, 1.40GiB
247 webm 1280x720 720p 1798k , vp9, 30fps, video only, 3.03GiB
136 mp4 1280x720 720p 2673k , avc1.4d401f, 30fps, video only, 2.86GiB
302 webm 1280x720 720p60 2907k , vp9, 60fps, video only, 5.10GiB
298 mp4 1280x720 720p60 4626k , avc1.4d4020, 60fps, video only, 4.11GiB
17 3gp 176x144 small , mp4v.20.3, mp4a.40.2# 24k
36 3gp 320x180 small , mp4v.20.3, mp4a.40.2
43 webm 640x360 medium , vp8.0, vorbis#128k
18 mp4 640x360 medium , avc1.42001E, mp4a.40.2# 96k
22 mp4 1280x720 hd720 , avc1.64001F, mp4a.40.2#192k (best)
The one that got downloaded was number 17.
You passed in -f worst. As the name indicates, -f worst will get you the worst video format, with horrible quality and very little support in many applications, including ffmpeg. In short, you got what you asked for.
To get a better file, ask for something else. For instance, if you just want audio (much smaller than picture for most videos), pass in -x.
If you want the best video quality, simply omit -f worst.
If your device can only play a certain resolution (say 300px width), pass in -f 'bestvideo[width<=300]+bestadio/best[width<=300]'.
If your disk space per video is the limit (e.g. 5GB), pass in -f best[filesize<=5GB].
If your device can only play certain formats, specify that format, with acodec, vcodec, container, or simply ext. For instance, -f worstvideo[ext=mp4]+bestaudio/worst[ext=mp4] will get you the worst-quality MP4 file.
Of course, these selectors can be combined, as in -f worst[ext=mp4][filesize<=5GB]. For more information on all of these options, consult the youtube-dl documentation.
The issue had nothing to do with codecs or ffmpeg. The file got corrupted during download and further attempts to redownload didn't tell me anything about it. Credit to the user phihag for sharing the sha256 of the file.

FFmpeg 'Unable to parse option value "(null)" as sample format'

Im trying to process a file and run the following command
ffmpeg -i input.webm output.webm
I'm doing it with the ffmpeg library from videoconverter.js. I'm trying to understand what is wrong or how I can fix it.
I end up getting this:
Worker has received command
Received command: -i input.webm output.webm. Processing with 268435456 bits.
ffmpeg version 2.2.1 Copyright (c) 2000-2014 the FFmpeg developers
built on Jun 9 2014 20:24:32 with emcc (Emscripten GCC-like replacement) 1.12.0 (commit 6960d2296299e96d43e694806f5d35799ef8d39c)
configuration: --cc=emcc --prefix=/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist --extra-cflags='-I/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/include -v' --enable-cross-compile --target-os=none --arch=x86_32 --cpu=generic --disable-ffplay --disable-ffprobe --disable-ffserver --disable-asm --disable-doc --disable-devices --disable-pthreads --disable-w32threads --disable-network --disable-hwaccels --disable-parsers --disable-bsfs --disable-debug --disable-protocols --disable-indevs --disable-outdevs --enable-protocol=file --enable-libvpx --enable-gpl --extra-libs='/Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/lib/libx264.a /Users/bgrinstead/Sites/videoconverter.js/build/ffmpeg/../dist/lib/libvpx.a'
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
[vp8 # 0xed8c00] Warning: not compiled with thread support, using thread emulation
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, matroska,webm, from 'input.webm':
Metadata:
encoder : Chrome
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0(eng): Audio: opus, 48000 Hz, mono (default)
Stream #0:1(eng): Video: vp8, yuv420p, 640x480, SAR 1:1 DAR 4:3, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
[abuffer # 0xedd670] Unable to parse option value "(null)" as sample format
Last message repeated 1 times
Last message repeated 1 times
[abuffer # 0xedd670] Error setting option sample_fmt to value (null).
[graph 1 input from stream 0:0 # 0xedd600] Error applying options to the filter.
Error opening filters!
Finished processing (took 673ms)
The end result is stopped due to 'Unable to parse option value "(null)" as sample format'. How would I solve this?
Your ffmpeg build is using version 2.2.1 which is old and unsupported.
It is too old to natively support Opus decoding (this version requires libopus to decode Opus). Upgrade to a build derived from the development branch ("git master") or at least use the latest release.
You should also use a modern libvpx if possible as well. Note that with recent FFmpeg you will need to remove --disable-bsfs because VP9 is now the default video encoder for Webm and it requires the vp9_superframe bitstream filter (it is automatically applied). Alternatively, you can force VP8 encoding with -c:v libvpx.
Consider adding libopus (preferred) or libvorbis support for Webm; otherwise you'll be using the very crappy and experimental FFmpeg native Vorbis encoder.

Resources