[FFmpeg-user] Cropping a video with FFMPEG API

GUILLOT Jean-Baptiste jguillot at et.esiea.fr
Wed May 18 14:27:31 CEST 2016


Hello,

I learned how to use FFMPEG API with http://dranger.com/ffmpeg/ , and I implemented a video reader using the library SDL to display the video.

I have a HD video 1280*720 (i only worked with mp4) and i want to select a VGA-screen anywhere in the HD video (I mean cropping a VGA screen in a HD video), recuperate the data and display it on screen.

In the FFMPEG API, we can use the function av_picture_crop ( https://ffmpeg.org/doxygen/2.0/group__lavc__picture.html#gadeee38e47bd67bb3cce616ce4979e9be)
I get a "yellow" overlay on the cropped video and my application crashes after fews seconds.
Get the compilation error :

    *** glibc detected *** ./HDtoVGA: corrupted double-linked list: 0x08d74e30 ***

Before posting here, i read http://stackoverflow.com/questions/14696258/copy-a-rectangular-area-from-avframe-ffmpeg  that the function wasn't finish yet. But when i reading the code, i don't find a way to finish it.

In the FFMPEG command line tool, we can crop a video, using vf_crop  https://ffmpeg.org/doxygen/2.0/vf__crop_8c.html but I don't find how to implement the same function in my code.

Do you have any hint to help me?





More information about the ffmpeg-user mailing list