<div dir="ltr">
<div>
Hi guys, <br></div><div>I am having some trouble working with the ffmpeg's API while porting from the 0.6 version (32 bit) to the 4.x (both 4.3.2 and 4.4) version 64 bit. (I know, big leap, but nothing I can do about it :-( )<br><br>Specifically, I am having trouble with the MDAT atom, which as I understand should be written by the <i>av_write_trailer </i>function and should indicate the size of the video data. Conseguentely I fail to write the MOOV atom and the file is unreadable.<br><br>Some context: the file is streamed from a proprietary server and it is played in the application (this part works).</div><div>While streaming I also save it to a file with <i>av_read_frame/av_write_frame</i> functions after having called <i>avformat_write_header</i>. When I write the last frame I call the <i>av_write_trailer </i>function and close all the contexts/codecs.<br>After that, using the (modified version of) qt-faststart tool I try to move the MOOV atom at the beginning, to write a cached file which can be played without the need to stream it again, but I get the first 4 bytes of the MDAT atom filled with 0's, which indicate that the MDAT size is 0, while the file in this case is little more 100 Mb, so I expect a size of about 100 Mb. <br></div><div>At this point the program enter in a infinite loop, reading continuously the MDAT atom.<br><br>I tried to debug the code in parallel with the version which work (ffmpeg 0.6 32 bit) and it seems that they do the same things at every step, aside the modifications I needed to compile with the new version. No call to the library functions return an error, which is what it is baffling me.<br><br>Any idea about what can be the problem ?<br>Or, if this is not the right place to ask, any pointer to some documentation (aside the official's one that I have already combed through)<br><br>Thanks</div><div>Gianluca<br></div></div>