Sample Header Ad - 728x90

How can I stream a mp4 video file as input for audio/video loopback devices in macos?

2 votes
0 answers
1415 views
In Linux, we can use ffmpeg to stream a video file as inputs to virtual audio/video devices emulated using v4l2loopback & snd-aloop drivers. **LINUX** > **ffmpeg -i /home/user/downloads/myvideo.mp4 -map 0:0 -f v4l2 /dev/video0 -map 0:1 -f alsa hw:Loopback,0** The above command will pass the audio & video streams from the mp4 file to v4l2loopback webcam & alsa loopback card respectively. I want to achieve the same thing on MacOS VM running in virtualbox using webcamoid's akvcam virtual webcam driver & soundflower loopback card which are identified via avfoundation as list below:
$ ffmpeg -f avfoundation -list_devices true -i ""
[AVFoundation input device @ 0x7f2d3e802560] AVFoundation video devices:
[AVFoundation input device @ 0x7f2d3e802560]  Testcam1 (akvcam/video0)
[AVFoundation input device @ 0x7f2d3e802560] [1]  Capture screen 0
[AVFoundation input device @ 0x7f2d3e802560] AVFoundation audio devices:
[AVFoundation input device @ 0x7f2d3e802560]  Soundflower (2ch)
[AVFoundation input device @ 0x7f2d3e802560] [1]  Soundflower (64ch)
Though it doesn't straight forward like Linux, I had tried the following to make it happen, but was not successful : **MACOS** > **ffmpeg -i ~/Downloads/myvideo.mp4 -f avfoundation -video_device_index 0 -audio_device_index 0** resulted in this: one output file is must be specified to write the output The examples I came across in the web are just meant to be capturing audio/video through the devices as like the one here : **Example Found:-** > **ffmpeg -f avfoundation -pixel_format bgr0 -i "0:0" out.avi** But I need the command to perform the thing in the reverse way to broadcast it in a web conference. Any guidance will be highly appreciated...
Asked by S.K. Venkat (121 rep)
Apr 27, 2020, 03:17 PM
Last activity: Aug 5, 2023, 08:57 AM