leandromoreira / ffmpeg-libav-tutorial

FFmpeg libav tutorial - learn how media works from basic to transmuxing, transcoding and more. Translations: πŸ‡ΊπŸ‡Έ πŸ‡¨πŸ‡³ πŸ‡°πŸ‡· πŸ‡ͺπŸ‡Έ πŸ‡»πŸ‡³ πŸ‡§πŸ‡·
https://github.com/leandromoreira/ffmpeg-libav-tutorial
BSD 3-Clause "New" or "Revised" License
9.82k stars 941 forks source link

set framerate in RTSP #47

Closed EhsanVahab closed 2 years ago

EhsanVahab commented 5 years ago

Hi dear @leandromoreira, Thanks for your great documentation about ffmpeg. I get stuck a problem with this library and I can't take it over. I'm developing an application by c++ and ffmpeg library to capture ip camera frames, clearly the protocol name is RTSP. everything is going well when the resolution of cameras is low but when I change it to higher resolution, the memory consumption goes up suddenly. So I need your help solve it. 1.is there any way to reduce the framerate or fps when I read the cameras frame? I need only the last frame at the time of reading and the previous frames don't matter. 2.is it possible to reduce the frame's width and height before calling av_read_frame ? I mean that I set a parameter in AVFormatContext or AVCodecContext by which ffmpeg read the frame with the specific size. for example 400x400

I will be very very thankful if you help me.