Wowza Community

Streaming a partially transcoded file

My organization is using Wowza to DASH stream VOD files, but I learned recently that the files are not necessarily H.264 encoded (many of them are mjpeg, which I understand is unsupported even by Wowza’s own live transcoder). Right now we’re using avconv/ffmpeg to transcode non-H.264 files so they are streamable, but in these cases the video client cannot play the video because transcoding takes a minute or two for larger files. In brainstorming solutions I realized that if Wowza were able to begin streaming the files before transcoding completed, the client would potentially only have to wait a few seconds before it could begin streaming, which I think would be acceptable.

Thus, my question is: Is there any way to stream a file while it is in the process of being transcoded using Wowza’s tools, without having to wait for transcoding to complete?

MP4 VOD files must contain what is called a moov atom which is not written to the file until it has finished being converted. Without the moov atom the MP4 file will be unplayable.

You can use the source mjpeg file for pseudo live streaming on the fly while the source file is being converted. Note that you will need to adjust the command line examples below extensively to accommodate the content that you are receiving and then broadcasting.

For Windows:

ffmpeg.exe -re -i inputfile.mp4 -pix_fmt yuv420p -vsync 1 -vcodec libx264 -r 23.976 -threads 0 -b:v: 1024k -bufsize 1024k -maxrate 1024k -minrate 1024k -preset veryfast -profile:v baseline -tune film -g 48 -x264opts no-scenecut:ratetol=0.01 -acodec aac -b:a 192k -ac 2 -ar 48000 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -f flv "rtmp://192.168.1.2:1935/live/myStream flashver=FMLE/3.0\20(compatible;\20FMSc/1.0) live=true pubUser=username pubPasswd=password"

For Linux:

ffmpeg -re -i inputfile.mp4 -pix_fmt yuv420p -vsync 1 -vcodec 
libx264 -r 23.976 -threads 0 -b:v: 1024k -bufsize 1024k -maxrate 1024k 
-minrate 1024k -preset veryfast -profile:v baseline -tune film -g 48 
-x264opts no-scenecut:ratetol=0.01 -acodec aac -b:a 192k -ac 2 -ar 48000
 -af "aresample=async=1:min_hard_comp=0.100000:first_pts=0" -f flv rtmp://username:password@192.168.1.2:1935/live/myStream

I hope that helps to answer your question.

Very helpful, I appreciate the response. One issue I am having is that in the last part of the command ("-f flv rtmp://username:password@192.168.1.2:1935/live/myStream") it appears that you are pushing the stream as rtmp, but what I really need is to push it as a DASH stream. I have tried simply replacing “flv” with “dash” which appears to generate a .mpd file as expected, but I get a 404 error when pointing a browser or player to the .mpd file through my live application.

Are there specific ffmpeg options for preparing DASH streams for Wowza that I should be aware of? I’d like to eliminate as much guesswork as possible. Thanks again!

Wowza Streaming Engine will repacketize an H.264 video with AAC audio stream to the appropriate output protocol regardless if the input is from an RTMP encoder, RTSP encoder, MPEG-TS encoder, or an IP camera using RTSP. The same thing happens with MP4 VOD content.

Excellent, your advice is helping me make a lot of progress. When I use the command you offered, I can see an incoming RTMP stream appear in the Wowza Streaming Manager, but none of the URLs I am trying are working.

I am noticing that when the stream appears in Wowza Streaming Manager, the ‘source’ URL has a different port number each time the stream starts, which makes it impossible to get the correct URL without looking at Wowza Streaming Manager.

In the example you offered, what URL should be provided to a DASH player? Would it be http://192.168.1.2:1935/live/myStream/manifest.mpd?

The URL will be created by the sample player. Please do not edit the URL unless you need to test a different address.

Live URLs are formed as follows:

RTMP: rtmp://[wowza-address]/[application]/[stream-name]

RTSP: rtsp://[wowza-address]/[application]/[stream-name]

HLS: http://[wowza-address]/[application]/[stream-name]/playlist.m3u8

DASH: http://[wowza-address]/[application]/[stream-name]/manifest.mpd

MS Smooth: http://[wowza-address]/[application]/[stream-name]/Manifest

Adobe HDS: http://[wowza-address]/[application]/[stream-name]/manifest.f4m

In your Wowza Streaming Engine we have a sample player that can access the incoming live feed. It supports MPEG-DASH, Apple HLS (If your OS supports it), Adobe RTMP, Adobe HDS, MS Smooth, and several mobile links.

VOD is the same:

RTMP: rtmp://[wowza-address]/[application]/[file-name]

RTSP: rtsp://[wowza-address]/[application]/[file-name]

HLS: http://[wowza-address]/[application]/[file-name]/playlist.m3u8

DASH: http://[wowza-address]/[application]/[file-name]/manifest.mpd

MS Smooth: http://[wowza-address]/[application]/[file-name]/Manifest

Adobe HDS: http://[wowza-address]/[application]/[file-name]/manifest.f4m

Please go to the VOD application in Wowza Streaming Engine Manager, open up the test player and make sure that you can play back the sample content using the protocols shown above.