Qt中添加ffmpeg解析音乐
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41extern "C" { #include <libavcodec/avcodec.h> #include <libavformat/avformat.h> #include <libswscale/swscale.h> #include <libswresample/swresample.h> #include <SDL2/SDL.h> #include <SDL2/SDL_thread.h> } typedef struct PacketQueue { AVPacketList *first_pkt, *last_pkt; int nb_packets; int size; SDL_mutex *mutex; SDL_cond *cond; } PacketQueue; typedef struct{ AVFormatContext* fct; //格式上下文 AVFrame *wanted_frame;//音频目标帧 AVCodecContext *acct;//音频解码上下文 AVStream *aStream; PacketQueue audioq; //音频队列 HANDLE VideoHD; HANDLE AudioHD; AVCodecContext *vcct;//视频解码上下文 AVStream *vStream; PacketQueue videoq; //视频队列 bool seek_req; qint64 seek_pos; double video_clock; double audio_clock; }mediaState;
程序运行时报错
原因
因为Qt的可执行文件与程序并不在同一目录,编译生成的中间文件(.o)和可执行文件(.exe)在debug目录下,二可执行文件依赖于ffmpeg的动态库(.dll),所以需要将我们需要的动态库文件(.dll)放在dubug目录下
最后
以上就是过时保温杯最近收集整理的关于Qt中添加ffmpeg库时,程序异常结束问题Qt中添加ffmpeg解析音乐程序运行时报错 原因的全部内容,更多相关Qt中添加ffmpeg库时内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复