资源简介
使用qt结合FFmpeg开发的视频导出示例代码,以及window和macos下的ffmpeg库。本示例支持导出视频为mp4,avi,mov,支持导入视频为mp4,avi,mov
代码片段和文件信息
/*
* Copyright (c) 2014 Lukasz Marek
*
* Permission is hereby granted free of charge to any person obtaining a copy
* of this software and associated documentation files (the “Software“) to deal
* in the Software without restriction including without limitation the rights
* to use copy modify merge publish distribute sublicense and/or sell
* copies of the Software and to permit persons to whom the Software is
* furnished to do so subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
* IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
* LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include
#include
#include
static const char *type_string(int type)
{
switch (type) {
case AVIO_ENTRY_DIRECTORY:
return ““;
case AVIO_ENTRY_FILE:
return ““;
case AVIO_ENTRY_BLOCK_DEVICE:
return ““;
case AVIO_ENTRY_CHARACTER_DEVICE:
return ““;
case AVIO_ENTRY_NAMED_PIPE:
return ““;
case AVIO_ENTRY_SYMBOLIC_link:
return “nk>“;
case AVIO_ENTRY_SOCKET:
return ““;
case AVIO_ENTRY_SERVER:
return ““;
case AVIO_ENTRY_SHARE:
return ““;
case AVIO_ENTRY_WORKGROUP:
return ““;
case AVIO_ENTRY_UNKNOWN:
default:
break;
}
return ““;
}
static int list_op(const char *input_dir)
{
AVIODirEntry *entry = NULL;
AVIODirContext *ctx = NULL;
int cnt ret;
char filemode[4] uid_and_gid[20];
if ((ret = avio_open_dir(&ctx input_dir NULL)) < 0) {
av_log(NULL AV_LOG_ERROR “Cannot open directory: %s.\n“ av_err2str(ret));
goto fail;
}
cnt = 0;
for (;;) {
if ((ret = avio_read_dir(ctx &entry)) < 0) {
av_log(NULL AV_LOG_ERROR “Cannot list directory: %s.\n“ av_err2str(ret));
goto fail;
}
if (!entry)
break;
if (entry->filemode == -1) {
snprintf(filemode 4 “???“);
} else {
snprintf(filemode 4 “%3“PRIo64 entry->filemode);
}
snprintf(uid_and_gid 20 “%“PRId64“(%“PRId64“)“ entry->user_id entry->group_id);
if (cnt == 0)
av_log(NULL AV_LOG_INFO “%-9s %12s %30s %10s %s %16s %16s %16s\n“
“TYPE“ “SIZE“ “NAME“ “UID(GID)“ “UGO“ “MODIFIED“
“ACCE
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-08-24 15:37 ffmpeg-win32-shared\
目录 0 2019-08-24 15:37 ffmpeg-win32-shared\bin\
文件 293888 2019-08-19 04:44 ffmpeg-win32-shared\bin\ffmpeg.exe
文件 34018816 2019-08-19 04:44 ffmpeg-win32-shared\bin\avcodec-58.dll
文件 124928 2019-08-19 04:44 ffmpeg-win32-shared\bin\postproc-55.dll
文件 518656 2019-08-19 04:44 ffmpeg-win32-shared\bin\swscale-5.dll
文件 9886208 2019-08-19 04:44 ffmpeg-win32-shared\bin\avformat-58.dll
文件 166400 2019-08-19 04:44 ffmpeg-win32-shared\bin\ffprobe.exe
文件 829952 2019-08-19 04:44 ffmpeg-win32-shared\bin\avutil-56.dll
文件 1466880 2019-08-19 04:44 ffmpeg-win32-shared\bin\avdevice-58.dll
文件 316928 2019-08-19 04:44 ffmpeg-win32-shared\bin\swresample-3.dll
文件 147968 2019-08-19 04:44 ffmpeg-win32-shared\bin\ffplay.exe
文件 7300096 2019-08-19 04:44 ffmpeg-win32-shared\bin\avfilter-7.dll
目录 0 2019-08-24 15:37 ffmpeg-win32-shared\include\
目录 0 2019-08-24 15:37 ffmpeg-win32-shared\include\libpostproc\
文件 1642 2019-08-19 04:44 ffmpeg-win32-shared\include\libpostproc\version.h
文件 2936 2019-08-19 04:44 ffmpeg-win32-shared\include\libpostproc\postprocess.h
目录 0 2019-08-24 15:37 ffmpeg-win32-shared\include\libavfilter\
文件 2335 2019-08-19 04:44 ffmpeg-win32-shared\include\libavfilter\version.h
文件 6609 2019-08-19 04:44 ffmpeg-win32-shared\include\libavfilter\buffersrc.h
文件 6314 2019-08-19 04:44 ffmpeg-win32-shared\include\libavfilter\buffersink.h
文件 42263 2019-08-19 04:44 ffmpeg-win32-shared\include\libavfilter\avfilter.h
目录 0 2019-08-24 15:37 ffmpeg-win32-shared\include\libavutil\
文件 23027 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\hwcontext.h
文件 1800 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\time.h
文件 1482 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\hwcontext_cuda.h
文件 1726 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\intfloat.h
文件 5468 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\error.h
文件 5899 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\fifo.h
文件 2394 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\blowfish.h
文件 1203 2019-08-19 04:44 ffmpeg-win32-shared\include\libavutil\hwcontext_mediacodec.h
............此处省略660个文件信息
相关资源
- 最简单的基于FFmpeg的推流器 1.2
- 简单的ffmpeg推流demo
- QT5.5入门与项目实战
- FFmpeg和SDL,读内存中的视频流,进行
- ffmpeg之pcm转AAC
- Huffman Compress 霍夫曼编码 压缩 解压缩
- ffmpeg-2.8.14.tar.gz
- 基于QT的黑白棋游戏设计和实现
- Qt写的连连看小游戏
- 利用ffmpeg的filter混音
- vs2010 ffmpeg实时解码h264码流
- QTranslate_6.7.2.7z
- ffmpeg 音视频转码代码
- windows上自己编译的最新的ffmpeg库
- Qt基于FFmpeg播放本地 H.264H264文件
- 从ffmpeg中抽取的h264解码器,可用于
- ffplay源代码
- 最简单的基于FFmpeg的推流器以推送R
- QT编的MP3播放器
- DVD文件VOB的生成代码
- linux系统的二级文件系统(QT实现了简
- QT生成DLL库文件的方法和使用方法详解
- FFmpeg 采集摄像头输出rtmp直播流媒体,
- 基于ffmpeg将avi视频转换为mp4视频
- (补充)修改output-example,将H.264AAC帧
- ffmpeg-win64位库
- QT+opencv+OCR 身份证号码,银行卡号识别
- X264实时编码,FFmpeg实时解码
- FFmpeg API读取视音频文件信息的一个工
- 使用FFmpeg采集摄像头图像和麦克风音
评论
共有 条评论