Operations 3 min read

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.

Open Source Tech Hub
Open Source Tech Hub
Open Source Tech Hub
How to List Devices and Stream Live Video with FFmpeg to RTMP and RTSP

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.sdp

Setting 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.sdp
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

live streamingCommand-lineFFmpegRTMPRTSPVLC
Open Source Tech Hub
Written by

Open Source Tech Hub

Sharing cutting-edge internet technologies and practical AI resources.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.