Hi,<div><br></div><div>I'm decoding video frames (various file formats and codecs) and converting them into YUV420 format so that I can perform image processing on them.</div><div>And I have the commercial Fluendo codec pack installed.</div>
<div><br></div><div>The pipeline looks like this: uridecodebin -> queue -> ffmpegcolorspace -> tee -> queue -> appsink</div><div>YUV420 conversion is done in the ffmpegcolorspace component, and the other source pad of the tee is for a future feature.</div>
<div>This is built up dynamically in C, not on a command line.</div><div><br></div><div>My problem is that I need to extract the frame timings for each of the video frames being processed, and I'm seeing a large variance in this.</div>
<div>For example, one of my video files is a H.264 MP4, 82s long, 2057 frames and plays at 25 fps, so the average frame interval is 40ms.</div><div>When I recover a frame from the appsink component I use the gst_element_query_position() function to get the timing for that frame.</div>
<div>And what I'm seeing is that the timing is highly variable, even from one run to the next.</div><div><br></div><div>e.g. the time between frames for the first 32 frames for run 1:</div><div><div>0: 1020226us</div>
<div>1: 0us</div><div>2: 0us</div><div>3: 0us</div><div>4: 0us</div><div>5: 0us</div><div>6: 0us</div><div>7: 0us</div><div>8: 0us</div><div>9: 0us</div><div>10: 0us</div><div>11: 0us</div><div>12: 0us</div><div>13: 0us</div>
<div>14: 0us</div><div>15: 0us</div><div>16: 0us</div><div>17: 0us</div><div>18: 0us</div><div>19: 0us</div><div>20: 0us</div><div>21: 0us</div><div>22: 0us</div><div>23: 0us</div><div>24: 0us</div><div>25: 0us</div><div>
26: 19774us</div><div>27: 40000us</div><div>28: 40000us</div><div>29: 1022947us</div><div>30: 46440us</div><div>31: 23220us</div></div><div><br></div><div>the first 32 frames for run 2:</div><div><div>0: 53151us</div><div>
1: 0us</div><div>2: 26849us</div><div>3: 40000us</div><div>4: 40000us</div><div>5: 40000us</div><div>6: 40000us</div><div>7: 40000us</div><div>8: 40000us</div><div>9: 40000us</div><div>10: 40000us</div><div>11: 40000us</div>
<div>12: 40000us</div><div>13: 40000us</div><div>14: 40000us</div><div>15: 40000us</div><div>16: 40000us</div><div>17: 40000us</div><div>18: 40000us</div><div>19: 40000us</div><div>20: 1011428us</div><div>21: 46440us</div>
<div>22: 46440us</div><div>23: 23220us</div><div>24: 46440us</div><div>25: 46440us</div><div>26: 46440us</div><div>27: 23219us</div><div>28: 46440us</div><div>29: 46440us</div><div>30: 46440us</div><div>31: 23220us</div></div>
<div><br></div><div>Why do so many of the frames in the first run above have zero time delta between them ?</div><div>Is this a consequence of the file being in H.264/mp4 format ? And if, so is there an easy way to 'smooth' out the frame timings ?</div>
<div>Or would you suggest I do this 'manually' by approximating/averaging the timing based on the duration and no. of frames ?</div><div><br></div><div>Thanks !</div><div>Darren</div><div><br></div>