• Skip to Search
  • Skip to Content
  • Skip to Side Navigation
Getting StartedSDK ReferenceGlossary
  • Home
  • Getting Started
  • SDK Reference
  • Portal
  • How-To
  • Troubleshooting
  • FAQs
  • Reference
  • Glossary
How-To Guides
  • API Usage
  • Artificially lower bandwidth or bitrate
  • Set up publishing or subscribing for only audio or only video
  • Set up High Availability
  • Optimal RTMP encoder settings
  • How do I find my stream key?
  • Preventing stream sharing
  • Debug tokens in the Portal
  • Display multiple copies of the same stream
  • Find the video dimension of the stream
  • Measure timing
  • Create test input
  • Verify encoder ability to contribute via UDP
  • Manage issues with installing Phenix SDKs
  • RTSP ingest from IP cameras
  • Work with timestamps in reports
  • How do I deal with corporate firewalls?
  • How do I record streams for VOD playback?
  • How do I set up ad insertion?
  • How do closed captions work in the Phenix system?
  • How do I set up and use SRT Ingest?
  • How do I set up and use RTMP Ingest?
  • How do I set up and use replay?

How to use FFmpeg to create test input

A useful tool in many situations is FFmpeg. Documentation on using FFmpeg is available at the FFmpeg wiki.

Create an MPEG-TS feed on a port

The following is a recipe for creating an MPEG Transport Stream (TS) feed on a port, where <mp4 video file> is the file to be used as a video source:

cURL
1$ ffmpeg -nostdin -re -stream_loop -1 -i ~/encoder/data/<mp4 video file> \
2 -c copy -f mpegts 'udp://127.0.0.1:1234' > logile.txt 2>&1 &

The above command can be executed in foreground or background.

FFmpeg opens sockets for STDIN, STDOUT, and STDERR by default. If the STDIN isn't disabled with -nostdin a background FFmpeg process will stall on socket reads from STDIN and the video will not display.

Static image with a timecode (counter, not clock)

The following is a recipe for creating a static image video with a timecode counting up from 00:00:00:00 (HH:MM:SS:FF), where r is the framerate and <rtmp URL> is the destination URL of the video stream.

cURL
1$ ffmpeg -loop 1 -i image.png -vf drawtext="fontfile=/Library/Fonts/Arial.ttf: \
2timecode='00\:00\:00\:00': r=30: fontcolor=white: \
3fontsize=24: box=1: boxcolor=black@0.5: \
4boxborderw=5: x=(w-text_w)/2: y=(h-text_h)/2" \
5-f flv <rtmp URL>

The "image.png" input in the above argument must be appropriately sized for the video being fed. That is, the dimensions must equal the video resolution.

Larger font sizes may be desired for higher resolutions.

For example, using an image file that is 480 x 720, the result will appear similar to the following at one hour, 10 minutes, 37 seconds, and 9 frames:

videoCounterExample

Page Content
    Copyright 2023 © Phenix RTS
    Privacy Policy | Terms of Service
    v2023-01-31T21:25:10