我正在尝试使用ffmpeg从视频中提取缩略图,但我收到以下错误。视频取自Ipad并水平翻转。
/var/www/html/ffmpeg -i "/var/www/html/media/4/event-4-video-setting-17.mp4" -r 1 -ss 00:00:03 -vframes 1 "/var/www/html/media/4/new_file.jpg"
ffmpeg version N-63893-gc69defd Copyright (c) 2000-2014 the FFmpeg developers
built on Jul 16 2014 05:38:01 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
libavutil 52. 89.100 / 52. 89.100
libavcodec 55. 66.101 / 55. 66.101
libavformat 55. 43.100 / 55. 43.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 8.100 / 4. 8.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/var/www/html/media/4/event-4-video-setting-17.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2015-09-08 07:03:47
Duration: 00:00:05.45, start: 0.000000, bitrate: 5048 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 480x640, 5042 kb/s, SAR -1:1 DAR -3:4, 28.42 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
Metadata:
rotate : 180
creation_time : 2015-09-08 07:03:47
handler_name : Core Media Data Handler
encoder : H.264
[buffer @ 0x3183060] Value -1.000000 for parameter 'pixel_aspect' out of range [0 - 1.79769e+308]
Last message repeated 3 times
[buffer @ 0x3183060] Error setting option pixel_aspect to value -1/1.
[graph 0 input from stream 0:0 @ 0x318b620] Error applying options to the filter.
Error opening filters!
答案 0 :(得分:3)
您以某种方式对样本宽高比(SAR)和显示宽高比(DAR)有负值:
SAR -1:1 DAR -3:4
尝试使用过滤器正确设置它们:
-filter:v "setsar=1/1,setdar=3/4"