ShayBox / Mon2Cam

Workaround for multi-monitor Discord screensharing
MIT License
337 stars 33 forks source link

[arch] ffmpeg fails to launch, avcodec error (av_interleaved_write_frame(): Invalid argument) #85

Closed lyiriyah closed 2 years ago

lyiriyah commented 2 years ago

I'm on Arch, using the AUR package with v4l2loopback version 0.12.5. ffmpeg -f x11grab -r 60 -s 1920x1080 -i :0+1024,0 -pix_fmt yuv420p -f v4l2 /dev/video50 fails to run with this output:

[x11grab @ 0x55a4eb8524c0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, x11grab, from ':0+1024,0':
  Duration: N/A, start: 1656245704.326700, bitrate: 3981312 kb/s
  Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1920x1080, 3981312 kb/s, 60 fps, 1000k tbr, 1000k tbn
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> rawvideo (native))
Press [q] to stop, [?] for help
Output #0, video4linux2,v4l2, to '/dev/video50':
  Metadata:
    encoder         : Lavf59.16.100
  Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(tv, progressive), 1920x1080, q=2-31, 1492992 kb/s, 60 fps, 60 tbn
    Metadata:
      encoder         : Lavc59.18.100 rawvideo
av_interleaved_write_frame(): Invalid argument00.00 bitrate=N/A speed=N/A    
frame=    2 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.01 bitrate=N/A speed=0.451x    
video:3038kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Conversion failed!

Looks to be an error in avcodec. I'm going to try downgrading libav and see if that changes anything (fwiw: ffmpeg -f x11grab -r 60 -s 1920x1080 -i :0+1024,0 -pix_fmt yuv420p -f mp4 test.mp4 works fine).

Thanks in advance for any help you can give.

lyiriyah commented 2 years ago

Just seen umlaeute/v4l2loopback#484, which is probably related. I'll try rebuilding v4l2l from the commit prior to the one mentioned (d01c20c) this fork.

lyiriyah commented 2 years ago

Ok, so this is resolved by umlaeute/v4l2loopback/pull/485. Sorry for wasting your time, lol