February 1, 2005
Streaming video for free
Recently, I spent a lot of time struggling to get streaming video working properly for my wedding video. I wanted it to be good quality, high compression, require no special software to view, and be accomplished by me using only freely available software. It took me a while to figure out a solution that satisfied all these goals, but I was eventually successful. In the end, I used:
- Darwin Streaming Server (for streaming)
- mencoder (for encoding video)
- faac (for encoding audio)
- mp4creator from MPEG4IP (for multiplexing the stream)
Recent versions of Quicktime player support the MPEG4 format, the new standard for low-bitrate video. This means I could use Darwin streaming server to stream it, and Windows and Mac OSX users can use Quicktime and the associated browser plugin to view it (which most people already have installed). Windows Media Player does not yet seem up to the task of playing standard MPEG4, but hopefully that will come soon.
Once I found the various tools, encoding the video from high-bitrate MPEG2 (coming straight from our DVD master) into MPEG4 was relatively easy. For reference, here is the exact sequence of commands.
stream.mpg is the input MPEG2 video and
wedding_hi.mp4 is the output video that I simply dropped into Darwin Streaming Server's movie directory.
mencoder stream.mpg -vf kerndeint,scale=480:360 -ovc lavc -lavcopts \ vcodec=mpeg4:vbitrate=600:vhq:v4mv:keyint=132:vpass=1 -nosound \ -frames 143250 -o newstream_hi.avi mencoder stream.mpg -vf kerndeint,scale=480:360 -ovc lavc -lavcopts \ vcodec=mpeg4:vbitrate=600:vhq:v4mv:keyint=132:vpass=2 -nosound \ -frames 143250 -o newstream_hi.avi ffmpeg -i stream.mpg -vn -f wav out.wav -t 01:19:39.78 faac --mpeg-vers 4 --tns -o out_hi.aac out.wav mp4creator -c newstream_hi.avi -hint wedding_hi.mp4 mp4creator -c out_hi.aac -hint -interleave wedding_hi.mp4 mp4creator -optimize wedding_hi.mp4
I used two-pass encoding with mencoder for maximum quality, but that is optional. Also, you'll note that I needed to trim some garbage from the end of the source video, so the commands to ffmpeg and mencoder use the 'frames' and 't' arguments to restrict the length of the input.
There's also a very complete guide to creating MPEG4 content here.
Posted by davemoore at February 1, 2005 8:40 PM
I have one question. please help me.
1. Install DarwinStreamingSrvr126.96.36.199-Linux.
2. I can see rtsp://SERVER-IP/sample_100kbit.mov on Quicktime Player
3. but I cannot see sample_100kbit.mov on quicktime player in another computer.
"406 Not Acceptable" in player status bar.
4. streamingserver.xml file, maximum_connections value is '100'.
How can i set my darwin streaming server?
Posted by: synec! at May 16, 2005 4:55 PM
My guess is that one of two things is happening:
1. Your client computer has a version of quicktime player that is too old.
2. You are behind a firewall that is altering or blocking the request.
Posted by: davemoore at May 16, 2005 5:28 PM
Thanks for your answer.
Quicktime player version is 6.5.2 on PC1, PC2.
and firewall set allow tcp/udp any-ip any-port.
PC1, PC2 are different ISP.
Server OS: Redhat 9
I can see stream mov file on PC1. but can't see same stream mov file on PC2. (406: Not Acceptavle)
Do you check my DSS conf files?
0eb317f5877eef5c8c5c37cd440b5025*.html is VOD web page
Posted by: synec! at May 17, 2005 4:22 AM
I have the answer now.
Runnig DSS, Apache in my vod server.
some client request rtsp://188.8.131.52/sample.mp4 then answered by apache.... so, quicktime showing error code. ;)
Rhee Jong Ho
Posted by: synec! at May 20, 2005 2:25 PM
i had a question .
i had a file in .avi format .I want to make it in mp4 format, hint it and stream it using DSS.
i have done that using the command given below . but DSS gives error :
There is (1) movie in the Playlist.
Ref Movie = /mnt/hdb3/movies/RoninComing_Soon.mp4
SDP file = /var/streaming/playlists/r/r.sdp
- Movie set up failed: Movie file does not match SDP.
(file: /mnt/hdb3/movies/RoninComing_Soon.mp4 err: 16 Movie file does not match SDP.)
- PlaylistBroadcaster found one problem movie file.
There are no valid movies to play
PlaylistBroadcaster preflight finished.
Here are the commands i used for encoding ,hiting steps.
ffmpeg -i RoninComing_Soon.avi -vn RoninComing_Soon_audio.wav
ffmpeg -i RoninComing_Soon.avi -an -vcodec mpeg4 RoninComing_Soon_rvideo.avi
avi2raw RoninComing_Soon_rvideo.avi RoninComing_Soon.mp4v
mp4creator -create RoninComing_Soon.mp4v -hint -rate 25 RoninComing_Soon.mp4
mp4creator -create RoninComing_Soon_audio.aac -hint -I RoninComing_Soon.mp4
mp4creator -optimize RoninComing_Soon.mp4
And here is the track created in the mp4 file.
mp4info version 1.2
Track Type Info
1 video MPEG-4 Simple @ L1, 360.000 secs, 173 kbps, 320x240 @ 25.00 fps
2 hint Payload MP4V-ES for track 1
3 audio MPEG-2 AAC LC, 300.326 secs, 58 kbps, 44100 Hz
4 hint Payload mpeg4-generic for track 3
5 od Object Descriptors
6 scene BIFS
Metadata Tool: mp4creator 1.2
on placing the file in playlist of DSS and playing it it gives error as written above .
I have been searching for the soloution for over one week now , using google and source forge forum for mpeg4ip and apple forum too.havent find any specific answere yet.
Posted by: nido at July 7, 2005 3:18 AM
I could use some help from anyone. I just installed Darwin Streaming Server 5.5 on Linux (Apache Server). After 5 installs I finally got the admin page to open and I could change the settings but I could not get any of the sample files to stream. I shouldn't have any firewall issues because I opened the firewall to tcp and udp connections.
Each time I open Quicktime 7.0.2 and call the url for any streaming file I get a 406 Not Acceptable error.
I've looked all over the internet, google, apple's docs, etc.. trying to resolve this.
After I got the DSS Admin started I still could not get the streaming to work so I rebooted the server itself. This turned off the DSS streaming server off. I tried to turn it back on and it appeared to be successful but when I try to get back into the admin section for DSS Streaming Server my web browser just searches in an infinite loop.
Does anyone have any ideas?
Posted by: CAP at September 14, 2005 1:59 PM
Post a comment
Thanks for signing in, . Now you can comment. (sign out)(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)