当前位置: 首页 > wzjs >正文

网站建设服务商城培训机构营业执照如何办理

网站建设服务商城,培训机构营业执照如何办理,名聚优品一家只做正品的网站,延吉网站建设depawo站在巨人的肩膀上最简单的基于FFMPEG的封装格式转换器(无编解码)_mp4remuxer_雷霄骅的博客-CSDN博客 在作者的示例上,修正了在ffmpeg6.0.1上运行,有些方法过时了.没有其它的修改. const char *in_filename "/Users/archko/Movie/健身气功八段锦-…

站在巨人的肩膀上最简单的基于FFMPEG的封装格式转换器(无编解码)_mp4remuxer_雷霄骅的博客-CSDN博客

在作者的示例上,修正了在ffmpeg6.0.1上运行,有些方法过时了.没有其它的修改.

const char *in_filename = "/Users/archko/Movie/健身气功八段锦-clip.mp4";const char *out_filename = "/Users/archko/Movie/code.mp4";const AVOutputFormat *ofmt = NULL;//输入对应一个AVFormatContext,输出对应一个AVFormatContext//(Input AVFormatContext and Output AVFormatContext)AVFormatContext *ifmt_ctx = NULL, *ofmt_ctx = NULL;AVPacket pkt;int ret, i;// 输入(Input)ret = avformat_open_input(&ifmt_ctx, in_filename, 0, 0);if (ret < 0) {printf("Could not open input file.");return 0;}ret = avformat_find_stream_info(ifmt_ctx, 0);if (ret < 0) {printf("Failed to retrieve input stream information");return 0;}av_dump_format(ifmt_ctx, 0, in_filename, 0);//输出(Output)avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, out_filename);if (!ofmt_ctx) {printf("Could not create output context\n");ret = AVERROR_UNKNOWN;return 0;}ofmt = ofmt_ctx->oformat;for (i = 0; i < ifmt_ctx->nb_streams; i++) {//根据输入流创建输出流(Create output AVStream according to input AVStream)AVStream *in_stream = ifmt_ctx->streams[i];const AVCodec *codec = avcodec_find_decoder(in_stream->codecpar->codec_id);AVStream *out_stream = avformat_new_stream(ofmt_ctx, codec);if (!out_stream) {printf("Failed allocating output stream\n");ret = AVERROR_UNKNOWN;return 0;}//复制AVCodecContext的设置(Copy the settings of AVCodecContext)AVCodecContext *codec_ctx = avcodec_alloc_context3(codec);ret = avcodec_parameters_to_context(codec_ctx, in_stream->codecpar);if (ret < 0) {printf("Failed to copy context from input to output stream codec context\n");return 0;}ret = avcodec_parameters_from_context(out_stream->codecpar, codec_ctx);if (ret < 0) {printf("Failed to copy codec context to out_stream codecpar context\n");return 0;}out_stream->codecpar->codec_tag = 0;//leixiaohua1020 在这是有这段操作的,6.0不需要这样,然后正常复制视频//if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER) {//    out_stream->codecpar->codec_tag |= AV_CODEC_FLAG_GLOBAL_HEADER;//}}//输出一下格式------------------av_dump_format(ofmt_ctx, 0, out_filename, 1);//打开输出文件(Open output file)if (!(ofmt->flags & AVFMT_NOFILE)) {ret = avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE);if (ret < 0) {printf("Could not open output file '%s'", out_filename);return 0;}}//写文件头(Write file header)ret = avformat_write_header(ofmt_ctx, NULL);if (ret < 0) {printf("Error occurred when opening output file\n");return 0;}int frame_index = 0;while (1) {AVStream *in_stream, *out_stream;//获取一个AVPacket(Get an AVPacket)ret = av_read_frame(ifmt_ctx, &pkt);if (ret < 0)break;in_stream = ifmt_ctx->streams[pkt.stream_index];out_stream = ofmt_ctx->streams[pkt.stream_index];/* copy packet *///转换PTS/DTS(Convert PTS/DTS)pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base,(AVRounding) (AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));pkt.dts = av_rescale_q_rnd(pkt.dts, in_stream->time_base, out_stream->time_base,(AVRounding) (AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);pkt.pos = -1;//写入(Write)ret = av_interleaved_write_frame(ofmt_ctx, &pkt);if (ret < 0) {printf("Error muxing packet\n");break;}//printf("Write %8d frames to output file\n", frame_index);av_packet_unref(&pkt);frame_index++;}//写文件尾(Write file trailer)av_write_trailer(ofmt_ctx);end:avformat_close_input(&ifmt_ctx);/* close output */if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE)) {avio_close(ofmt_ctx->pb);}avformat_free_context(ofmt_ctx);if (ret < 0 && ret != AVERROR_EOF) {printf("Error occurred.\n");return -1;}printf("Copy success.\n");return 0;

xcode的开发实在不习惯,用的是clion,cmake,vscode.下一篇,clion创建项目,导入ffmpeg依赖

http://www.dtcms.com/wzjs/437732.html

相关文章:

  • 个人网站的需求分析互联网营销师证书是国家认可的吗
  • 江西省做网站腾讯云域名购买
  • 什么网站是用html做的小吃培训2000元学6项
  • 纯ipv6网站测试站长之家是干什么的
  • 世界最大的互联网公司优化神马排名软件
  • 做网站需服务器吗国外电商平台有哪些
  • 国际新闻头条最新热点新闻搜狗整站优化
  • 做网站备负责人风险大吗360网站收录
  • 淘宝优惠劵做网站模版宁波网络营销策划公司
  • 做美工的网站网站优化价格
  • 做标签网站是什么广东培训seo
  • 网站开发业务怎么开展百度广告费用
  • 免费建设自己的网站网络营销学院
  • 色情网站是怎么建设的网络搜索优化
  • 苏州网站小程序app开发公司自媒体怎么入门
  • 三九集团如何进行网站建设微商软文大全
  • 厦门建设集团网站市场营销十大经典案例
  • 重庆潼南网站建设哪家便宜网站排名查询软件
  • wordpress 用户水印茂名seo快速排名外包
  • 网站项目名称南京网站设计优化公司
  • 苏州公司建设网站首页推一手新闻发稿平台
  • 物流网站制作关键词指数批量查询
  • o2o商城网站制作搜索引擎分析论文
  • 做网站放博彩广告如何用网站模板建站
  • 做网站买什么笔记本好网络营销与直播电商是干什么的
  • 无锡做网站上海整站seo
  • 深圳网站建设费用什么是seo如何进行seo
  • 青创网石狮服装批发网seo 优化顾问
  • 改善网站建设超级推荐的关键词怎么优化
  • 香港 网站建设 可视化网站程序seo查询网站是什么