I want to extract an image (First frame) form a video file in qt. I used ffmpeg application to extract a frame, it gives extact result what I need, but ffmpeg is a seperate application, which overloads process. So I want to make it as static linking. Is it possible make static link to ffmpeg , is there is any statick library available for extracting frame from video or are there any other ways to extract frame from video? I dont want to use Qt phonon, because it physically opens a phonon dialog and then take a scrrenshot. I want the extracting process should happenin background.
Thanks in Advance
You have two choices : either via ffmpeg
API, or via ffmpeg
executable. Basically
Executable Approach: quick and dirty, not that bad if done correctly, but not very flexible
Call ffmpeg executable via QProcess and then read the processed data from disk. You need to construct ffmpeg command lines parameters from your own parameters; be able to capture the result (failed\\succeeded) and .
API Approach: long term, clean but require significant amount of work at beginning
Personally I will recommend to stick with the executable approach unless you don't mind taking a week to learn ffmpeg API
.
OpenCV has a built-in videocapture API , which actually wraps avcodec, easier to work with -in case you dont want to mess with avcodec.
EDIT: Data conversion .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.