Creating a local RTMP source
There are several ways to integrate an RTMP source into an Eyeson session.
For production environments, RTMP sources are typically provided by dedicated applications or services. During development, however, a local RTMP source is useful for testing, debugging, and reviewing video layouts without requiring a separate external source.
This guide describes several options for creating a local RTMP source:
- FFmpeg - A lightweight command-line solution
- OBS Studio - A flexible solution for configuring custom scenes and layouts
- Larix Screencaster - A mobile solution for streaming a device screen or camera
FFmpeg source
FFmpeg is a complete, cross-platform solution for recording, converting, and streaming audio and video. When using FFmpeg to capture a camera, you must specify the exact device name as it is registered with your operating system.
1. List Available Devices
Run the appropriate command for your operating system to identify the available hardware devices and their names.
- Windows
- MacOS
- Linux
ffmpeg -list_devices true -f dshow -i dummy
Example response
[in#0 @ 000001e87d428500] "HD Pro Webcam C920" (video)
[in#0 @ 000001e87d428500] Alternative name "@device_pnp_\\?\usb#vid_046d&..."
[in#0 @ 000001e87d428500] "Integrated Webcam" (video)
[in#0 @ 000001e87d428500] Alternative name "@device_pnp_\\?\usb#vid_0c45&..."
[in#0 @ 000001e87d428500] "Microphone (2- Shure MV7)" (audio)
[in#0 @ 000001e87d428500] Alternative name "@device_cm_{33D9A762-90C8-11D..."
ffmpeg -f avfoundation -list_devices true -i ""
Example response
[AVFoundation indev @ 0x7fa2bb4040c0] AVFoundation video devices:
[AVFoundation indev @ 0x7fa2bb4040c0] [0] FaceTime HD Camera
[AVFoundation indev @ 0x7fa2bb4040c0] [1] Capture screen 0
[AVFoundation indev @ 0x7fa2bb4040c0] AVFoundation audio devices:
[AVFoundation indev @ 0x7fa2bb4040c0] [0] Built-in Microphone
v4l2-ctl --list-devices
Example response
Integrated Camera: Integrated C (usb-0000:00:14.0-8):
/dev/video0
/dev/video1
2. Stream Webcam to RTMP Server
After identifying the camera, use the corresponding command for your operating system to publish the video stream to the local RTMP server.
- Windows
- MacOS
- Linux
ffmpeg -f dshow -i video="Integrated Camera" -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -f flv rtmp://127.0.0.1:1935/live/localrtmp
ffmpeg -f avfoundation -framerate 30 -video_size 1280x720 -i "0" -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -f flv rtmp://127.0.0.1:1935/live/localrtmp
ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -i /dev/video0 -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -f flv rtmp://127.0.0.1:1935/live/localrtmp
The following options can be adjusted to control the encoding and streaming behavior:
-preset ultrafast: Reduces CPU usage to the absolute minimum so your computer doesn't lag.-tune zerolatency: Removes any frames-buffering delay. This ensures your local service receives the webcam feed with less than a 1-second delay.-pix_fmt yuv420p: Standardizes the video color pixel format so almost any RTMP engine can decode it without crashing.
3. Including Audio (Optional)
If audio is required, include an audio device in the FFmpeg input and configure the audio codec and bitrate as shown below.
- Windows
- MacOS
- Linux
ffmpeg -f dshow -i video="Integrated Camera":audio="Microphone Name" -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv rtmp://127.0.0.1:1935/live/localrtmp
ffmpeg -f avfoundation -framerate 30 -video_size 1280x720 -i "0:0" -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv rtmp://127.0.0.1:1935/live/localrtmp
ffmpeg -f v4l2 -framerate 30 -video_size 1280x720 -i /dev/video0 -f alsa -i default -c:v libx264 -preset ultrafast -tune zerolatency -pix_fmt yuv420p -c:a aac -b:a 128k -f flv rtmp://127.0.0.1:1935/live/localrtmp
OBS stream
OBS Studio is an open-source application for video recording and live streaming. It provides a convenient interface for configuring scenes and can be used to stream an entire layout or an individual scene directly to a local RTMP endpoint.
- Navigate to Settings > Stream inside OBS Studio.
- Select Custom... from the Service dropdown option menu.
- Configure the destination routing values using the exact strings below:
- Server:
rtmp://127.0.0.1:1935/live(Do not add a trailing slash) - Stream Key:
localrtmp
- Server:
- Click Apply, click OK, and then hit Start Streaming.
If OBS returns a connection error, verify that you are using the explicit IPv4 loopback address 127.0.0.1 rather than localhost to avoid network routing handshake drops.
Larix screen
Larix Broadcaster is a mobile application for iOS and Android that supports streaming a mobile device's screen or camera over RTMP. It is particularly useful for testing remote-device layouts while developing in a local environment.
- Ensure your mobile device is connected to the same local Wi-Fi network as your development computer.
- Find the Local IP Address of your computer (e.g.,
192.168.1.50). By running:
- Windows
- MacOS
- Linux
ipconfig
Look for
Wireless LAN adapter Wi-Fi:
IPv4 Address. . . . . . . . . . . : 192.168.1.50
ifconfig
Look for
en0:
inet 192.168.1.50 netmask 0xffffff00 broadcast 192.168.1.255
ip addr
Look for
inet 192.168.1.50/24 brd 192.168.1.255 scope global
- Open Larix Broadcaster, tap the gear icon to open Settings, and select Connections.
- Create a new connection profile using the target format:
- URL:
rtmp://127.0.0.1:1935/live/localrtmp
- URL:
- Save the profile, return to the main viewfinder interface, and tap the Start button and select an app or entire screen to begin broadcasting.