我尝试将视频 (mp4) 发送到网络摄像头
当我按照https://askubuntu.com/questions/881305/is-there-any-way-ffmpeg-send-video-to-dev-video0-on-ubuntu,我重新编译了v412
$ffmpeg -re -i sp.mp4 -map 0:v -f v4l2 /dev/video0
[video4linux2,v4l2 @ 0x563fe7ffa200] ioctl(VIDIOC_G_FMT): Invalid argument
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --
Conversion failed!
视频信息:
$ffmpeg -i sp.mp4
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'sp.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.49.100
Duration: 00:00:32.27, start: 0.000000, bitrate: 315 kb/s
Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 640x480 [SAR 4:3 DAR 16:9], 314 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 30k tbc (default)
相机信息:
$ffmpeg -f video4linux2 -list_formats all -i /dev/video0
libavutil 56. 57.100 / 56. 57.100
libavcodec 58. 98.100 / 58. 98.100
libavformat 58. 49.100 / 58. 49.100
libavdevice 58. 11.101 / 58. 11.101
libavfilter 7. 87.100 / 7. 87.100
libswscale 5. 8.100 / 5. 8.100
libswresample 3. 8.100 / 3. 8.100
libpostproc 55. 8.100 / 55. 8.100
[video4linux2,v4l2 @ 0x55fd103b5640] Raw : yuyv422 : YUYV 4:2:2 : 640x480 160x120 320x240
从:https://askubuntu.com/questions/1225710/18-04-ffmpeg-play-mp4-on-fake-webcam-conversion-failed,v412 必须从源头进行更新,这是我在开始时就已经完成的。
从:https://github.com/umlaeute/v4l2loopback/issues/247,问题出在错误的摄像头上。我确定我的是 /dev/video0,ffplay /dev/video0
它显示的正是我的网络摄像头
我还尝试从源代码重新编译 ffmpeg,以确保它是最新的。操作系统:kubuntu 20.04
卡了两天了。有解决办法吗?