How to List Devices and Stream Live Video with FFmpeg to RTMP and RTSP
This guide shows how to list local video and audio devices using FFmpeg, push live streams to RTMP or RTSP servers, and view them with VLC, including commands for device selection, codec settings, frame rate, and bitrate adjustments.
Listing Local Devices with FFmpeg
Run the following command to display video and microphone devices recognized by DirectShow on Windows: ffmpeg -list_devices true -f dshow -i dummy The output highlights video devices and microphone devices in red.
Streaming to an RTMP Server
Use FFmpeg to capture from the Lenovo EasyCamera and the default microphone, encode with libx264, and push the stream to an RTMP endpoint:
ffmpeg -f dshow -i video="Lenovo EasyCamera":audio="麦克风 (Realtek High Definition Audio)" \
-vcodec libx264 \
-acodec copy -preset:v ultrafast -tune:v zerolatency \
-f flv "rtmp://aitech.com/live/tinywan123"Viewing the Live Stream with VLC
Open VLC media player and open the network stream URL (RTMP or RTSP) to watch the live video.
Streaming to an RTSP Server (EasyDarwin)
Push the same capture to an RTSP server using FFmpeg. The command below includes the libvo_aacenc audio codec and sets the output format to RTSP:
ffmpeg -f dshow \
-i video="Lenovo EasyCamera":audio="麦克风 (Realtek High Definition Audio)" \
-vcodec libx264 \
-acodec libvo_aacenc \
-preset:v ultrafast -tune:v zerolatency \
-f rtsp rtsp://13313.3123/tinywan123.sdpSetting Frame Rate and Bitrate
When streaming via RTSP, you may need to set the frame rate (e.g., 25 fps) before the output URL and optionally increase the bitrate:
ffmpeg -f dshow \
-i video="Lenovo EasyCamera":audio="麦克风 (Realtek High Definition Audio)" \
-vcodec libx264 \
-acodec libvo_aacenc -b 1080k \
-r 25 \
-preset:v ultrafast -tune:v zerolatency \
-f rtsp rtsp://127.0.0.1/tinywan123.sdpSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Open Source Tech Hub
Sharing cutting-edge internet technologies and practical AI resources.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
