tags:

views:

492

answers:

1

Hello everyone,

I am writing a video streaming server application. I have an avi file and I put it on IIS 7 for streaming. And find I cannot jump to an arbitrary location of the media if the media is not buffered already. I think some meta-data is missing during recording? After some search work, I think it may be caused by the index block of avi file is stored at the end, so Windows Media Player could not jump to any arbitrary location before buffered locally.

Here is an example, if my recorded avi video is 10 mins, and now I am playing to the 4th mins, and the local buffered streaming media is buffered to the 5th mins, I cannot jump to any time after the 5th mins, like the 7th mins in Windows Media Player.

BTW: other formats like asf/wmv did not have the same issue on the same server, so I think it should be an issue related to avi file, not server or environmental issues.

My questions are,

  1. What is the actual cause of this issue -- can not jump to arbitrary location before buffered for avi file?
  2. Any solutions or walkarounds? Like some smarter players instead or add some code fix at server side?

thanks in advance, George

+1  A: 

As you already discovered yourself, index is written at the end of avi containers. That's why avi format is not good for streaming.

You should convert your video to some other format which has the indexing information at the beginning. For example, flv, wmv, ogg/theora, etc.

Milan Babuškov
Hi Milan, conversion is too slow... Do you have any ideas to speed up? I have a video of 30mins, and it takes 20 mins to convert to flv. My computer is powerful, 4G RAM and 2 CPUs. Input avi file size is about 150M Bytes.
George2
@Milan, sorry another question. If you think converting to other format like flv/wmv is the best solution, could you recommend some video conversion solutions, like H/W? I think using CPU to convert video is really slow... :-)
George2
Well, if you want to keep the quality, it has to take the time. It would be best if you had some non-lossy source before it was in avi format. For encoding/recoding I use mencoder and ffmpeg programs, but there are many of them out there. Maybe you should post a separate question about this.
Milan Babuškov
Hi Milan, 1. "Well, if you want to keep the quality, it has to take the time." -- I do not need quality, I just need to speed-up encoding process as fast as possible. Do you have any advice?
George2
2. " It would be best if you had some non-lossy source before it was in avi format" -- I am using Camtasia to record screen for a Demo, I think in this case there is no non-lossy source, correct?
George2
Maybe you could convert the video from AVI to ASF format using a simple copy (i.e. the content is the same, but container changes). Try this program for example: http://www.videohelp.com/tools/MediaCoder
Milan Babuškov
Great idea Milan! I have downloaded and installed MediaCoder, but (I am a new user) I did not find an option for me to copy from avi to asf. Could you show me more instructions?
George2
Perhaps you would get more answers asking at a forum specialized for this. SO is only about programming, after all. Try here: http://www.videohelp.com
Milan Babuškov
Thanks Milan, I have found this videohelp forum quite useful.
George2
@Milan, I have started a new topic as you suggested above to discuss further new topic, if you have expertise, please help here,http://stackoverflow.com/questions/743429/codes-to-convert-from-avi-to-asf
George2