Table of Contents
代码
Home Database Mysql Tutorial FFmpeg封装格式处理:视音频复用器(muxer)

FFmpeg封装格式处理:视音频复用器(muxer)

Jun 07, 2016 pm 04:05 PM
ffmpeg deal with encapsulation beat Format Audio

打算记录一下基于FFmpeg的封装格式处理方面的例子。包括了视音频分离,复用,封装格式转换。这是第3篇。 本文记录一个基于FFmpeg的视音频复用器(Simplest FFmpeg muxer)。视音频复用器(Muxer)即是将视频压缩数据(例如H.264)和音频压缩数据(例如AAC)合

打算记录一下基于FFmpeg的封装格式处理方面的例子。包括了视音频分离,复用,封装格式转换。这是第3篇。

本文记录一个基于FFmpeg的视音频复用器(Simplest FFmpeg muxer)。视音频复用器(Muxer)即是将视频压缩数据(例如H.264)和音频压缩数据(例如AAC)合并到一个封装格式数据(例如MKV)中去。如图所示。在这个过程中并不涉及到编码和解码。

 

\

本文记录的程序将一个H.264编码的视频码流文件和一个MP3编码的音频码流文件,合成为一个MP4封装格式的文件。
,一共初始化了3个AVFormatContext,其中2个用于输入,1个用于输出。3个AVFormatContext初始化之后,通过avcodec_copy_context()函数可以将输入视频/音频的参数拷贝至输出视频/音频的AVCodecContext结构体。然后分别调用视频输入流和音频输入流的av_read_frame(),从视频输入流中取出视频的AVPacket,音频输入流中取出音频的AVPacket,分别将取出的AVPacket写入到输出文件中即可。其间用到了一个不太常见的函数av_compare_ts(),是比较时间戳用的。通过该函数可以决定该写入视频还是音频。

本文介绍的视音频复用器,输入的视频不一定是H.264裸流文件,音频也不一定是纯音频文件。可以选择两个封装过的视音频文件作为输入。程序会从视频输入文件中“挑”出视频流,音频输入文件中“挑”出音频流,再将“挑选”出来的视音频流复用起来。 PS1:对于某些封装格式(例如MP4/FLV/MKV等)中的H.264,需要用到名称为“h264_mp4toannexb”的bitstream filter。
PS2:对于某些封装格式(例如MP4/FLV/MKV等)中的AAC,需要用到名称为“aac_adtstoasc”的bitstream filter。

简单介绍一下流程中各个重要函数的意义:

avformat_open_input():打开输入文件。
avcodec_copy_context():赋值AVCodecContext的参数。
avformat_alloc_output_context2():初始化输出文件。
avio_open():打开输出文件。
avformat_write_header():写入文件头。
av_compare_ts():比较时间戳,决定写入视频还是写入音频。这个函数相对要少见一些。
av_read_frame():从输入文件读取一个AVPacket。
av_interleaved_write_frame():写入一个AVPacket到输出文件。
av_write_trailer():写入文件尾。

代码

