gpt4 book ai didi

ffmpeg - 当从相机捕获原始数据并通过管道传输到 ffplay 时,视频会横向移动

转载 作者:行者123 更新时间:2023-12-04 22:59:26 28 4
gpt4 key购买 nike

我正在尝试使用 ffmpeg 从摄像头捕获视频(macOS 10.12) 并通过管道将其预览到 ffplay使用 rawvideo-v copy选项:

ffmpeg -f avfoundation -pixel_format 0rgb -framerate 25 -video_size 1280x720 -i "0" -map 0:v -c copy -f rawvideo - | ffplay -f rawvideo -video_size 1280x720 -pixel_format 0rgb -i -

视频捕捉得很好,但是,它不断地向侧面移动(见附件截图)。这里可能有什么问题?

enter image description here

更新 完整 ffmpeg日志输出:
$ ffmpeg -f avfoundation -pixel_format 0rgb -framerate 25 -video_size 1280x720 -i "0" -map 0:v -c copy -f rawvideo - | ffplay -f rawvideo -video_size 1280x720 -pixel_format 0rgb -i -
ffmpeg version 4.0.2ffplay version 4.0.2 Copyright © 2003-2018 the FFmpeg developers Copyright © 2000-2018 the FFmpeg developers

built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-ffplay --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-ffplay --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
libavutil 56. 14.100 / 56. 14.100
libavutil 56. 14.100 / 56. 14.100
libavcodec 58. 18.100 / 58. 18.100
libavformat 58. 12.100 / 58. 12.100
libavcodec 58. 18.100 / 58. 18.100
libavdevice 58. 3.100 / 58. 3.100
libavformat 58. 12.100 / 58. 12.100
libavfilter 7. 16.100 / 7. 16.100
libavdevice 58. 3.100 / 58. 3.100
libavresample 4. 0. 0 / 4. 0. 0
libavfilter 7. 16.100 / 7. 16.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libavresample 4. 0. 0 / 4. 0. 0
libpostproc 55. 1.100 / 55. 1.100
libswscale 5. 1.100 / 5. 1.100
libswresample 3. 1.100 / 3. 1.100
libpostproc 55. 1.100 / 55. 1.100
2018-09-20 09:33:28.013 ffmpeg[45781:16452887] Error loading /Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn: dlopen(/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn, 262): no suitable image found. Did find:
/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn: mach-o, but wrong architecture
/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn: mach-o, but wrong architecture
2018-09-20 09:33:28.013 ffmpeg[45781:16452887] Cannot find function pointer New_SHP_PlugIn for factory 834FC054-C1CC-11D6-BD01-00039315CD46 in CFBundle/CFPlugIn 0x7fe63b506d00 </Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin> (bundle, not loaded)
2018-09-20 09:33:28.069 ffplay[45782:16452888] Error loading /Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn: dlopen(/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn, 262): no suitable image found. Did find:
/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn: mach-o, but wrong architecture
/Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin/Contents/MacOS/SeratoVirtualAudioPlugIn: mach-o, but wrong architecture
2018-09-20 09:33:28.069 ffplay[45782:16452888] Cannot find function pointer New_SHP_PlugIn for factory 834FC054-C1CC-11D6-BD01-00039315CD46 in CFBundle/CFPlugIn 0x7f93f3c13020 </Library/Audio/Plug-Ins/HAL/SeratoVirtualAudioPlugIn.plugin> (bundle, not loaded)
[avfoundation @ 0x7fe63c000000] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, avfoundation, from '0':
Duration: N/A, start: 1054.178167, bitrate: N/A
Stream #0:0: Video: rawvideo ([0]RGB / 0x42475200), 0rgb, 1280x720, 1000k tbr, 1000k tbn, 1000k tbc
Output #0, rawvideo, to 'pipe:': 0KB vq= 0KB sq= 0B f=0/0
Metadata:
encoder : Lavf58.12.100
Stream #0:0: Video: rawvideo ([0]RGB / 0x42475200), 0rgb, 1280x720, q=2-31, 1000k tbr, 1000k tbn, 1000k tbc
Stream mapping:
Stream #0:0 -> #0:0 ©
Press [q] to stop, [?] for help
Input #0, rawvideo, from 'pipe:':
Duration: N/A, start: 0.000000, bitrate: 737280 kb/s
Stream #0:0: Video: rawvideo ([0]RGB / 0x42475200), 0rgb, 1280x720, 737280 kb/s, 25 tbr, 25 tbn, 25 tbc
frame= 16 fps=0.0 q=-1.0 size= 57600kB time=00:00:00.60 bitrate=786437.5kbits/s speed=1.frame= 29 fps= 28 q=-1.0 size= 104401kB time=00:00:01.12 bitrate=763617.4kbits/s speed=1.frame= 42 fps= 27 q=-1.0 size= 151201kB time=00:00:01.64 bitrate=755268.5kbits/s speed=1.frame= 55 fps= 26 q=-1.0 size= 198002kB time=00:00:02.16 bitrate=750939.5kbits/s speed=1.frame= 68 fps= 26 q=-1.0 size= 244802kB time=00:00:02.68 bitrate=748290.4kbits/s speed=1.av_interleaved_write_frame(): Broken pipe= 0KB sq= 0B f=0/0
Error writing trailer of pipe:: Broken pipe
frame= 69 fps= 26 q=-1.0 Lsize= 247650kB time=00:00:02.72 bitrate=745863.6kbits/s speed=1.01x
video:248402kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.

最佳答案

看起来像对齐/填充的问题。由于 ffplay 似乎没有此选项,请为 ffplay 尝试不同的更大视频宽度,而不是像 1282 或更大的 1280。

关于ffmpeg - 当从相机捕获原始数据并通过管道传输到 ffplay 时,视频会横向移动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52390694/

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