<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hi
Carson</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">My
goal is extracting<span style="mso-spacerun:yes"> </span>Frames from MPEG-4
AVC video in form of I-Frames.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">To
achieving my goal, I currently uses JM software ( Opensource MPEG-4 AVC
software from ITU-T). This software input is raw video format in YUV or RGB. That’s
why I need this type of video.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">When
I input a raw video to software, I will be enable to ask the software to retrieve
any video started from frame-x to frame-y. So I just select one frame and the
output would be just a video containing one i-frame.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">But
I am looking for another tools (I hope FFMPEG or X.264) that enable me directly
extract the framed in form of videos in 1 frame length, from the main video. The
source and the output videos should be in MPEG-4 AVC format.</p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Regarding
extracting pictures from videos, I should say it is not in my interest. The below
command cand do it for you by FFMPEG:</p>
<pre><font size="4">ffmpeg -i src.avi -r 1 -s WxH -f image2 dst-%03d.jpeg</font></pre>
<p>The above command extract one video frame per second (-r 1, if –r 0.1 then
one image every 10 sec if video) from source video and will output them in
files named <tt><span style="font-size:10.0pt">`dst-001.jpeg'</span></tt>, <tt><span style="font-size:10.0pt">`dst-002.jpeg'</span></tt>, etc. Images can be
rescaled to fit the new WxH .</p>
<p>Regards</p>
<p>Amir</p>
<br><br><div class="gmail_quote">On Thu, Apr 7, 2011 at 3:26 PM, Carson Harper <span dir="ltr"><<a href="mailto:carsonharper@gmail.com">carsonharper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hey Amir,</div><div><br></div><div>Could you tell us a little bit more about what you want to do with the "raw" YUV or RGB data? For instance, do you want to save those individual frames as still images (BMP, PNG...) or are you wanting to transcode them for use in another video stream? </div>
<div><br></div><div>If you want to just save to disk try-</div><div><br></div><div>ffmpeg -f image2 </path/to/your/video.mp4> frame_%06d.png</div><div><br></div><div>See <a href="http://www.catswhocode.com/blog/19-ffmpeg-commands-for-all-needs" target="_blank">here</a> for some other useful CLI stuff.</div>
<div><br></div><div>I recently went through the tutorials listed above and came up with a C++ routine that convert's the first video stream from an input file to a vector of ImageMagick objects, but it would be trivial to adapt it to something else. </div>
<div><br></div><div>You mentioned having random access to frames by selecting frame number, which is something I'll need to write eventually anyways, but this may work for you as a lazy solution. I mostly deal with small/short video clips which is why I can get aways with loading the whole video into memory.</div>
<div><br></div><div>I tried to tweak a few things to make it easier to understand, but you will definitely still need to change things to get it to work for you. Obviously, I'm throwing my own custom exceptions etc... You could return an array of (int8_t *) if you don't want to use the ImageMagick stuff, and then just play with the raw data from there.</div>
<div><br></div><div>Hope this helps,</div><div><br></div><font color="#888888"><div>CH</div>
</font><br>_______________________________________________<br>
Libav-user mailing list<br>
<a href="mailto:Libav-user@ffmpeg.org">Libav-user@ffmpeg.org</a><br>
<a href="http://ffmpeg.org/mailman/listinfo/libav-user" target="_blank">http://ffmpeg.org/mailman/listinfo/libav-user</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div>Amir H. Rouhi</div>
<div>PhD Student/ CSIT RMIT University</div>
<div>Room: 14-09-04</div>
<div><a href="mailto:rouhi_amirhossein@student.rmit.edu.au" target="_blank">rouhi_amirhossein@student.rmit.edu.au</a></div>
<div><a href="mailto:amir.rouhi@rmit.edu.au" target="_blank">amir.rouhi@rmit.edu.au</a></div>
<div> </div><br>