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.78k stars 937 forks source link

How to control the palying speed? #91

Open wujilingfeng opened 3 years ago

wujilingfeng commented 3 years ago

Will the function of "av_read_frame" run by prescribed speed?

leandromoreira commented 3 years ago

Hi @wujilingfeng I don't if I understood your question but the av_read_frame do not accept a timeout, if you want to control the speed you get frames from it, you should control the pace you request a new frame.

wujilingfeng commented 3 years ago

Hi @leandromoreira I want to render the video, but I'm not sure it will read at the default speed ๏ผŸ

wujilingfeng commented 3 years ago

Hi @leandromoreira If the function of "av_read_frame" read all frames in one second๏ผŒ will the opengl play the video in one second? Actually, I want to known how to render the video in opengl? Do you have any fresh evidence?

wujilingfeng commented 3 years ago

Hi @leandromoreira ,I've already run this demo of "helloworld.c", It did finish the job in a flash . So how to render the video with opengl at the default speed?How to get the information about default speed of the video?

leandromoreira commented 3 years ago

@wujilingfeng maybe the ffprobe (ffmpeg's player) will be a better example as a player for you. And they seem to be using SDL. And there's also a good tutorial on how to build a ffmpeg player.

wujilingfeng commented 3 years ago

OK.Thankyou. I think I need control it by hand.