简体   繁体   English

ffmpeg从mp4文件导出的图像不清楚

[英]UnClear image exported by ffmpeg from mp4 file

I am trying to take a snapshot from mp4 video. 我正在尝试从mp4视频中拍摄快照。 here is the code that i use through PHP: 这是我通过PHP使用的代码:

exec("ffmpeg -ss 00:00:03 -i 1419856237575730484.mp4 -y -an -f mjpeg -vframes 1 1419856237575730484.jpg 2>&1")

the result contain the following error : 结果包含以下错误:

Error while decoding stream #0:0: Invalid data found when processing input (Last message repeated 37 times) 解码流#0:0时出错:处理输入时发现无效数据(上一条消息重复了37次)

invoking the function will result an image 调用该功能将产生图像 首次通话产生的图像

and the second call get another image differed from the previous one but still fuzzy and corrupted like so: 第二个调用得到的另一个图像与前一个图像不同,但仍然模糊不清,如下所示: 第二次通话产生的图像

any help will be appreciated. 任何帮助将不胜感激。


ffmpeg version N-68271-geb74839-syslint Copyright (c) 2000-2014 the FFmpeg developers
built on Dec 7 2014 04:36:06 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl --enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 --enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint
libavutil 54. 15.100 / 54. 15.100
libavcodec 56. 14.100 / 56. 14.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
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x71fdc0] overread end of atom 'colr' by 1 bytes
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'view/media/video/1419856237575730484.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2011-08-30 14:11:40
encoder : HandBrake 0.9.5 2011010300
title : malaf
artist : 4
comment : 3
Duration: 00:00:33.07, start: 0.000000, bitrate: 983 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709), 640x360, 866 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc (default)
Metadata:
creation_time : 2011-08-30 14:11:40
encoder : JVT/AVC Coding
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
Metadata:
creation_time : 2011-08-30 14:11:40
[swscaler @ 0x7070c0] deprecated pixel format used, make sure you did set range correctly
Output #0, mjpeg, to 'view/media/video/1419856237575730484.jpg':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
comment : 3
artist : 4
title : malaf
encoder : Lavf56.15.102
Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 640x360, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc (default)
Metadata:
creation_time : 2011-08-30 14:11:40
encoder : Lavc56.14.100 mjpeg
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
Error while decoding stream #0:0: Invalid data found when processing input
Last message repeated 37 times
frame= 1 fps=0.0 q=3.8 Lsize= 10kB time=00:00:00.04 bitrate=2131.6kbits/s
video:10kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000% 

I have discovered that this problem caused by OS permission. 我发现此问题是由操作系统权限引起的。 Re-installing FFMPEG and all required libraries and give the operated user the sufficient permission solve my problem. 重新安装FFMPEG和所有必需的库并给予操作用户足够的权限解决了我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM