<div>Hi Ronald,</div>
<div>&nbsp;</div>
<div>I added the following line to gstffmpegenc.c on your advice:</div>
<div>ffmpegenc-&gt;context-&gt;flags |= CODEC_FLAG_GLOBAL_HEADER;</div>
<div>&nbsp;</div>
<div>Have I done what you meant?</div>
<div>&nbsp;</div>
<div>I also changed the caps of mp4 to accept audio/AMR. After I encode with ffenc_mpeg4 and amrnbenc, and mux is, the output file behaviour is as follows:</div>
<div>&nbsp;</div>
<div>Muxer: ffmux_mp4. When I play using gst-launch playbin, I get the audio but not the video. When I play in VLC player, I get the video but not the audio (thats maybe because VLC player does not support AMR?). When I play using quicktime, I get Error -2010: The input file contains some invalid data. When I open using mp4UI, it is able to detect it as a valid mp4 file with an audio and a video track, of which it recognizes the video track to be of MPEG-4 Video but cannot recognize the auido format (maybe it does not know about AMR).
</div>
<div>&nbsp;</div>
<div>Muxer: ffmux_mov. With&nbsp;gst-launch playbin and VLC player, the output is the same as above. When I play using quicktime, a screen of the same size as the video opens up, but there is no video; I do get to hear the audio, however. And of course, mp4UI cannot&nbsp;open the mov file because it is not exactly a mp4 file.&nbsp;
</div>
<div>&nbsp;</div>
<div>Any idea of what's happening? I'm totally confused.</div>
<div>&nbsp;</div>
<div>And yes, players that are able to open the above files show the duration of the audio as 2 mins 54 secs and&nbsp;video as 3 secs, which is correct.<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 11/8/06, <b class="gmail_sendername">Ronald S. Bultje</b> &lt;<a href="mailto:rbultje@ronald.bitfreak.net">rbultje@ronald.bitfreak.net</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">On Wed, 2006-11-08 at 06:23 -0800, Deeptendu Bikash wrote:<br>&gt; I found out that my pipeline was actually muxing both audio and video,
<br>&gt; despite gstreamer giving that error. Also gstreamer playbin itself was not<br>&gt; capable of playing the movie. VLC player could play it, though it got the<br>&gt; duration wrong. Quicktime could not play it. So I guess it again boils down
<br>&gt; to the bug/s in ffmpeg regarding handling audio duration which we discussed<br>&gt; in another mail thread. So let me start looking into it.<br><br>You need to set the global header flag in the AVCodecContext of<br>
ffenc_mpeg4 for Quicktime to play it back. Without it, ffmpeg doesn't<br>write the esds atom, which makes the MPEG-4 stream embeddable in .avi,<br>for example (e.g. divx). However, Quicktime doesn't eat MPEG-4 without<br>
global headers (esds atoms).<br><br>You can autodetect this by seeing whether the caps of the output video<br>(in ffenc_mpeg4) is video/x-divx or video/mpeg,mpegversion=4. With that<br>flag set, Quicktime will be able to play back the resulting stream also
<br>(I confirmed this with the 0.8 version, it shouldn't differ nowadays in<br>0.10).<br><br>Ronald<br><br></blockquote></div><br>