[FFmpeg-user] cant stream audio and video at the same time

Gisbert Haas gisbert.haas at myvinn.com
Mon Jan 4 23:58:22 EET 2021


Hi All,


I'm facing a weird problem. I would like to capture HDMI using HDMI USB 
capture device and stream as multicast.

Ubuntu 20.10 server 64bit, ffpmeg version 4.3.1-4, but its the same with 
the latest RaspbianOS 32bit and ffpmeg version 4.2


If I capture video on its own it works:

ffmpeg -f v4l2 -input_format yuyv422 -video_size 1280x720 -i /dev/video0 
-c:v h264_v4l2m2m -b:v 8M -f mpegts udp://230.10.1.1:5700


same for Audio, this works:

ffmpeg -f alsa -ac 2 -i hw:2   -c:a aac -f mpegts udp://230.10.1.1:5700


If I do both together the video stops working and the fps drops to 
nearly 0. Audio works fine:

ffmpeg -f alsa -ac 2 -i hw:2 -f v4l2 -input_format yuv420p -video_size 
1280x720 -i /dev/video0 -c:v h264_v4l2m2m -b:v 8M -c:a aac -f mpegts  
udp://230.10.1.1:5700


fps nearly 0:

Output #0, mpegts, to 'udp://230.10.1.1:5700':
   Metadata:
     encoder         : Lavf58.45.100
     Stream #0:0: Video: h264 (h264_v4l2m2m), yuyv422(progressive), 
1280x720, q=-1--1, 8000 kb/s, 60 fps, 90k tbn, 60 tbc
     Metadata:
       encoder         : Lavc58.91.100 h264_v4l2m2m
     Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
     Metadata:
       encoder         : Lavc58.91.100 aac

frame=    2 fps=0.0 q=-0.0 size=       1kB time=08:49:27.95 bitrate=   
0.0kbits/s speed=6.31e+04x

frame=    2 fps=2.0 q=-0.0 size=       2kB time=08:49:27.95 bitrate=   
0.0kbits/s speed=3.16e+04x

frame=    2 fps=1.3 q=-0.0 size=       4kB time=08:49:27.95 bitrate=   
0.0kbits/s speed=2.1e+04x

frame=    2 fps=1.0 q=-0.0 size=       5kB time=08:49:27.95 bitrate=   
0.0kbits/s speed=1.57e+04x

frame=    2 fps=0.8 q=-0.0 size=       6kB time=08:49:27.95 bitrate=   
0.0kbits/s speed=1.26e+04x

frame=    2 fps=0.7 q=-0.0 size=       7kB time=08:49:27.95 bitrate=   
0.0kbits/s speed=1.05e+04x



I must be doing something wrong just dont see it.

Anyone got a bright idea?


Thanks a lot



More information about the ffmpeg-user mailing list