[application] is the name of your Wowza Streaming Engine application (such as live or vod).

[stream-name] is the name of the stream in the Wowza Streaming Engine application.

Other useful FFmpeg commands

List available devices

Get a list of available hardware devices, such as webcams and microphones:

ffmpeg -list_devices true -f dshow -i dummy

Convert .ts source files to .mp4

Convert a .ts file (or any FFmpeg-compatible source) to as .mp4 for VOD playback with Wowza Streaming Engine:

ffmpeg -i input.ts -c:vcopy -c:a copy output.mp4

Synchronize audio and video that start at different timecodes

Wowza Streaming Engine doesn't use the edit lists that some video recorders use to synchronize audio and video in a .mp4 or .mov container when the audio and video start at different timecodes. Instead, the following FFmpeg commands create separate audio and video renditions of the file in .mkv format and remove a specified number of seconds, in this case 4, from the beginning of the file. Then, the video and audio files are remuxed to create an .mp4 file that is, in this example, 5 seconds shorter. Adjust the number of seconds removed from the file as needed to synchronize your audio and video.

Analyze an FFmpeg stream using logs and FFprobe

You can study a Wowza Streaming Engine access log file to see how your stream is encoding. A bad keyframe interval can cause the length of chunks (segments) to vary, which can lead to client buffering and connection timeouts.

Here's an example from a Wowza Streaming Engine access log file that shows a healthy Apple HLS stream. This particular stream has a frame rate is 29.970 fps with a 2-second GOP.

How can you tell the stream is healthy? First, the segments are within 1 ms of being the same length. Although the first segment is slightly shorter, typically if the first timecode in the live stream isn't zero, which would account for the discrepancy. This is expected behavior, but in some edge cases it may cause an issue with the player reconnecting when the stream first starts.

In addition, the GOP (the number of video frames divided by the number of keyframes) is consistently 60. Due to the nature of a noninteger-based GOP there will be some variance in the number of frames in the live stream.

Not only do the segment lengths vary from 9810 ms to 11478 ms but the group of pictures also varies greatly, from 60 for the first segment to 24.75 for the last. As a result, players may disconnect or buffer out. And if the keyframes don't align, players will be unable to switch to a different resolution.

In addition to using logs to assess an FFmpeg live encode, you can analyze it using FFprobe.

Save a live stream as .mp4

Save a minute or more of a live stream from Wowza Streaming Engine as a .mp4 file to run through FFprobe:

Thank you for providing feedback to help us improve our documentation!

If you need immediate help for an urgent issue, open a support ticket to get help from one of our technical support engineers. (You must have a valid Maintenance and Support contract to get technical support.)