<div dir="ltr">

<span style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Hi,</span><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">I have an application that uses the ffmpeg code. (application is in C++)</div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">my input is a file with TS packets (video stream)</div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">I am using the code in the /doc/examples supplied with ffmpeg source code.</div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">I need to check the TS packets data.</div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial">for this, <span style="font-size:12.8px">I am using the mpegts.c code for demuxing.</span></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px">specifically at the function:</span></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"><br></span></div><div style="font-size:12.8px;text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:12.8px"> </span><span style="font-size:12.8px">/* handle one TS packet */</span></div><div style="font-size:12.8px">static int handle_packet(MpegTSContext *ts, const uint8_t *packet)</div>

<br><div>Now I have some problems here.</div><div>First, I wanted to check that I am not missing any TS packets, so I write to a file all the packets when entering to the 

<span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">handle_packet()method.</span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="font-size:12.8px">1. problem - I see that the output file is bigger than the input source file!!?, how come?</span></div><div><span style="font-size:12.8px">2. I tried to follow what is the reason, and I saw that there is a use in the function:</span></div><div><span style="font-size:12.8px">mpegts_resync(), why there is a use in this function? I check my input with hex editor, and there are no missing sync bytes (0x47)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I think that the resync process adding some wrong TS packets, to my original input source, and I fail to test the TS packets</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">how to fix it?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thanks</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Seus</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div><br></div></div>