About a month ago I posted on here asking for ideas on how to get the flash player in mythweb to stream content. I didn&#39;t get much of a response, and I guess I wasn&#39;t really clear about what I was trying to do. I was not trying to implement pseudostreaming, but merely trying to get the player to give the same behavior as a normal progressively downloaded flash video. When I would watch a video if I wanted to go back a few seconds it would cause the entire video to start over. I&#39;m pleased to say that I&#39;ve got a fix working so that this doesn&#39;t happen. Unfortunately, it wasn&#39;t just a patch to mythtv, I also needed to patch ffmpeg to get it working. This fix allows you to seek anywhere in the part of the video that has already been downloaded from the server. There were two things required:<br>

1) ffmpeg had to write the duration header tag in the flv BEFORE it wrote the entire file. To do this, I guessed that the resulting transcode would be the same duration as the input file. I left the code that sets the duration after the transcode finishes so that if this guess isn&#39;t right, it gets overwritten. This might have screwed up how ffmpeg handles other files, but I don&#39;t use ffmpeg for anything else so I don&#39;t really know.<br>

2) The content-length http header had to be sent. To do this, I (again) guessed at what the final filesize would by by taking the average audio and video bitrates and multiplying by the above duration of the video. This works well, but isn&#39;t perfect as the resulting file is usually smaller than this amount. If anyone know of a better way of doing this please let me know.<br>

<br>I&#39;d appreciate if people could test out my code and give me some feedback. I&#39;ve posted it here: <a href="http://netfiles.uiuc.edu/jjohns63/www/ffmpeg.diff">http://netfiles.uiuc.edu/jjohns63/www/ffmpeg.diff</a> and here: <a href="http://netfiles.uiuc.edu/jjohns63/www/stream_flv.pl.diff">http://netfiles.uiuc.edu/jjohns63/www/stream_flv.pl.diff</a><br>

<br>You need to patch the /mythweb/modules/stream/<a href="http://stream_flv.pl">stream_flv.pl</a> file in your /var/www directory. Also ffmpeg must be patched, both ffmpeg.c and libavformats/flvenc.c. In the new <a href="http://stream_flv.pl">stream_flv.pl</a> you should set the $ffmpeg value on the first line to the directory of your patched ffmpeg.<br clear="all">

--Justin Johnson<br><br>