我收到错误“已弃用的像素格式使用,请确保您使用ffmpeg正确设置了范围”。有人可以在下面检查我的代码吗?
2022-08-30 14:38:42
这是我的代码,我想有视频缩略图,但我不熟悉,有人可以知道我得到的错误。ffmpeg
ffmpeg
[swscaler @ 0x7ff8da028c00] deprecated pixel format used, make sure you did set range correctly
Output #0, mjpeg, to 'image.jpg':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
encoder : Lavf56.36.100
Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 320x240 [SAR 4:3 DAR 16:9], q=2-31, 200 kb/s, 1 fps, 1 tbn, 1 tbc (default)
Metadata:
creation_time : 2016-11-06 09:40:22
handler_name : ISO Media file produced by Google Inc.
encoder : Lavc56.41.100 mjpeg
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
frame= 1 fps=0.0 q=4.8 Lsize= 16kB time=00:00:01.00 bitrate= 129.5kbits/s
video:16kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
这也是我的代码:
$video_url ='https://URL/upload/4b8acab123563649f19e07450d810df6.mp4';
$ffmpeg = '/opt/local/bin/ffmpeg';
$image = 'image.jpg';
$interval = 5;
$size = '320x240';
shell_exec($tmp = "$ffmpeg -i $video_url -deinterlace -an -ss $interval -f mjpeg -t 1 -r 1 -y -s $size $image 2>&1");