Reputation: 102
I am a newbie in terms of video processing in general and ffmpeg in particular. So this might be a real beginner's question.
I am trying to extract frames from an avi. This is the command:
ffmpeg.exe -i 123.avi -vf select='gt(scene\,0.4)',scale=1920:-1,tile=6x3 -frames:v 1 456.jpg
And this is the console output:
ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 7.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavdevice 58. 3.100 / 58. 3.100
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
Input #0, avi, from 'C:\work\exports\123.avi':
Duration: 00:02:12.43, start: 0.000000, bitrate: 4455 kb/s
Stream #0:0: Video: rawvideo, pal8, 164x485, 4459 kb/s, 7 fps, 7 tbr, 7 tbn, 7 tbc
Metadata:
title : FileAVI write
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 000000eb4f415ec0] deprecated pixel format used, make sure you did set range correctly
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!
Do I need a particular encoder when working with avi files? Which one and how do I specify it?
Upvotes: 0
Views: 8997
Reputation: 93018
Use
ffmpeg -i 123.avi -vf select='gt(scene\,0.4)',tile=6x3,scale=1920:-2 -frames:v 1 456.jpg
The scale filter should be placed after the tile. Placing it before, will lead to each selected frame being scaled to width 1920. When the tile filter stacks those frames together, your output will be 11520 pixels wide, and height being taller.
Upvotes: 1