资源简介
ffmpeg提取mp4关键帧保存为jpg.zip
代码片段和文件信息
/*
* Copyright (c) 2012 Stefano Sabatini
*
* 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.
*/
/**
* @file
* Demuxing and decoding example.
*
* Show how to use the libavformat and libavcodec API to demux and
* decode audio and video data.
* @example demuxing_decoding.c
*/
#include
#include
#include
#include
static AVFormatContext *fmt_ctx = NULL;
static AVCodecContext *video_dec_ctx = NULL *audio_dec_ctx;
static int width height;
static enum AVPixelFormat pix_fmt;
static AVStream *video_stream = NULL *audio_stream = NULL;
static const char *src_filename = NULL;
static char video_dst_filename[50] = {0};
static char audio_dst_filename[50] = {0};
static char *dst_pathname = NULL;
static FILE *video_dst_file = NULL;
static FILE *audio_dst_file = NULL;
static FILE *video_dst_filetemp = NULL;
static uint8_t *video_dst_data[4] = {NULL};
static int video_dst_linesize[4];
static int video_dst_bufsize;
static int video_stream_idx = -1 audio_stream_idx = -1;
static AVframe *frame = NULL;
static AVPacket pkt;
static int video_frame_count = 0;
static int audio_frame_count = 0;
static AVCodecContext* pCodecCtx = NULL;
static AVCodec* pCodec = NULL;
static AVPacket pkt_out;
static char file_name[50] = {0};
/* Enable or disable frame reference counting. You are not supposed to support
* both paths in your application but pick the one most appropriate to your
* needs. Look for the use of refcount in this example to see what are the
* differences of API usage between them. */
static int refcount = 0;
static void save_picture_uinit(FILE * pFileAVPacket pkt)
{
fwrite(pkt.data sizeof(uint8_t)pkt.size pFile);
fclose(pFile);
pFile = NULL;
av_free_packet(&pkt);
}
void generate_file_name(char * file_namechar * file_pathlong long pts)
{
if (file_path[strlen(file_path) - 1] == ‘\\‘)
{
sprintf(file_name“%s%lld.jpg“file_pathpt
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-12-25 12:35 ffmpeghello4\
目录 0 2016-12-25 12:20 ffmpeghello4\Debug\
文件 24519168 2016-12-16 20:17 ffmpeghello4\Debug\avcodec-57.dll
文件 2008576 2016-12-16 20:17 ffmpeghello4\Debug\avdevice-57.dll
文件 4207616 2016-12-16 20:17 ffmpeghello4\Debug\avfilter-6.dll
文件 4942336 2016-12-16 20:17 ffmpeghello4\Debug\avformat-57.dll
文件 662016 2016-12-16 20:17 ffmpeghello4\Debug\avutil-55.dll
文件 37888 2016-12-25 12:20 ffmpeghello4\Debug\ffmpeghello4.exe
文件 378432 2016-12-25 12:20 ffmpeghello4\Debug\ffmpeghello4.ilk
文件 445440 2016-12-25 12:20 ffmpeghello4\Debug\ffmpeghello4.pdb
文件 110592 2016-12-16 20:17 ffmpeghello4\Debug\postproc-54.dll
文件 292864 2016-12-16 20:17 ffmpeghello4\Debug\swresample-2.dll
文件 512000 2016-12-16 20:17 ffmpeghello4\Debug\swscale-4.dll
目录 0 2016-12-22 11:51 ffmpeghello4\ffmpeghello4\
文件 5263360 2016-12-25 12:35 ffmpeghello4\ffmpeghello4.sdf
文件 903 2016-12-22 11:47 ffmpeghello4\ffmpeghello4.sln
文件 28672 2016-12-25 12:35 ffmpeghello4\ffmpeghello4.suo
目录 0 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\
文件 728 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\cl.command.1.tlog
文件 6936 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\CL.read.1.tlog
文件 588 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\CL.write.1.tlog
文件 635 2016-12-22 14:36 ffmpeghello4\ffmpeghello4\Debug\ffmpeghello4.Build.CppClean.log
文件 381 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\ffmpeghello4.exe.intermediate.manifest
文件 97 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\ffmpeghello4.lastbuildstate
文件 8015 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\ffmpeghello4.log
文件 713 2016-12-22 14:55 ffmpeghello4\ffmpeghello4\Debug\ffmpeghello4.vcxprojResolveAssemblyReference.cache
文件 0 2016-12-22 14:36 ffmpeghello4\ffmpeghello4\Debug\ffmpeghello4.write.1.tlog
文件 1728 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\li
文件 3956 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\li
文件 1024 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\li
文件 39582 2016-12-25 12:20 ffmpeghello4\ffmpeghello4\Debug\Main.obj
............此处省略12个文件信息
- 上一篇:mp4_play.zip
- 下一篇:28g超大字典
相关资源
-
Macgo Windows Blu-ray Pla
yer 2.11中文注册 -
PotPla
yer.zip - 黑客与画家(高清中文版pdf).zip
- 2004-2018软考数据库系统工程师真题答
- 《非常简单-黑客攻防实战(超值全彩
- 黑客攻防全攻略.zip
- 概率论与数理统计陈希孺.pdf.zip
- 机器码修改大师.rar
- 黑客防线2014合集.part2.rar
- 40款经典黑客编程源代码.rar
- 佳佳象棋陆海空版.zip
- WinEdt-7-Build-20120321-incl-Crack.rar
- 数理统计学教程-陈希孺-书签精校版
- 概率论与数理统计-陈希孺-书签精校版
- 超好学!黑客攻防入门全图解.pdf
- 黑客工具包—远程控制包.rar
- 大灰狼原版源码.rar
- Microsoft_Toolkit_2.4.1_XiaZaiBa.zip
- 数电.rar
- wkeyuan-DWSurvey-master.zip
- Proteus单片机仿真大全.rar
- 黑客大追踪++网络取证核心原理与实践
- McgsPro组态软件v3.2.3(昆仑通态软件)
- 马克思主义原理复习资料2019.zip
- 大疆无刷减速电机3508.rar
- AnyDVDHD v7.3.8简体中文破解版.rar
- 网页设计——印象西藏代码.zip
- 曲线.zip
- 陈希孺版概率论与数理统计.rar
- Cadence16.6高速电路板设计与仿真左昉,
评论
共有 条评论