[Libav-user] 答复: How to extract a H264 video frame (container is 3GPP/MP4) into a JPG File (with libavformat and libavcode) ?

张弘强 zhanghongqiang at xiaomi.com
Fri Mar 22 20:43:03 CET 2013


Yeah, 

ffmpeg -i video_clip.3gp -vframes 1 -ss 00:00:01 -vf "transpose=1" output.jpg   (the first frame is not good enough)
can give the right picture. but it is slow, cannot hold 200 cps with Xeon CPUs

And I explored the sample codes, and the guide line on the internet (most of them not up to date)

I know how to open a video file, but I don't know how to get the correct Key Frame and how to output to a JPG file.

so the progam like this:
Open the video file
Get the frame counts, and seek to a good key frame
Output to JPG buffer
Rotate it 
Save the buffer to file.

Would you please guide me to do it ?


Regards,
--------------------------------------------------------------------------------------------------------------------------------------
Freeman
Mobile: 13811178263
E-Mail: zhanghongqiang at xiaomi.com


________________________________________
发件人: libav-user-bounces at ffmpeg.org [libav-user-bounces at ffmpeg.org] 代表 Carl Eugen Hoyos [cehoyos at ag.or.at]
发送时间: 2013年3月23日 3:33
收件人: libav-user at ffmpeg.org
主题: Re: [Libav-user] How to extract a H264 video frame (container is    3GPP/MP4) into a JPG File (with libavformat and libavcode) ?

张弘强 <zhanghongqiang at ...> writes:

> Recently, I’m doing development to generate video clips’
> thumbnail pic file. But, it is hard without development
> guide, would you please show me some example code for it?

First confirm that ffmpeg (the command line application)
allows you to do what you want, then look into
doc/examples to learn how to use libavformat and libavcodec.

Carl Eugen

_______________________________________________
Libav-user mailing list
Libav-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


More information about the Libav-user mailing list