下面贴上代码:
<strong>[cpp]</strong> view plaincopy
Copy after login
  1. /**
    Copy after login
  2. * 最简单的基于FFmpeg的视音频复用器
    Copy after login
  3. * Simplest FFmpeg Muxer
    Copy after login
  4. *
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  5. * 雷霄骅 Lei Xiaohua
    Copy after login
  6. * leixiaohua1020@126.com
    Copy after login
  7. * 中国传媒大学/数字电视技术
    Copy after login
  8. * Communication University of China / Digital TV Technology
    Copy after login
  9. * http://blog.csdn.net/leixiaohua1020
    Copy after login
  10. *
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  11. * 本程序可以将视频码流和音频码流打包到一种封装格式中。
    Copy after login
  12. * 程序中将MP3编码的音频码流和H.264编码(MPEG2TS封装中)的视频码流打包成
    Copy after login
  13. * MP4封装格式的文件。
    Copy after login
  14. * 需要注意的是本程序并不改变视音频的编码格式。
    Copy after login
  15. *
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  16. * This software mux a video bitstream and a audio bitstream
    Copy after login
  17. * together into a file.
    Copy after login
  18. * In this example, it mux a H.264 bitstream (in MPEG2TS) and
    Copy after login
  19. * a MP3 bitstream file together into MP4 format file.
    Copy after login
  20. *
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  21. */
    Copy after login
    Copy after login
    Copy after login
  22. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  23. #include <stdio.h></stdio.h>
    Copy after login
  24. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  25. extern "C"
    Copy after login
  26. {
    Copy after login
    Copy after login
  27. #include "libavformat/avformat.h"
    Copy after login
  28. };
    Copy after login
  29. /*
    Copy after login
    Copy after login
  30. FIX: H.264 in some container format (FLV, MP4, MKV etc.) need
    Copy after login
  31. "h264_mp4toannexb" bitstream filter (BSF)
    Copy after login
  32. *Add SPS,PPS in front of IDR frame
    Copy after login
  33. *Add start code ("0,0,0,1") in front of NALU
    Copy after login
  34. H.264 in some container (MPEG2TS) don't need this BSF.
    Copy after login
  35. */
    Copy after login
    Copy after login
    Copy after login
  36. //'1': Use H.264 Bitstream Filter
    Copy after login
  37. #define USE_H264BSF 0
    Copy after login
  38. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  39. /*
    Copy after login
    Copy after login
  40. FIX:AAC in some container format (FLV, MP4, MKV etc.) need
    Copy after login
  41. "aac_adtstoasc" bitstream filter (BSF)
    Copy after login
  42. */
    Copy after login
    Copy after login
    Copy after login
  43. //'1': Use AAC Bitstream Filter
    Copy after login
  44. #define USE_AACBSF 0
    Copy after login
  45. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  46. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  47. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  48. int main(int argc, char* argv[])
    Copy after login
  49. {
    Copy after login
    Copy after login
  50. AVOutputFormat *ofmt = NULL;
    Copy after login
  51. //输入对应一个AVFormatContext,输出对应一个AVFormatContext
    Copy after login
  52. //(Input AVFormatContext and Output AVFormatContext)
    Copy after login
  53. AVFormatContext *ifmt_ctx_v = NULL, *ifmt_ctx_a = NULL,*ofmt_ctx = NULL;
    Copy after login
  54. AVPacket pkt;
    Copy after login
  55. int ret, i;
    Copy after login
  56. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  57. char *in_filename_v = "cuc_ieschool.ts";//输入文件名(Input file URL)
    Copy after login
  58. //char *in_filename_v = "cuc_ieschool.h264";
    Copy after login
  59. //char *in_filename_a = "cuc_ieschool.mp3";
    Copy after login
  60. //char *in_filename_a = "gowest.m4a";
    Copy after login
  61. //char *in_filename_a = "gowest.aac";
    Copy after login
  62. char *in_filename_a = "huoyuanjia.mp3";
    Copy after login
  63. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  64. char *out_filename = "cuc_ieschool.mp4";//输出文件名(Output file URL)
    Copy after login
  65. av_register_all();
    Copy after login
  66. //输入(Input)
    Copy after login
  67. if ((ret = avformat_open_input(&ifmt_ctx_v, in_filename_v, 0, 0)) 
    
    Copy after login
  68. printf( "Could not open input file.");
    Copy after login
    Copy after login
  69. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  70. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  71. if ((ret = avformat_find_stream_info(ifmt_ctx_v, 0)) 
    
    Copy after login
  72. printf( "Failed to retrieve input stream information");
    Copy after login
    Copy after login
  73. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  74. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  75. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  76. if ((ret = avformat_open_input(&ifmt_ctx_a, in_filename_a, 0, 0)) 
    
    Copy after login
  77. printf( "Could not open input file.");
    Copy after login
    Copy after login
  78. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  79. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  80. if ((ret = avformat_find_stream_info(ifmt_ctx_a, 0)) 
    
    Copy after login
  81. printf( "Failed to retrieve input stream information");
    Copy after login
    Copy after login
  82. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  83. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  84. printf("Input Information=====================\n");
    Copy after login
  85. av_dump_format(ifmt_ctx_v, 0, in_filename_v, 0);
    Copy after login
  86. av_dump_format(ifmt_ctx_a, 0, in_filename_a, 0);
    Copy after login
  87. printf("======================================\n");
    Copy after login
    Copy after login
  88. //输出(Output)
    Copy after login
  89. avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, out_filename);
    Copy after login
  90. if (!ofmt_ctx) {
    Copy after login
  91. printf( "Could not create output context\n");
    Copy after login
  92. ret = AVERROR_UNKNOWN;
    Copy after login
    Copy after login
    Copy after login
  93. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  94. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  95. ofmt = ofmt_ctx->oformat;
    Copy after login
  96. int videoindex_v=-1,videoindex_out=-1;
    Copy after login
  97. for (i = 0; i nb_streams; i++) {
    Copy after login
    Copy after login
  98. //根据输入流创建输出流(Create output AVStream according to input AVStream)
    Copy after login
    Copy after login
  99. if(ifmt_ctx_v->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO){
    Copy after login
  100. videoindex_v=i;
    Copy after login
  101. AVStream *in_stream = ifmt_ctx_v->streams[i];
    Copy after login
  102. AVStream *out_stream = avformat_new_stream(ofmt_ctx, in_stream->codec->codec);
    Copy after login
    Copy after login
  103. if (!out_stream) {
    Copy after login
    Copy after login
  104. printf( "Failed allocating output stream\n");
    Copy after login
    Copy after login
  105. ret = AVERROR_UNKNOWN;
    Copy after login
    Copy after login
    Copy after login
  106. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  107. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  108. videoindex_out=out_stream->index;
    Copy after login
  109. //复制AVCodecContext的设置(Copy the settings of AVCodecContext)
    Copy after login
    Copy after login
  110. if (avcodec_copy_context(out_stream->codec, in_stream->codec) 
    
    Copy after login
    Copy after login
  111. printf( "Failed to copy context from input to output stream codec context\n");
    Copy after login
    Copy after login
  112. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  113. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  114. out_stream->codec->codec_tag = 0;
    Copy after login
    Copy after login
  115. if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
    Copy after login
    Copy after login
  116. out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
    Copy after login
    Copy after login
  117. break;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  118. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  119. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  120. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  121. int audioindex_a=-1,audioindex_out=-1;
    Copy after login
  122. for (i = 0; i nb_streams; i++) {
    Copy after login
    Copy after login
  123. //根据输入流创建输出流(Create output AVStream according to input AVStream)
    Copy after login
    Copy after login
  124. if(ifmt_ctx_a->streams[i]->codec->codec_type==AVMEDIA_TYPE_AUDIO){
    Copy after login
  125. audioindex_a=i;
    Copy after login
  126. AVStream *in_stream = ifmt_ctx_a->streams[i];
    Copy after login
  127. AVStream *out_stream = avformat_new_stream(ofmt_ctx, in_stream->codec->codec);
    Copy after login
    Copy after login
  128. if (!out_stream) {
    Copy after login
    Copy after login
  129. printf( "Failed allocating output stream\n");
    Copy after login
    Copy after login
  130. ret = AVERROR_UNKNOWN;
    Copy after login
    Copy after login
    Copy after login
  131. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  132. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  133. audioindex_out=out_stream->index;
    Copy after login
  134. //复制AVCodecContext的设置(Copy the settings of AVCodecContext)
    Copy after login
    Copy after login
  135. if (avcodec_copy_context(out_stream->codec, in_stream->codec) 
    
    Copy after login
    Copy after login
  136. printf( "Failed to copy context from input to output stream codec context\n");
    Copy after login
    Copy after login
  137. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  138. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  139. out_stream->codec->codec_tag = 0;
    Copy after login
    Copy after login
  140. if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
    Copy after login
    Copy after login
  141. out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
    Copy after login
    Copy after login
  142. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  143. break;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  144. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  145. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  146. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  147. //输出一下格式------------------
    Copy after login
  148. printf("Output Information====================\n");
    Copy after login
  149. av_dump_format(ofmt_ctx, 0, out_filename, 1);
    Copy after login
  150. printf("======================================\n");
    Copy after login
    Copy after login
  151. //打开输出文件(Open output file)
    Copy after login
  152. if (!(ofmt->flags & AVFMT_NOFILE)) {
    Copy after login
  153. if (avio_open(&ofmt_ctx->pb, out_filename, AVIO_FLAG_WRITE) 
    
    Copy after login
  154. printf( "Could not open output file '%s'", out_filename);
    Copy after login
  155. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  156. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  157. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  158. //写文件头(Write file header)
    Copy after login
  159. if (avformat_write_header(ofmt_ctx, NULL) 
    
    Copy after login
  160. printf( "Error occurred when opening output file\n");
    Copy after login
  161. goto end;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  162. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  163. int frame_index=0;
    Copy after login
  164. int64_t cur_pts_v=0,cur_pts_a=0;
    Copy after login
  165. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  166. //FIX
    Copy after login
    Copy after login
  167. #if USE_H264BSF
    Copy after login
    Copy after login
    Copy after login
  168. AVBitStreamFilterContext* h264bsfc = av_bitstream_filter_init("h264_mp4toannexb");
    Copy after login
  169. #endif
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  170. #if USE_AACBSF
    Copy after login
    Copy after login
    Copy after login
  171. AVBitStreamFilterContext* aacbsfc = av_bitstream_filter_init("aac_adtstoasc");
    Copy after login
  172. #endif
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  173. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  174. while (1) {
    Copy after login
  175. AVFormatContext *ifmt_ctx;
    Copy after login
  176. int stream_index=0;
    Copy after login
  177. AVStream *in_stream, *out_stream;
    Copy after login
  178. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  179. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  180. //获取一个AVPacket(Get an AVPacket)
    Copy after login
  181. if(av_compare_ts(cur_pts_v,ifmt_ctx_v->streams[videoindex_v]->time_base,cur_pts_a,ifmt_ctx_a->streams[audioindex_a]->time_base) 
    
    Copy after login
  182. ifmt_ctx=ifmt_ctx_v;
    Copy after login
  183. stream_index=videoindex_out;
    Copy after login
  184. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  185. if(av_read_frame(ifmt_ctx, &pkt) >= 0){
    Copy after login
    Copy after login
  186. do{
    Copy after login
    Copy after login
  187. if(pkt.stream_index==videoindex_v){
    Copy after login
  188. cur_pts_v=pkt.pts;
    Copy after login
  189. break;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  190. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  191. }while(av_read_frame(ifmt_ctx, &pkt) >= 0);
    Copy after login
    Copy after login
  192. }else{
    Copy after login
    Copy after login
    Copy after login
  193. break;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  194. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  195. }else{
    Copy after login
    Copy after login
    Copy after login
  196. ifmt_ctx=ifmt_ctx_a;
    Copy after login
  197. stream_index=audioindex_out;
    Copy after login
  198. if(av_read_frame(ifmt_ctx, &pkt) >= 0){
    Copy after login
    Copy after login
  199. do{
    Copy after login
    Copy after login
  200. if(pkt.stream_index==audioindex_a){
    Copy after login
  201. cur_pts_a=pkt.pts;
    Copy after login
  202. break;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  203. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  204. }while(av_read_frame(ifmt_ctx, &pkt) >= 0);
    Copy after login
    Copy after login
  205. }else{
    Copy after login
    Copy after login
    Copy after login
  206. break;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  207. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  208. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  209. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  210. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  211. in_stream = ifmt_ctx->streams[pkt.stream_index];
    Copy after login
  212. out_stream = ofmt_ctx->streams[stream_index];
    Copy after login
  213. //FIX
    Copy after login
    Copy after login
  214. #if USE_H264BSF
    Copy after login
    Copy after login
    Copy after login
  215. av_bitstream_filter_filter(h264bsfc, in_stream->codec, NULL, &pkt.data, &pkt.size, pkt.data, pkt.size, 0);
    Copy after login
  216. #endif
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  217. #if USE_AACBSF
    Copy after login
    Copy after login
    Copy after login
  218. av_bitstream_filter_filter(aacbsfc, in_stream->codec, NULL, &pkt.data, &pkt.size, pkt.data, pkt.size, 0);
    Copy after login
  219. #endif
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  220. //FIX:No PTS (Example: Raw H.264)
    Copy after login
  221. //Simple Write PTS
    Copy after login
  222. if(pkt.pts==AV_NOPTS_VALUE){
    Copy after login
  223. //Write PTS
    Copy after login
  224. AVRational time_base1=in_stream->time_base;
    Copy after login
  225. //Duration between 2 frames (us)
    Copy after login
  226. int64_t calc_duration=(double)AV_TIME_BASE/av_q2d(in_stream->r_frame_rate);
    Copy after login
  227. //Parameters
    Copy after login
  228. pkt.pts=(double)(frame_index*calc_duration)/(double)(av_q2d(time_base1)*AV_TIME_BASE);
    Copy after login
  229. pkt.dts=pkt.pts;
    Copy after login
  230. pkt.duration=(double)calc_duration/(double)(av_q2d(time_base1)*AV_TIME_BASE);
    Copy after login
  231. frame_index++;
    Copy after login
  232. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  233. /* copy packet */
    Copy after login
  234. //转换PTS/DTS(Convert PTS/DTS)
    Copy after login
  235. 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));
    Copy after login
  236. 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));
    Copy after login
  237. pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
    Copy after login
  238. pkt.pos = -1;
    Copy after login
  239. pkt.stream_index=stream_index;
    Copy after login
  240. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  241. printf("Write 1 Packet. size:%5d\tpts:%8d\n",pkt.size,pkt.pts);
    Copy after login
  242. //写入(Write)
    Copy after login
  243. if (av_interleaved_write_frame(ofmt_ctx, &pkt) 
    
    Copy after login
  244. printf( "Error muxing packet\n");
    Copy after login
  245. break;
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  246. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  247. av_free_packet(&pkt);
    Copy after login
  248. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  249. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  250. //写文件尾(Write file trailer)
    Copy after login
  251. av_write_trailer(ofmt_ctx);
    Copy after login
  252. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  253. #if USE_H264BSF
    Copy after login
    Copy after login
    Copy after login
  254. av_bitstream_filter_close(h264bsfc);
    Copy after login
  255. #endif
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  256. #if USE_AACBSF
    Copy after login
    Copy after login
    Copy after login
  257. av_bitstream_filter_close(aacbsfc);
    Copy after login
  258. #endif
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  259. Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  260. end:
    Copy after login
  261. avformat_close_input(&ifmt_ctx_v);
    Copy after login
  262. avformat_close_input(&ifmt_ctx_a);
    Copy after login
  263. /* close output */
    Copy after login
  264. if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))
    Copy after login
  265. avio_close(ofmt_ctx->pb);
    Copy after login
  266. avformat_free_context(ofmt_ctx);
    Copy after login
  267. if (ret 
    
    Copy after login
  268. printf( "Error occurred.\n");
    Copy after login
  269. return -1;
    Copy after login
  270. }
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
    Copy after login
  271. return 0;
    Copy after login
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to adjust audio balance in Win11? (Win11 adjusts the left and right channels of volume) How to adjust audio balance in Win11? (Win11 adjusts the left and right channels of volume) Feb 11, 2024 pm 05:57 PM

When listening to music or watching movies on a Win11 computer, if the speakers or headphones sound unbalanced, users can manually adjust the balance level according to their needs. So how do we adjust? In response to this problem, the editor has brought a detailed operation tutorial, hoping to help everyone. How to balance left and right audio channels in Windows 11? Method 1: Use the Settings app to tap the key and click Settings. Windows click System and select Sound. Choose more sound settings. Click on your speakers/headphones and select Properties. Navigate to the Levels tab and click Balance. Make sure "left" and

Bose Soundbar Ultra launch experience: Home theater right out of the box? Bose Soundbar Ultra launch experience: Home theater right out of the box? Feb 06, 2024 pm 05:30 PM

For as long as I can remember, I have had a pair of large floor-standing speakers at home. I have always believed that a TV can only be called a TV if it is equipped with a complete sound system. But when I first started working, I couldn’t afford professional home audio. After inquiring and understanding the product positioning, I found that the sound bar category is very suitable for me. It meets my needs in terms of sound quality, size and price. Therefore, I decided to go with the soundbar. After careful selection, I selected this panoramic soundbar product launched by Bose in early 2024: Bose home entertainment speaker Ultra. (Photo source: Photographed by Lei Technology) Generally speaking, if we want to experience the "original" Dolby Atmos effect, we need to install a measured and calibrated surround sound + ceiling at home.

The operation process of WIN10 service host occupying too much CPU The operation process of WIN10 service host occupying too much CPU Mar 27, 2024 pm 02:41 PM

1. First, we right-click the blank space of the taskbar and select the [Task Manager] option, or right-click the start logo, and then select the [Task Manager] option. 2. In the opened Task Manager interface, we click the [Services] tab on the far right. 3. In the opened [Service] tab, click the [Open Service] option below. 4. In the [Services] window that opens, right-click the [InternetConnectionSharing(ICS)] service, and then select the [Properties] option. 5. In the properties window that opens, change [Open with] to [Disabled], click [Apply] and then click [OK]. 6. Click the start logo, then click the shutdown button, select [Restart], and complete the computer restart.

How to write the qq mailbox format? What is the qq mailbox format? How to write the qq mailbox format? What is the qq mailbox format? Feb 22, 2024 pm 03:40 PM

QQ email: QQ number@qq.com, English QQ email: English or numbers@qq.com, foxmail email account: set up your own account@foxmail.com, mobile phone email account: mobile phone number@qq.com. Tutorial Applicable Model: iPhone13 System: IOS15.3 Version: QQ Mailbox 6.3.3 Analysis 1QQ mailbox has four formats, commonly used QQ mailbox: QQ number@qq.com, English QQ mailbox: English or numbers@qq.com, foxmail Email account: set up your own account@foxmail.com, mobile phone email account: mobile phone number@qq.com. Supplement: What is qq mailbox? 1 The earliest QQ mailbox was only between QQ users

Installation of Realtek HD audio driver failed with error 0x00005b3 Installation of Realtek HD audio driver failed with error 0x00005b3 Feb 19, 2024 am 10:42 AM

If you encounter RealtekHD audio driver failure error code 0x00005b3 on Windows 11/10 PC, please refer to the following steps to resolve the issue. We'll guide you through troubleshooting and resolving the error. Error code 0x00005b3 may be caused by audio driver installation issues. It may be that the current driver is corrupted or partially uninstalled, affecting the installation of the new driver. This issue can also be caused by insufficient disk space or an audio driver that is incompatible with your Windows version. Installation of RealtekHD audio driver failed! ! [Error Code: 0x00005B3] If there is a problem with the Realtek Audio Driver Installation Wizard, continue reading

Learn how to handle special characters and convert single quotes in PHP Learn how to handle special characters and convert single quotes in PHP Mar 27, 2024 pm 12:39 PM

In the process of PHP development, dealing with special characters is a common problem, especially in string processing, special characters are often escaped. Among them, converting special characters into single quotes is a relatively common requirement, because in PHP, single quotes are a common way to wrap strings. In this article, we will explain how to handle special character conversion single quotes in PHP and provide specific code examples. In PHP, special characters include but are not limited to single quotes ('), double quotes ("), backslash (), etc. In strings

TrendForce: Nvidia's Blackwell platform products drive TSMC's CoWoS production capacity to increase by 150% this year TrendForce: Nvidia's Blackwell platform products drive TSMC's CoWoS production capacity to increase by 150% this year Apr 17, 2024 pm 08:00 PM

According to news from this site on April 17, TrendForce recently released a report, believing that demand for Nvidia's new Blackwell platform products is bullish, and is expected to drive TSMC's total CoWoS packaging production capacity to increase by more than 150% in 2024. NVIDIA Blackwell's new platform products include B-series GPUs and GB200 accelerator cards integrating NVIDIA's own GraceArm CPU. TrendForce confirms that the supply chain is currently very optimistic about GB200. It is estimated that shipments in 2025 are expected to exceed one million units, accounting for 40-50% of Nvidia's high-end GPUs. Nvidia plans to deliver products such as GB200 and B100 in the second half of the year, but upstream wafer packaging must further adopt more complex products.

How to install PHP FFmpeg extension on server? How to install PHP FFmpeg extension on server? Mar 28, 2024 pm 02:39 PM

How to install PHPFFmpeg extension on server? Installing the PHPFFmpeg extension on the server can help us process audio and video files in PHP projects and implement functions such as encoding, decoding, editing, and processing of audio and video files. This article will introduce how to install the PHPFFmpeg extension on the server, as well as specific code examples. First, we need to ensure that PHP and FFmpeg are installed on the server. If FFmpeg is not installed, you can follow the steps below to install FFmpe

See all articles