gpt4 book ai didi

ffmpeg - 使用 -vsync 0 选项时,从 mp4in ffmpeg 提取帧到 jpg 格式会产生错误

转载 作者:行者123 更新时间:2023-12-04 22:56:53 24 4
gpt4 key购买 nike

我正在尝试使用 ffmpeg 从 mp4 视频中提取所有帧。我使用以下命令:

ffmpeg -i "/Users/raimundbuehler/recordings/2022_01_24/000/exports/001/world.mp4" -vsync 0  "/Users/raimundbuehler/data/converted_frames/frame%06d.jpg"
使用 -vsync 2(可变帧速率)时效果很好,但使用 -vsync 0(直通)时效果不佳。但是,使用 vsync 2 会丢几帧,这是我不希望发生的。
提取为 png 格式时,它也可以工作,但我需要 jpg。
它似乎适用于前 40 帧,但在第 41 帧产生错误。
这是输出:
ffmpeg version N-104855-g466441a0d2-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers
built with Apple clang version 11.0.0 (clang-1100.0.33.17)
configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
libavutil 57. 11.100 / 57. 11.100
libavcodec 59. 14.100 / 59. 14.100
libavformat 59. 10.100 / 59. 10.100
libavdevice 59. 0.101 / 59. 0.101
libavfilter 8. 19.100 / 8. 19.100
libswscale 6. 1.101 / 6. 1.101
libswresample 4. 0.100 / 4. 0.100
libpostproc 56. 0.100 / 56. 0.100
Passing a number to -vsync is deprecated, use a string argument as described in the manual.
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/raimundbuehler/recordings/2022_01_24/000/exports/001/world.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.45.100
Duration: 00:00:55.20, start: 0.000000, bitrate: 10379 kb/s
Stream #0:0[0x1](und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 10376 kb/s, 23.60 fps, 23.58 tbr, 65535 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02efc0000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02efd7000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02efe4000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02eff1000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02effe000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f00b000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f018000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f025000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f032000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f03f000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f04c000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f059000] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x7ff02ef5b000] [swscaler @ 0x7ff02f066000] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to '/Users/raimundbuehler/data/converted_frames/frame%06d.jpeg':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf59.10.100
Stream #0:0(und): Video: mjpeg, yuvj420p(pc, progressive), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 23.58 fps, 23.58 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
encoder : Lavc59.14.100 mjpeg
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
[mjpeg @ 0x7ff029413f40] Invalid pts (41) <= last (41)trate=N/A speed=2.02x
Video encoding failed
Conversion failed!
帮助将不胜感激!

最佳答案

mjpeg 解码器不喜欢具有重复点的帧。
您可以简单地重新定时它们以避免这种情况。ffmpeg -i "/Users/raimundbuehler/recordings/2022_01_24/000/exports/001/world.mp4" -vf setpts=N/FR/TB -vsync 0 "/Users/raimundbuehler/data/converted_frames/frame%06d.jpg"

关于ffmpeg - 使用 -vsync 0 选项时,从 mp4in ffmpeg 提取帧到 jpg 格式会产生错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70880957/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com