2

I tried to send video (mp4) to webcam

as I follow the instruction from https://askubuntu.com/questions/881305/is-there-any-way-ffmpeg-send-video-to-dev-video0-on-ubuntu , I recompile 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!

video information:

$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)

camera information:

$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

from: https://askubuntu.com/questions/1225710/18-04-ffmpeg-play-mp4-on-fake-webcam-conversion-failed , v412 must be updated from the source, which is I already done in beginning.

from: https://github.com/umlaeute/v4l2loopback/issues/247 , the issue was wrong camera. I'm sure mine is /dev/video0 with ffplay /dev/video0 which is showing exactly my webcam

I also tried to recompile ffmpeg from source to make sure it's the most updated one. OS: kubuntu 20.04

Stuck for 2 days. any solution?

1
  • I would expect your camera information output to show Raw : yuv420p : Planar YUV 4:2:0 : 640x480 when ffmpeg command #1 is running, and only /dev/video0: Immediate exit requested when it is not. It showing yuyv422 and several widthxheight makes me assume another video device is active. I can only get ioctl(VIDIOC_G_FMT): Invalid argument when I have a real camera plugged in (as /dev/video0) and try to output to that instead of /dev/video1. Otherwise, your command works for me using a similar input, ffmpeg 4.3.1, and v4l2loopback-dkms 0.12.5.
    – llogan
    Commented Aug 1, 2020 at 21:23

0

You must log in to answer this question.

Browse other questions tagged .