<html 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=utf-8">
<meta name="Title" content="">
<meta name="Keywords" content="">
<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;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:Calibri;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Calibri;
        color:windowtext;}
span.msoIns
        {mso-style-type:export-only;
        mso-style-name:"";
        text-decoration:underline;
        color:teal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:Calibri;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:595.0pt 842.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body bgcolor="white" lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi All</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">I am using the following command to extract video h264 packets from my rtsp stream:</p>
<p class="MsoNormal">gst-launch-1.0 rtspsrc location="rtsp://MY_BIG_BUCK_BUNNY_IPADDRESS/vod/sample.mp4" ! queue ! "application/x-rtp,media=video" ! rtph264depay ! h264parse ! filesink location="test.h264"</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">To test my pipe and the format of the h264 packets I give that file to ffmpeg to create an mp4 :</p>
<p class="MsoNormal">ffmpeg -f h264 -i test.h264 -vcodec copy test.mp4</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">FFmpg complains trying the above command saying it cant find frames, start codes and eventually bombs out with</p>
<p class="MsoNormal">“Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument”</p>
<p class="MsoNormal">The entire output is below.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">If I add a matroskamux to the gstreamer pipe I am able to play the output file no probs.</p>
<p class="MsoNormal">Is there something special about the h264 raw output packets generated from the gst-launch command?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Looking at the raw h264 output file it looks to me like there are extra bytes of data (maybe 35bytes ?) in front of the first h264 packet. But I could be way off with that. And following packets seem to have an offset counter that’s incrementing 
 (eg 00000001 … 0000008F).</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Can anyone out there help me to get the output h264 raw file into a format that can be read by ffmpeg?</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Many (many many!) thanks</p>
<p class="MsoNormal">John </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">$ ffmpeg -f h264 -i test.h264 -vcodec copy test.mp4</p>
<p class="MsoNormal">ffmpeg version 3.1.4 Copyright (c) 2000-2016 the FFmpeg developers</p>
<p class="MsoNormal">  built with Apple LLVM version 8.0.0 (clang-800.0.38)</p>
<p class="MsoNormal">  configuration: --prefix=/usr/local/Cellar/ffmpeg/3.1.4 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl --enable-libx264
 --enable-libmp3lame --enable-libxvid --disable-lzma --enable-vda</p>
<p class="MsoNormal">  libavutil      55. 28.100 / 55. 28.100</p>
<p class="MsoNormal">  libavcodec     57. 48.101 / 57. 48.101</p>
<p class="MsoNormal">  libavformat    57. 41.100 / 57. 41.100</p>
<p class="MsoNormal">  libavdevice    57.  0.101 / 57.  0.101</p>
<p class="MsoNormal">  libavfilter     6. 47.100 /  6. 47.100</p>
<p class="MsoNormal">  libavresample   3.  0.  0 /  3.  0.  0</p>
<p class="MsoNormal">  libswscale      4.  1.100 /  4.  1.100</p>
<p class="MsoNormal">  libswresample   2.  1.100 /  2.  1.100</p>
<p class="MsoNormal">  libpostproc    54.  0.100 / 54.  0.100</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] missing picture in access unit with size 1055</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] If you want to help, upload a sample of this file to <a href="ftp://upload.ffmpeg.org/incoming/">ftp://upload.ffmpeg.org/incoming/</a> and contact the ffmpeg-devel mailing list. (<a href="mailto:ffmpeg-devel@ffmpeg.org">ffmpeg-devel@ffmpeg.org</a>)</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] no frame!</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] log2_max_frame_num_minus4 out of range (0-12): 50</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] missing picture in access unit with size 2030</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] Invalid NAL unit 2, skipping.</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] If you want to help, upload a sample of this file to <a href="ftp://upload.ffmpeg.org/incoming/">ftp://upload.ffmpeg.org/incoming/</a> and contact the ffmpeg-devel mailing list. (<a href="mailto:ffmpeg-devel@ffmpeg.org">ffmpeg-devel@ffmpeg.org</a>)</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] no frame!</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] missing picture in access unit with size 63108</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] Invalid NAL unit 2, skipping.</p>
<p class="MsoNormal">    Last message repeated 1 times</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] Invalid NAL unit 29, skipping.</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] no frame!</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] sps_id 24 out of range</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] non-existing PPS 0 referenced</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] Invalid NAL unit 16, skipping.</p>
<p class="MsoNormal">    Last message repeated 2 times</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] No start code is found.</p>
<p class="MsoNormal">[h264 @ 0x7fb4fa008600] Error splitting the input into NAL units.</p>
<p class="MsoNormal">[h264 @ 0x7fb4f8800000] decoding for stream 0 failed</p>
<p class="MsoNormal">[h264 @ 0x7fb4f8800000] Could not find codec parameters for stream 0 (Video: h264, none): unspecified size</p>
<p class="MsoNormal">Consider increasing the value for the 'analyzeduration' and 'probesize' options</p>
<p class="MsoNormal">Input #0, h264, from 'test.h264':</p>
<p class="MsoNormal">  Duration: N/A, bitrate: N/A</p>
<p class="MsoNormal">    Stream #0:0: Video: h264, none, 37.50 fps, 25 tbr, 1200k tbn, 50 tbc</p>
<p class="MsoNormal">File 'test.mp4' already exists. Overwrite ? [y/N] y</p>
<p class="MsoNormal">[mp4 @ 0x7fb4f8800600] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.</p>
<p class="MsoNormal">[mp4 @ 0x7fb4f8800600] dimensions not set</p>
<p class="MsoNormal">Output #0, mp4, to 'test.mp4':</p>
<p class="MsoNormal">    Stream #0:0: Video: h264, none, q=2-31, 37.50 fps, 25 tbr, 1200k tbn, 1200k tbc</p>
<p class="MsoNormal">Stream mapping:</p>
<p class="MsoNormal">  Stream #0:0 -> #0:0 (copy)</p>
<p class="MsoNormal">Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument</p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by
 you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of
 internal compliance with Accenture policy. <br>
______________________________________________________________________________________<br>
<br>
www.accenture.com<br>
</font>
</body>
</html>