Hi Arnout,<br><br>Thanks for the reply and the information about the possible solutions.<br><br>I would be greatful if you can tell me more about the index.<br>As of my knowledge the index has the info on the number of <br>
audio and video streams in media stream, with their proprties (like <br>width & height of a video stream). If I am not wrong the "av_write_trailer" <br>function in gstffmpegmux.c helps writing the index in muxers.<br>
<br>Now if I am opting fourth option can I parse whole file. As <br>the incoming data is from live source, and the duration is not known.<br>Can you hint me on how do I build index ?<br><br>Thanks.<br><br><br><div class="gmail_quote">
On Wed, May 13, 2009 at 8:15 PM, Arnout Vandecappelle <span dir="ltr"><<a href="mailto:arnout@mind.be">arnout@mind.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Accessing a file while it is being written is as such not a problem.<br>
However, there's no index yet at that point, and also some of the headers<br>
(e.g. duration) may not be filled in.<br>
<br>
Sending an EOS doesn't solve the issue here, because you'd either have a file<br>
which contains multiple indices (probably not a legal file), or you'd<br>
overwrite the index immediately while recording continues and end up reading<br>
a corrupted index.<br>
<br>
The solution is for your reading application to somehow support the case<br>
where the file doesn't have an index yet. When I had this problem, I<br>
considered four solutions:<br>
- make sure the writer and reader are in the same GStreamer process, and<br>
somehow share the index being built up in the muxer element with the reader;<br>
- write the index to a separate file while it is built up, and let the reader<br>
read from this file;<br>
- make sure the reader doesn't need an index, i.e. convert time-based seeking<br>
into bytes-based seeking using some binary search approach;<br>
- make the reader build an index while it is reading - for forward seeking<br>
that means the whole file has to be parsed (but not decoded), obviously.<br>
<br>
In my case, I choose the third option because I didn't need to do actual<br>
demuxing so I could easily write a custom stream parser.<br>
<br>
Unfortunately, all four solutions require changes in the muxer/demuxer<br>
elements - it simply cannot be solved as a separate element. My guess is<br>
that the fourth option is the easiest to implement in a demuxer.<br>
<br>
Regards,<br>
Arnout<br>
<div><div></div><div class="h5"><br>
On Tuesday 12 May 2009 06:39:58 Jyoti wrote:<br>
> Hi all,<br>
><br>
> I am currently writing an application to save data from a live source<br>
> into file. The server streams a file RTP payloaded H.264 video packets<br>
> and AAC audio packets on separate ports. The reciever receives the<br>
> data and saves it into a file. I could save the file properly.<br>
><br>
> But now my problem is I want to do trickmode operations on this file even<br>
> when it is downloading(while the file is still been written on client<br>
> side). Currently I have written separate application to do trickmode<br>
> opearations on a file. But when I do trickmode operations on the file which<br>
> is still writing contents in to it, the pipeline gets into ASYNC state &<br>
> when the application is forceably closed the qtdemuxer throws an error.<br>
><br>
> One thing I thought is to send an EOS for every 5 secs on the client side<br>
> while writing data into file. So that the muxer gracefully writes the<br>
> proper data after EOS and the chunk of data can be considered for<br>
> trickmode. But after sending the first EOS I can't set pipeline to any<br>
> state and the data flow on pad is stopped.<br>
><br>
> I would be very thankful if anyone could just tell me<br>
> * how can I access the file even when its writing.<br>
> * Or in any way can I start the data flow even after sending EOS?<br>
><br>
> Thanks in advance.<br>
<br>
<br>
<br>
</div></div>--<br>
Arnout Vandecappelle arnout at mind be<br>
Senior Embedded Software Architect +32-16-286540<br>
Essensium/Mind <a href="http://www.mind.be" target="_blank">http://www.mind.be</a><br>
G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven<br>
LinkedIn profile: <a href="http://www.linkedin.com/in/arnoutvandecappelle" target="_blank">http://www.linkedin.com/in/arnoutvandecappelle</a><br>
GPG fingerprint: D206 D44B 5155 DF98 550D 3F2A 2213 88AA A1C7 C933<br>
<br>
------------------------------------------------------------------------------<br>
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your<br>
production scanning environment may not be a perfect world - but thanks to<br>
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700<br>
Series Scanner you'll get full speed at 300 dpi even with all image<br>
processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</blockquote></div><br>