Sending ffmpeg output to virtual usb uvc device in Linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sending ffmpeg output to virtual usb uvc device in Linux

Jim Ruxton
I am wondering if there is a way to send ffmpeg output of a stream to a
virtual usb device. I am using a videoloopback device now. I thought I
could use something like this https://github.com/wlhe/uvc-gadget to be
able to convert the dummy video device to make it look like a webcam but
I haven't had any luck. One of the programs I'm using won't work with a
stream and seems to need a usb device though most programs work with the
loopback device as is. The ffmpeg command I am currently using is:

ffmpeg -re -i $(youtube-dl -g -f 95
https://www.youtube.com/watch?v=9Auq9mYxFEE) -vcodec rawvideo -f v4l2
/dev/video2 -f alsa default

Thanks for any tips or thoughts on this.

Jim



_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Sending ffmpeg output to virtual usb uvc device in Linux

Jim Ruxton
Here is a couple seconds of  output for the command below as requested.

ffmpeg version 4.1.4-1build2 Copyright (c) 2000-2019 the FFmpeg developers
   built with gcc 9 (Ubuntu 9.2.1-4ubuntu1)
   configuration: --prefix=/usr --extra-version=1build2
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265
--enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
   WARNING: library configuration mismatch
   avcodec     configuration: --prefix=/usr --extra-version=1build2
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265
--enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
--enable-version3 --disable-doc --disable-programs --enable-liblensfun
--enable-libopencore_amrnb --enable-libopencore_amrwb
--enable-libtesseract --enable-libvo_amrwbenc
   libavutil      56. 22.100 / 56. 22.100
   libavcodec     58. 35.100 / 58. 35.100
   libavformat    58. 20.100 / 58. 20.100
   libavdevice    58.  5.100 / 58.  5.100
   libavfilter     7. 40.101 /  7. 40.101
   libavresample   4.  0.  0 /  4.  0.  0
   libswscale      5.  3.100 /  5.  3.100
   libswresample   3.  3.100 /  3.  3.100
   libpostproc    55.  3.100 / 55.  3.100
[hls,applehttp @ 0x55d3b986bb00] Opening
'https://r3---sn-ux3n588t-mjhl.googlevideo.com/videoplayback/id/9Auq9mYxFEE.1/itag/95/source/yt_live_broadcast/expire/1589522879/ei/X929XqTjMsi7D_O1ocgH/ip/216.154.17.10/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/r3---sn-ux3n588t-mjhl.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/initcwndbps/7530/mh/Yv/mm/44/mn/sn-ux3n588t-mjhl/ms/lva/mv/m/mvi/2/pl/17/keepalive/yes/mt/1589499438/disable_polymer/true/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhAJeJOVD0o1VACKEk-9dc9t5yOt2uwQdWv56BNQ5mshHKAiEA4jyaMMxcUmwSlv5VZ3OkWMXobGuA44pyBNi1xX6PRzU%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRgIhALOYPRJONE8-pqGAQYZJSVVTJgIxvUN2dR79OkCtg4leAiEAtQ5mYoipEI-DZu_4xtZ1KHepzA6ByMzhZKho-fFovSo%3D/playlist/index.m3u8/sq/3361953/goap/clen%3D80746%3Blmt%3D1589501274823740/govp/clen%3D1298028%3Blmt%3D1589501274823740/dur/5.000/file/seg.ts' 
for reading
[hls,applehttp @ 0x55d3b986bb00] Opening
'https://r3---sn-ux3n588t-mjhl.googlevideo.com/videoplayback/id/9Auq9mYxFEE.1/itag/95/source/yt_live_broadcast/expire/1589522879/ei/X929XqTjMsi7D_O1ocgH/ip/216.154.17.10/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/r3---sn-ux3n588t-mjhl.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/initcwndbps/7530/mh/Yv/mm/44/mn/sn-ux3n588t-mjhl/ms/lva/mv/m/mvi/2/pl/17/keepalive/yes/mt/1589499438/disable_polymer/true/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhAJeJOVD0o1VACKEk-9dc9t5yOt2uwQdWv56BNQ5mshHKAiEA4jyaMMxcUmwSlv5VZ3OkWMXobGuA44pyBNi1xX6PRzU%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRgIhALOYPRJONE8-pqGAQYZJSVVTJgIxvUN2dR79OkCtg4leAiEAtQ5mYoipEI-DZu_4xtZ1KHepzA6ByMzhZKho-fFovSo%3D/playlist/index.m3u8/sq/3361954/goap/clen%3D81191%3Blmt%3D1589501280255004/govp/clen%3D712358%3Blmt%3D1589501280255004/dur/5.000/file/seg.ts' 
for reading
Input #0, hls,applehttp, from
'https://manifest.googlevideo.com/api/manifest/hls_playlist/expire/1589522879/ei/X929XqTjMsi7D_O1ocgH/ip/216.154.17.10/id/9Auq9mYxFEE.1/itag/95/source/yt_live_broadcast/requiressl/yes/ratebypass/yes/live/1/goi/160/sgoap/gir%3Dyes%3Bitag%3D140/sgovp/gir%3Dyes%3Bitag%3D136/hls_chunk_host/r3---sn-ux3n588t-mjhl.googlevideo.com/playlist_duration/30/manifest_duration/30/vprv/1/playlist_type/DVR/initcwndbps/7530/mh/Yv/mm/44/mn/sn-ux3n588t-mjhl/ms/lva/mv/m/mvi/2/pl/17/dover/11/keepalive/yes/mt/1589499438/disable_polymer/true/sparams/expire,ei,ip,id,itag,source,requiressl,ratebypass,live,goi,sgoap,sgovp,playlist_duration,manifest_duration,vprv,playlist_type/sig/AOq0QJ8wRgIhAJeJOVD0o1VACKEk-9dc9t5yOt2uwQdWv56BNQ5mshHKAiEA4jyaMMxcUmwSlv5VZ3OkWMXobGuA44pyBNi1xX6PRzU%3D/lsparams/hls_chunk_host,initcwndbps,mh,mm,mn,ms,mv,mvi,pl/lsig/AG3C_xAwRgIhALOYPRJONE8-pqGAQYZJSVVTJgIxvUN2dR79OkCtg4leAiEAtQ5mYoipEI-DZu_4xtZ1KHepzA6ByMzhZKho-fFovSo%3D/playlist/index.m3u8':
   Duration: N/A, start: 11561.647422, bitrate: N/A
   Program 0
     Metadata:
       variant_bitrate : 0
     Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz,
stereo, fltp
     Metadata:
       variant_bitrate : 0
     Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B),
yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k
tbn, 60 tbc
     Metadata:
       variant_bitrate : 0
Stream mapping:
   Stream #0:1 -> #0:0 (h264 (native) -> rawvideo (native))
   Stream #0:0 -> #1:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #1, alsa, to 'default':
   Metadata:
     encoder         : Lavf58.20.100
     Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
     Metadata:
       variant_bitrate : 0
       encoder         : Lavc58.35.100 pcm_s16le
[alsa @ 0x55d3b9e83b40] ALSA buffer xrun.
     Last message repeated 13 times
Output #0, video4linux2,v4l2, to '/dev/video2':
   Metadata:
     encoder         : Lavf58.20.100
     Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], q=2-31, 331776 kb/s, 30 fps, 30 tbn, 30 tbc
     Metadata:
       variant_bitrate : 0
       encoder         : Lavc58.35.100 rawvideo
[alsa @ 0x55d3b9e83b40] ALSA buffer xrun.
     Last message repeated 8 times
[alsa @ 0x55d3b9e83b40] ALSA buffer xrun.00:00:00.51 bitrate=N/A
speed=1.02x
     Last message repeated 22 times
frame=   22 fps= 22 q=-0.0 size=N/A time=00:00:01.00 bitrate=N/A
speed=0.993x   [alsa @ 0x55d3b9e83b40] ALSA buffer xrun.
     Last message repeated 23 times
[alsa @ 0x55d3b9e83b40] ALSA buffer xrun.00:00:01.51 bitrate=N/A
speed=   1x
     Last message repeated 23 times
[alsa @ 0x55d3b9e83b40] ALSA buffer xrun.00:00:02.02 bitrate=N/A
speed=1.01x
     Last message repeated 22 times
frame=   67 fps= 27 q=-0.0 size=N/A time=00:00:02.51 bitrate=N/A
speed=0.998x   [alsa @ 0x55d3b9e83b40] ALSA buffer xrun.
     Last message repeated 24 times
[alsa @ 0x55d3b9e83b40] ALSA buffer xrun.00:00:03.05 bitrate=N/A
speed=1.01x
     Last message repeated 22 times
[alsa @ 0x55d3b9e83b40] ALSA buffer xrun.00:00:03.54 bitrate=N/A
speed=   1x
     Last message repeated 1 times
frame=   98 fps= 27 q=-0.0 Lsize=N/A time=00:00:03.58 bitrate=N/A
speed=0.998x
video:132300kB audio:672kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown
Exiting normally, received signal 2.

On 2020-05-14 7:43 p.m., Jim Ruxton wrote:

> I am wondering if there is a way to send ffmpeg output of a stream to
> a virtual usb device. I am using a videoloopback device now. I thought
> I could use something like this https://github.com/wlhe/uvc-gadget to
> be able to convert the dummy video device to make it look like a
> webcam but I haven't had any luck. One of the programs I'm using won't
> work with a stream and seems to need a usb device though most programs
> work with the loopback device as is. The ffmpeg command I am currently
> using is:
>
> ffmpeg -re -i $(youtube-dl -g -f 95
> https://www.youtube.com/watch?v=9Auq9mYxFEE) -vcodec rawvideo -f v4l2
> /dev/video2 -f alsa default
>
> Thanks for any tips or thoughts on this.
>
> Jim
>
>
>

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".