<div dir="ltr">Hi,<div><br></div><div>I'm trying to extract the motion vector information from an H.264 video. I got every information I needed except one. The "source" parameter of a motion vector is either -1 orĀ +1 depending on whether the reference frame used is in the past or future. But I need the exact reference frame number which is used as a reference for each of the macroblocks/motion vectors. Is there any way to do that?<br clear="all"><div><br></div><div>InĀ libavutil/motion_vector.h, the source parameter is specified as given below:</div><div><br></div><div><br class="gmail-Apple-interchange-newline"><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="border-spacing:0px;border-collapse:collapse;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-LC24" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-size:12px;white-space:pre"><span class="gmail-pl-k" style="box-sizing:border-box">typedef</span> <span class="gmail-pl-k" style="box-sizing:border-box">struct</span> AVMotionVector {</td></tr><tr style="box-sizing:border-box"><td id="gmail-L25" class="gmail-blob-num gmail-js-line-number" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC25" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-size:12px;white-space:pre">    <span class="gmail-pl-c" style="box-sizing:border-box"><span class="gmail-pl-c" style="box-sizing:border-box">/*</span>*</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L26" class="gmail-blob-num gmail-js-line-number" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC26" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-size:12px;white-space:pre"><span class="gmail-pl-c" style="box-sizing:border-box">     * Where the current macroblock comes from; negative value when it comes</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L27" class="gmail-blob-num gmail-js-line-number" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC27" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-size:12px;white-space:pre"><span class="gmail-pl-c" style="box-sizing:border-box">     * from the past, positive value when it comes from the future.</span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L28" class="gmail-blob-num gmail-js-line-number" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC28" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-size:12px;white-space:pre"><span class="gmail-pl-c" style="box-sizing:border-box">     * XXX: set exact relative ref frame reference instead of a +/- 1 "direction".</span></td></tr><tr style="box-sizing:border-box"><td id="gmail-L29" class="gmail-blob-num gmail-js-line-number" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC29" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-size:12px;white-space:pre"><span class="gmail-pl-c" style="box-sizing:border-box">     <span class="gmail-pl-c" style="box-sizing:border-box">*/</span></span></td></tr><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L30" class="gmail-blob-num gmail-js-line-number" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC30" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-size:12px;white-space:pre">    <span class="gmail-pl-c1" style="box-sizing:border-box">int32_t</span> source;
}

</td></tr></tbody></table></div><div>Expecting a positive response.</div><div><table class="gmail-highlight gmail-tab-size gmail-js-file-line-container" style="border-spacing:0px;border-collapse:collapse;color:rgb(36,41,47);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";font-size:14px"><tbody style="box-sizing:border-box"><tr style="box-sizing:border-box;background-color:transparent"><td id="gmail-L30" class="gmail-blob-num gmail-js-line-number" style="box-sizing:border-box;padding:0px 10px;width:50px;min-width:50px;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;line-height:20px;text-align:right;white-space:nowrap;vertical-align:top"></td><td id="gmail-LC30" class="gmail-blob-code gmail-blob-code-inner gmail-js-file-line" style="box-sizing:border-box;padding:0px 10px;line-height:20px;vertical-align:top;overflow:visible;font-family:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;font-size:12px;white-space:pre">
</td></tr></tbody></table></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Regards<div>Sandra VS Nair</div></div></div></div></div>