<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-2022-jp">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"MS PGothic";
        panose-1:2 11 6 0 7 2 5 8 2 4;}
@font-face
        {font-family:"\@MS PGothic";}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"MS PGothic",sans-serif;
        mso-fareast-language:JA;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"MS PGothic",sans-serif;
        mso-fareast-language:JA;}
span.E-MailFormatvorlage18
        {mso-style-type:personal-reply;
        font-family:"Arial",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="DE" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US">Hi, fwiw,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US">as far as the other critic made by gotsring, that MP4 files have the problem that the header block is written to the end of the file so
 if the end is not written, the file is unplayable, can be counteracted by moving the header to the front. This can only be done if you know how large the recording is going to be, because you have to reserve space at the start of the file. This can be done
 by using the following mp4muxer parameters<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US">    g_object_set(G_OBJECT(pPrimaryMuxer), "reserved-max-duration", reservedMaxDuration, static_cast<char *>(nullptr));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US">    g_object_set(G_OBJECT(pPrimaryMuxer), "reserved-moov-update-period", 5000000000UL, static_cast<char *>(nullptr)); // 5 seconds<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US">    g_object_set(G_OBJECT(pPrimaryMuxer), "reserved-bytes-per-sec", 600UL, static_cast<char *>(nullptr));<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US">Gruesse<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Arial",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org>
<b>Im Auftrag von </b>Psychesnet Hsieh<br>
<b>Gesendet:</b> Dienstag, 28. Juli 2020 09:16<br>
<b>An:</b> Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org><br>
<b>Betreff:</b> Re: How to make/fix mp4 file can be play on vlc?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi gotsring,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I figure out the problem.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Pipeline need h264parse to convert byte-stream to avc and mp4mux can mix H264 frames as mp4 file.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks a lot.<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Psychesnet Hsieh <<a href="mailto:psychesnet@gmail.com">psychesnet@gmail.com</a>>
<span lang="JA">$B1w(B</span> 2020<span lang="JA">$BG/(B</span>7<span lang="JA">$B7n(B</span>28<span lang="JA">$BF|(B $B=5Fs(B $B>e8a(B</span>9:31<span lang="JA">$BUmF;!'(B</span><o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<p class="MsoNormal">Hi gotsring,<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks for the reply.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Our platform did not support MKV mux module on gstreamer component. So, I still need to work on mp4mux.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I double check the option of '-e' from tools/gst-launch.c and I add following code to my testing tool.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">1. The duration of mp4 file is over 10 sec, we will send EOS event.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>if (((hdr->fpts.tv_sec - app->first_pts.tv_sec >= 10) && (hdr->fpts.tv_usec >= app->first_pts.tv_usec)) ||</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>            hdr->fpts.tv_sec - app->first_pts.tv_sec > 10)) {<br>
              ok = FALSE;<br>
}</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>.....</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>if (ok == FALSE) {</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>         GST_INFO("send EOS event\n");<br>
        gst_element_send_event(app->pipeline, gst_event_new_eos());<br>
}</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">2. At message part, when we recv EOS, we will do stop loop.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>        case GST_MESSAGE_EOS: {<br>
                                 g_printerr("recv EOS msg\n");<br>
                                 g_main_loop_quit (app->loop);<br>
                                 break;</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>                              }</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">3. Double check the log from testing tool, testing tool did send EOS to pipeline.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><i>0:00:09.650924349  1255      0x3611e00 INFO         appsrc-pipeline ringbuf_appsrc.cpp:77:read_data: send EOS event<br>
<br>
0:00:09.653614066  1255      0x36b10a0 INFO                    task gsttask.c:312:gst_task_func:<ringbuf:src> Task going to paused<br>
0:00:09.653862576  1255      0x36b10a0 INFO                    task gsttask.c:314:gst_task_func:<ringbuf:src> Task resume from paused<br>
0:00:09.654003645  1255      0x36b10a0 INFO                 basesrc gstbasesrc.c:2854:gst_base_src_loop:<ringbuf> pausing after gst_base_src_get_range() = eos<br>
0:00:09.654223941  1255      0x36b10a0 INFO                    task gsttask.c:312:gst_task_func:<ringbuf:src> Task going to paused<br>
0:00:09.654832350  1255      0x3611e00 INFO         appsrc-pipeline ringbuf_appsrc.cpp:108:bus_message: got message eos<br>
recv EOS msg<br>
0:00:10.655268590  1255      0x3611e00 INFO         appsrc-pipeline ringbuf_appsrc.cpp:215:main: stopping</i><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Add above code, mp4 file still not working on VLC player.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Please provide advise to fix it. Thanks.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">gotsring <<a href="mailto:gotsring@live.com" target="_blank">gotsring@live.com</a>>
<span lang="JA">$B1w(B</span> 2020<span lang="JA">$BG/(B</span>7<span lang="JA">$B7n(B</span>28<span lang="JA">$BF|(B $B=5Fs(B $B>e8a(B</span>3:07<span lang="JA">$BUmF;!'(B</span><o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">Are you finalizing the MP4 file? This is done by sending an EOS signal<br>
through the pipeline. For the gst-launch command-line tool, just add -e in<br>
the options, like<br>
gst-launch-1.0 -e appsrc name=ringbuf ! mp4mux ! filesink<br>
location=/tmp/opt/h264.mp4<br>
<br>
On a side note, I prefer MKV containers instead of MP4 because they tend to<br>
be more resistant to errors. If you don't finalize an MKV file, you can<br>
still play the video, scrubbing or other metadata isn't available. If you<br>
don't finalize the MP4 file, the file is unplayable. MKV files can still<br>
play in VLC, so you'd be good there. <br>
<br>
Example:<br>
gst-launch-1.0 -e appsrc name=ringbuf ! matroskamux ! filesink<br>
location=/tmp/opt/h264.mkv<br>
<br>
You might need a parser right before the matroskamux, like h264parse.<br>
<br>
<br>
<br>
--<br>
Sent from: <a href="https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fgstreamer-devel.966125.n4.nabble.com%2F&data=02%7C01%7C%7C48e3d494b40e470b96a308d832d0832b%7C28042244bb514cd680347776fa3703e8%7C1%7C0%7C637315218419022433&sdata=GHYzMHFWuRTfuPSpz6hPPfmUG%2FCdLaJgyh%2BYLX4svRA%3D&reserved=0" target="_blank">
http://gstreamer-devel.966125.n4.nabble.com/</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Fgstreamer-devel&data=02%7C01%7C%7C48e3d494b40e470b96a308d832d0832b%7C28042244bb514cd680347776fa3703e8%7C1%7C0%7C637315218419032396&sdata=f3Ufu7bxdb6das7Dip2I9OA38yhStWsgFyLi5ttqLRY%3D&reserved=0" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><o:p></o:p></p>
</blockquote>
</div>
</blockquote>
</div>
</div>
</body>
</html>