Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Debian for my home-server, which is a machine that lives under the telly in the living room and stores the family's photo's, videos, music, etc. I'm using all the usual services to serve these up to whoever deserves them, and it all works. So far so good.

Can't get my kids to use things like ftp or even email, to them "the internetz" means a web browser. Firefox usually. So i'm using apache2 to serve cgi pages generated from code compiled by me written in C. And that all works.

So I want to be able to stream the music, films, television recordings, etc. to web browsers, and despite the emergence of the media tag in html5, flash is still really the only practical solution that actually works.

I've been able to get a cgi program to convert mp3's, avi's and suchlike to flash as flv files using ffmpeg, on demand from the user, stored in a temporary file under DOCUMENT_ROOT and the browser will play them, and that works. e.g:

ffmpeg -i "/home/media/Audio/Music Videos/Kylie Minogue - Come Into My World.mpg" -sameq -ab 32k -ar 22050 -ac 2 -s 320x240 -f flv -y ../tmp/file9ltYxj.flv

Okay, so there's no accounting for taste - look i'm heavy metal but this vid is a work of genius! :-) But it's not ideal, for one thing it takes up space creating all these tmp files and for another calling ffmpeg to perform the conversion causes the page load to hang while it completes the task. Which is okay for a five minute music video, but i doubt firefox will wait for a two hour movie to convert using this method.

So i want to stream them instead using ffstream. I'm executing this line (as root):

ffserver -d -f /etc/ffserver.conf &

and the cgi executes this:

ffmpeg -i "/home/media/Audio/Music Videos/Kylie Minogue - Come Into My World.mpg" -sameq -ab 32k -ar 22050 -ac 2 -s 320x240 -f flv -y http://localhost:8090/feed1.flv

and this is where i'm running into trouble. The page loads, the flash embeds but fails to show anything. ffserver reports:

Mon Apr 15 09:29:38 2013 New connection: GET /feed1.flv
Mon Apr 15 09:29:38 2013 - - [GET] "/feed1.flv HTTP/1.1" 404 149

I'm getting 404's, but before I was getting 200's before, not sure why that's changed. But whether 404 or 200, the page is the same; Loaded, but no video stream.

I could really do with somebody to ask me further questions (not sure what to add) and hopefully get me up and running with this, because i've not much hair left and my wife wants me to paint the dining room.

Can anyone please advise where I might be going wrong?

share|improve this question

migrated from Apr 15 '13 at 9:18

This question came from our site for system and network administrators.

Hi, Lee. Anything in a home setting is unfortunately off-topic for ServerFault but would be more suited to SuperUser. You could either edit out the references to "home", re-ask the question on SuperUser, or wait for it to be migrated. – tombull89 Apr 15 '13 at 9:02
Oh, sorry. I'm new and didn't know there was a distinction. When i was taught networking, a server is anything that serves a client. My machine, by that definition, falls into that category. But i'm not gonna argue - migrate me please :-) – Lee Apr 15 '13 at 9:09

In your case FFmpeg must provide the output file as a stream file, since otherwise your file isn't ready yet for streaming. This is usually done using the FFM format:

ffmpeg -i "/home/media/Audio/Music Videos/Kylie Minogue - Come Into My World.mpg" -ab 32k -ar 22050 -ac 2 -s 320x240 -y http://localhost:8090/feed1.ffm

Then in your server.conf file you can stream the FFM feed to an FLV:

<Feed feed1.ffm>
    File /feed1.ffm

<Stream feed1.flv>
    Feed feed1.ffm
share|improve this answer
Thanks for paying attention evilsoup, I didn't mention it since it was not important for the answer of the question, but I edited it. – Nick van Tilborg Apr 15 '13 at 13:40
Now that you've corected that, +1! – evilsoup Apr 15 '13 at 13:44
Thanks, evilsoup. In my defense, i had read somewhere that it /did/ mean "same quality" and had no reason to assume otherwise. I've read the link and understood. I shan't use it anymore. – Lee Apr 15 '13 at 13:56
Nick van Tilborg - thankyou also, I feel that's made some progress. I'm getting 200's now, which is obviously better. Unfortunately, i'm still not seeing anything on the page though. Just the flash player (OSplayer) "Loading" and revolving dots. Got any idea where i shoudl look next? – Lee Apr 15 '13 at 13:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .