<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=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
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;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","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:72.0pt 72.0pt 72.0pt 72.0pt;}
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="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">Hi Ross,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">Following on from an earlier post in relation to H264VideoStreamParser:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> http://lists.live555.com/pipermail/live-devel/2012-June/015350.html<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">The fix provided worked for all the cases that I tested at the time but I recently encountered some other files where the H.264 stream was truncated in the MPEG-TS container when using H264VideoStreamFramer
and MPEG2TransportStreamFromESSource.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">The files in question had an end_of_stream NAL Unit of 0x0000010b. This is a valid nal_unit_type according to Section 7.4.1, "NAL unit semantics", of the H.264 specification.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">You can reproduce the issue as follows with your sample tc10.264 file:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> cd testProgs<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> cp ~/Videos/tc10.264 in.264
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> # Convert in.264 to out.ts:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> ./testH264VideoToTransportStream<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> # Demux it back to H.264:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> ffmpeg -i out.ts -vcodec copy demuxed01.h264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> # Verify that the files are the same:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> cmp in.264 demuxed01.h264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> # Add the end of stream NALU to in the input file:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> perl -i -0777 -ne 'print $_, pack "N", 0x0000010b if eof' in.264
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> # Convert in.264 to out.ts again:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> ./testH264VideoToTransportStream<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> # Demux it back to H.264 again:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> ffmpeg -i out.ts -vcodec copy demuxed02.h264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> # Verify that the files are no longer the same:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> cmp in.264 demuxed02.h264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">You will see that the demuxed02.h264 file is truncated in relation to the input file:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> $ ls -l in.264 demuxed0?.h264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> -rw-r--r-- 1 test test 2680810 2012-07-18 13:59 in.264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> -rw-r--r-- 1 test test 2680806 2012-07-18 13:59 demuxed01.h264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> -rw-r--r-- 1 test test 2674518 2012-07-18 13:59 demuxed02.h264<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"> <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">I tested with version
</span><span lang="EN-US"> </span><span lang="EN-US" style="font-family:Consolas">live.2012.07.14.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">John.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas">-- <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family:Consolas"><o:p> </o:p></span></p>
</div>
<font face="monospace">--------------------------------------------------------------<br>
Intel Shannon Limited<br>
Registered in Ireland<br>
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare<br>
Registered Number: 308263<br>
Business address: Dromore House, East Park, Shannon, Co. Clare<br>
<br>
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.<br>
</font></body>
</html>