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

建网站用自己的主机做服务器网站建设属于什么岗位

建网站用自己的主机做服务器,网站建设属于什么岗位,国内有名室内设计公司,服务器如何做网站操作系统#xff1a;ubuntu 注意事项#xff1a; 1.ts文件顺序必须正确#xff0c;也就是下一帧的dst和pst要比上一帧的大#xff0c;否则会报错 2.codecpar-codec_tag要设置为0#xff0c;否则报错Tag [27][0][0][0] incompatible with output codec id ‘27’ (avc1…操作系统ubuntu 注意事项 1.ts文件顺序必须正确也就是下一帧的dst和pst要比上一帧的大否则会报错 2.codecpar-codec_tag要设置为0否则报错Tag [27][0][0][0] incompatible with output codec id ‘27’ (avc1) 3.设置output的max_streams数目默认是1000超过此数目就会报错 #include iostream #include dirent.h #include vectorextern C { #include include/libavformat/avformat.h #include include/libavcodec/avcodec.h }//#pragma comment(lib,avformat.lib) //#pragma comment(lib,avcodec.lib)using namespace std;int ts2Mp4(const string,const string,int);int main(int argc, char* argv[]) {//const string ts_filename argv[1];//const string output_filename ../1.mp4;//argv[2];ts2Mp4(argv[1],argv[2],atoi(argv[3]));return 0; }int ts2Mp4(const string ts_path,const string mp4_path,int ts_count){/*vectorstring ts_list;DIR *pDir;struct dirent* ptr;if(!(pDir opendir(ts_path.c_str()))){printf(cannot open ts dir\n);return -1;}while((ptr readdir(pDir))!0) {if (strcmp(ptr-d_name, .) ! 0 strcmp(ptr-d_name,..)!0){ts_list.push_back(ptr-d_name);}}closedir(pDir);*/// create output context AVFormatContext* output_ctx NULL;if (avformat_alloc_output_context2(output_ctx, NULL, NULL, mp4_path.c_str()) 0) {fprintf(stderr, Failed to create output context\n);return -1;}//set the max streams number,default is 1000output_ctx-max_streams3000;int video_stream_idx -1;vectorAVFormatContext* input_ctx_list;for(int i0;its_count;i){// open input file char ts[256];sprintf(ts,%s%s%d%s,ts_path.c_str(),/,i,.ts);//string tstmp;printf(%s\n,ts);if(strcmp(.ts,strstr(ts,.ts))!0) continue;AVFormatContext* input_ctx NULL;if (avformat_open_input(input_ctx, ts, NULL, NULL) ! 0) {fprintf(stderr, Failed to open input file %s\n, ts);return -1;}if (avformat_find_stream_info(input_ctx, NULL) 0) {fprintf(stderr, Failed to retrieve input stream information\n);return -1;}input_ctx_list.push_back(input_ctx);// add streams for (int i 0; i input_ctx-nb_streams; i) {AVStream* in_stream input_ctx-streams[i];AVCodecParameters* in_codecpar in_stream-codecpar;if (in_codecpar-codec_type AVMEDIA_TYPE_VIDEO || in_codecpar-codec_type AVMEDIA_TYPE_AUDIO) {AVStream* out_stream avformat_new_stream(output_ctx, NULL);if (!out_stream) {fprintf(stderr, Failed to allocate output stream\n);return -1;}if (avcodec_parameters_copy(out_stream-codecpar, in_codecpar) 0) {fprintf(stderr, Failed to copy codec parameters\n);return -1;}out_stream-codecpar-codec_tag 0;if (in_codecpar-codec_type AVMEDIA_TYPE_VIDEO)video_stream_idx out_stream-index;}}}// open output file if (!(output_ctx-oformat-flags AVFMT_NOFILE)) {if (avio_open(output_ctx-pb, mp4_path.c_str(), AVIO_FLAG_WRITE) 0) {fprintf(stderr, Could not open output file %s\n, mp4_path.c_str());return -1;}}// write header if (avformat_write_header(output_ctx, NULL) 0) {fprintf(stderr, Error occurred when opening output file\n);return -1;}int pkt_cnt 0;// copy packets //int stream_index 0;for(int i0;iinput_ctx_list.size();i){AVFormatContext* input_ctxinput_ctx_list[i];AVPacket packet;int ret 0;while (av_read_frame(input_ctx, packet) 0) {//printf(%d,%d\n,video_stream_idx,packet.stream_index);AVStream* in_stream input_ctx-streams[packet.stream_index];AVStream* out_stream output_ctx-streams[packet.stream_index];// copy packetpacket.pts av_rescale_q_rnd(packet.pts, in_stream-time_base, out_stream-time_base,(AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));packet.dts av_rescale_q_rnd(packet.dts, in_stream-time_base, out_stream-time_base,(AVRounding)(AV_ROUND_NEAR_INF | AV_ROUND_PASS_MINMAX));packet.duration av_rescale_q(packet.duration, in_stream-time_base, out_stream-time_base);//printf(%ld,%ld,%ld\n,packet.pts,packet.dts,packet.duration);packet.pos -1;if (packet.stream_index video_stream_idx) {//printf(Send video %8d\n, pkt_cnt);pkt_cnt;}ret av_interleaved_write_frame(output_ctx, packet);if (ret 0) {fprintf(stderr, Error muxing packet\n);break;}av_packet_unref(packet);}// close input avformat_close_input(input_ctx);}// write trailer if (av_write_trailer(output_ctx) 0) {fprintf(stderr, Error occurred when writing trailer\n);return -1;}// close output if (output_ctx !(output_ctx-oformat-flags AVFMT_NOFILE))avio_closep(output_ctx-pb);avformat_free_context(output_ctx);printf(convert success!\n); return 0; }
http://www.hkea.cn/news/14330483/

相关文章:

  • 淘宝网站建设流程婚纱网站页面设计
  • iis7建设网站可以拿自己电脑做网站
  • 网站服务器升级一般多久专业网站设计 网络服务
  • 网站建设价格是多少公司简介宣传册设计样本图片
  • 乐清市网站建设设计深圳专业建设网站哪个公司好
  • 成都网站平台建设怎么建设自己导购网站
  • 网站建设不用备案的html仿百度页面代码
  • 贵州省住房和城乡建设厅网站搜索24小时通过网站备案
  • 设计一套网站多少钱CMS网站建设优势
  • 天水建设局网站渣土治理腾讯企点app下载安装
  • 建设部网站预应力资质免费大空间网站
  • 网站托管服务wordpress 设置页面
  • app制作过程和网站一样吗旅游类网站模板
  • 骨干校 建设网站手机网站与普通网站的区别
  • 商丘微网站wordpress在哪放商务通代码
  • 龙之向导外贸经理人网站迈网科技 官方网站
  • 济南国画网站济南网站建设公司广州建设投资集团有限公司
  • 网站更新维护西安网站建站
  • 有没有帮人做CAD的网站wordpress文库插件
  • 《网站设计与建设》电子书网站广审怎么做
  • 深圳购物商城网站设计定制开发一款小程序多少钱
  • 伪静态 网站如何扫描妇科医院手机网站
  • 东莞网站建设代理如何买网站
  • 广西网站建设推广大概需要多少钱国内网页设计网站
  • seo服务的三种方式石家庄关键词优化软件
  • 海安县住房和城乡建设局网站wordpress手册 chm
  • 广东石油化工建设集团公司网站电商网站的建设步骤
  • 网站建设与运营公司财务预算全国建设项目竣工验收公示网站
  • 犀牛云做网站一年多少钱网页设计实训报告大专
  • 怎么备份网站数据库大男人直播视频