ffmpeg实现视频切割:

http://blog.csdn.net/dancing_night/article/details/45720255

1、概述

本程序实现把一个视频切割为2个视频,不涉及编解码,最难理解的地方在于pts和dts的计算,要好好看看,不够完美的地方在于没有按照关键帧切割,所以会在切割点花屏,以后改善。

*注:只处理一个视频流和一个音频流,若流多了,估计会crash。

简单说下流程:

打开输入---->打开输出---->根据输入来创建流---->拷贝流设置---->循环读帧---->判断时间点是否到达切割点,并做设置---->设置pts和dts---->写入---->善后

2、代码

[cpp] view plain copy
  1. /*
  2. *最简单的视频切割
  3. *缪国凯 Mickel
  4. *821486004@qq.com
  5. *本程序实现把一个视频切割为2个视频,不涉及编解码,最难理解的地方在于pts和dts的计算,要好好看看
  6. *不够完美的地方在于没有按照关键帧切割,所以会在切割点花屏,以后改善
  7. *注:只处理一个视频流和一个音频流,若流多了,估计会crash
  8. *2015-5-14
  9. */
  10. #include "stdafx.h"
  11. #ifdef __cplusplus
  12. extern"C"
  13. {
  14. #endif
  15. #include <libavformat/avformat.h>
  16. #include "libavcodec/avcodec.h"
  17. #include "libavfilter/avfiltergraph.h"
  18. #include "libavfilter/buffersink.h"
  19. #include "libavfilter/buffersrc.h"
  20. #include "libavutil/avutil.h"
  21. #include "libavutil/opt.h"
  22. #include "libavutil/pixdesc.h"
  23. #include "libswresample\swresample.h"
  24. #include "libavutil\fifo.h"
  25. #include "libavutil/audio_fifo.h"
  26. #pragma comment(lib, "avcodec.lib")
  27. #pragma comment(lib, "avformat.lib")
  28. #pragma comment(lib, "avutil.lib")
  29. //#pragma comment(lib, "avdevice.lib")
  30. #pragma comment(lib, "avfilter.lib")
  31. //#pragma comment(lib, "postproc.lib")
  32. #pragma comment(lib, "swresample.lib")
  33. //#pragma comment(lib, "swscale.lib")
  34. #ifdef __cplusplus
  35. };
  36. #endif
  37. int _tmain(int argc, _TCHAR* argv[])
  38. {
  39. if(argc < 3)
  40. {
  41. printf("no input file!\n");
  42. return -1;
  43. }
  44. AVFormatContext *ifmt_ctx = NULL, *ofmt1_ctx = NULL, *ofmt2_ctx = NULL;
  45. AVStream *out1_vstream = NULL, *out1_astream = NULL;
  46. AVStream *out2_vstream = NULL, *out2_astream = NULL;
  47. char str_out1_filename[10];
  48. char str_out2_filename[10];
  49. sprintf(str_out1_filename, "test1.%s", argv[2]);
  50. sprintf(str_out2_filename, "test2.%s", argv[2]);
  51. int inVideo_StreamIndex = -1,inAudio_StreamIndex = -1;
  52. int ret;
  53. av_register_all();
  54. if ((ret = avformat_open_input(&ifmt_ctx, argv[1], NULL, NULL)) < 0)
  55. {
  56. printf("can not open the in put file format context!\n");
  57. return -1;
  58. }
  59. if ((ret = avformat_find_stream_info(ifmt_ctx, NULL)) < 0)
  60. {
  61. printf("can not find the input stream info!\n");
  62. goto end;
  63. }
  64. avformat_alloc_output_context2(&ofmt1_ctx, NULL, NULL, str_out1_filename);
  65. if (!ofmt1_ctx)
  66. {
  67. printf( "Could not create output1 context\n");
  68. ret = AVERROR_UNKNOWN;
  69. goto end;
  70. }
  71. avformat_alloc_output_context2(&ofmt2_ctx, NULL, NULL, str_out2_filename);
  72. if (!ofmt2_ctx)
  73. {
  74. printf( "Could not create output2 context\n");
  75. ret = AVERROR_UNKNOWN;
  76. goto end;
  77. }
  78. for (int i = 0; i < ifmt_ctx->nb_streams; i++)
  79. {
  80. if (ifmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
  81. {
  82. inVideo_StreamIndex = i;
  83. out1_vstream = avformat_new_stream(ofmt1_ctx, NULL);
  84. out2_vstream = avformat_new_stream(ofmt2_ctx, NULL);
  85. //open decoder
  86. if(0 > avcodec_open2(ifmt_ctx->streams[i]->codec, avcodec_find_decoder(ifmt_ctx->streams[i]->codec->codec_id), NULL))
  87. {
  88. printf("can not find or open video decoder!\n");
  89. goto end;
  90. }
  91. if (!out1_vstream)
  92. {
  93. printf("Failed allocating output1 video stream\n");
  94. ret = AVERROR_UNKNOWN;
  95. goto end;
  96. }
  97. else
  98. {
  99. //copy the settings of AVCodecContext;
  100. if (avcodec_copy_context(out1_vstream->codec, ifmt_ctx->streams[i]->codec) < 0)
  101. {
  102. printf( "Failed to copy context from input to output stream codec context\n");
  103. goto end;
  104. }
  105. out1_vstream->codec->codec_tag = 0;
  106. if(ofmt1_ctx->oformat->flags & AVFMT_GLOBALHEADER)
  107. {
  108. out1_vstream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
  109. }
  110. }
  111. if (!out2_vstream)
  112. {
  113. printf("Failed allocating output1 video stream\n");
  114. ret = AVERROR_UNKNOWN;
  115. goto end;
  116. }
  117. else
  118. {
  119. //copy the settings of AVCodecContext;
  120. if (avcodec_copy_context(out2_vstream->codec, ifmt_ctx->streams[i]->codec) < 0)
  121. {
  122. printf( "Failed to copy context from input to output stream codec context\n");
  123. goto end;
  124. }
  125. out2_vstream->codec->codec_tag = 0;
  126. if(ofmt2_ctx->oformat->flags & AVFMT_GLOBALHEADER)
  127. {
  128. out2_vstream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
  129. }
  130. }
  131. }
  132. else if (ifmt_ctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
  133. {
  134. inAudio_StreamIndex = i;
  135. out1_astream = avformat_new_stream(ofmt1_ctx, NULL);
  136. out2_astream = avformat_new_stream(ofmt2_ctx, NULL);
  137. if (!out1_astream)
  138. {
  139. printf("Failed allocating output1 video stream\n");
  140. ret = AVERROR_UNKNOWN;
  141. goto end;
  142. }
  143. else
  144. {
  145. //copy the settings of AVCodecContext;
  146. if (avcodec_copy_context(out1_astream->codec, ifmt_ctx->streams[i]->codec) < 0)
  147. {
  148. printf( "Failed to copy context from input to output stream codec context\n");
  149. goto end;
  150. }
  151. out1_astream->codec->codec_tag = 0;
  152. if(ofmt1_ctx->oformat->flags & AVFMT_GLOBALHEADER)
  153. {
  154. out1_astream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
  155. }
  156. }
  157. if (!out2_astream)
  158. {
  159. printf("Failed allocating output1 video stream\n");
  160. ret = AVERROR_UNKNOWN;
  161. goto end;
  162. }
  163. else
  164. {
  165. //copy the settings of AVCodecContext;
  166. if (avcodec_copy_context(out2_astream->codec, ifmt_ctx->streams[i]->codec) < 0)
  167. {
  168. printf( "Failed to copy context from input to output stream codec context\n");
  169. goto end;
  170. }
  171. out2_astream->codec->codec_tag = 0;
  172. if(ofmt2_ctx->oformat->flags & AVFMT_GLOBALHEADER)
  173. {
  174. out2_astream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
  175. }
  176. }
  177. }
  178. }
  179. //Dump Format------------------
  180. printf("\n==============Input Video=============\n");
  181. av_dump_format(ifmt_ctx, 0, argv[1], 0);
  182. printf("\n==============Output1============\n");
  183. av_dump_format(ofmt1_ctx, 0, str_out1_filename, 1);
  184. printf("\n==============Output2============\n");
  185. av_dump_format(ofmt2_ctx, 0, str_out1_filename, 1);
  186. printf("\n======================================\n");
  187. //open output1 file
  188. if (!(ofmt1_ctx->oformat->flags & AVFMT_NOFILE))
  189. {
  190. if (avio_open(&ofmt1_ctx->pb, str_out1_filename, AVIO_FLAG_WRITE) < 0)
  191. {
  192. printf( "Could not open output file '%s'", str_out1_filename);
  193. goto end;
  194. }
  195. }
  196. //open output2 file
  197. if (!(ofmt2_ctx->oformat->flags & AVFMT_NOFILE))
  198. {
  199. if (avio_open(&ofmt2_ctx->pb, str_out2_filename, AVIO_FLAG_WRITE) < 0)
  200. {
  201. printf( "Could not open output file '%s'", str_out2_filename);
  202. goto end;
  203. }
  204. }
  205. //write out 1 file header
  206. if (avformat_write_header(ofmt1_ctx, NULL) < 0)
  207. {
  208. printf( "Error occurred when opening video output file\n");
  209. goto end;
  210. }
  211. //write out 2 file header
  212. if (avformat_write_header(ofmt2_ctx, NULL) < 0)
  213. {
  214. printf( "Error occurred when opening video output file\n");
  215. goto end;
  216. }
  217. int splitPtsV = 0;//the real split video pts
  218. int splitDtsV = 0;
  219. int splitPtsA = 0;//the real split audio pts
  220. int splitDtsA = 0;
  221. int videoIndex = 0;//the real video index
  222. int splitTime = 30;//the split time (sec)
  223. AVPacket pkt;
  224. while(1)
  225. {
  226. AVFormatContext *ofmt_ctx;
  227. AVStream *in_stream, *out_stream;
  228. if (av_read_frame(ifmt_ctx, &pkt) < 0)
  229. {
  230. break;
  231. }
  232. in_stream = ifmt_ctx->streams[pkt.stream_index];
  233. if (pkt.stream_index == inVideo_StreamIndex)
  234. {
  235. videoIndex++;
  236. int time = pkt.pts * (((float)in_stream->time_base.num) / ((float)in_stream->time_base.den));
  237. if (time <= splitTime)
  238. {
  239. splitPtsV = pkt.pts;
  240. splitDtsV = pkt.dts;
  241. out_stream = ofmt1_ctx->streams[pkt.stream_index];
  242. ofmt_ctx = ofmt1_ctx;
  243. }
  244. else
  245. {
  246. pkt.pts = pkt.pts - splitPtsV;
  247. pkt.dts = pkt.dts - splitDtsV;
  248. out_stream = ofmt2_ctx->streams[pkt.stream_index];
  249. ofmt_ctx = ofmt2_ctx;
  250. }
  251. }
  252. else if (pkt.stream_index == inAudio_StreamIndex)
  253. {
  254. int time = pkt.pts * (((float)in_stream->time_base.num) / ((float)in_stream->time_base.den));
  255. if (time <= splitTime)
  256. {
  257. splitPtsA = pkt.pts;
  258. splitDtsA = pkt.dts;
  259. out_stream = ofmt1_ctx->streams[pkt.stream_index];
  260. ofmt_ctx = ofmt1_ctx;
  261. }
  262. else
  263. {
  264. pkt.pts = pkt.pts - splitPtsA;
  265. pkt.dts = pkt.dts - splitDtsA;
  266. out_stream = ofmt2_ctx->streams[pkt.stream_index];
  267. ofmt_ctx = ofmt2_ctx;
  268. }
  269. }
  270. 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));
  271. 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));
  272. pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
  273. pkt.pos = -1;
  274. //write into file
  275. if (av_interleaved_write_frame(ofmt_ctx, &pkt) < 0)
  276. {
  277. printf( "Error muxing packet\n");
  278. break;
  279. }
  280. av_free_packet(&pkt);
  281. }
  282. av_write_trailer(ofmt1_ctx);
  283. av_write_trailer(ofmt2_ctx);
  284. end:
  285. avformat_close_input(&ifmt_ctx);
  286. /* close output */
  287. if (ofmt1_ctx && !(ofmt1_ctx->oformat->flags & AVFMT_NOFILE))
  288. avio_close(ofmt1_ctx->pb);
  289. avformat_free_context(ofmt1_ctx);
  290. /* close output */
  291. if (ofmt2_ctx && !(ofmt2_ctx->oformat->flags & AVFMT_NOFILE))
  292. avio_close(ofmt2_ctx->pb);
  293. avformat_free_context(ofmt2_ctx);
  294. return 0;
  295. }

3、下载地址

http://download.csdn.net/detail/dancing_night/8699109

ffmpeg实现视频合并

http://blog.csdn.net/dancing_night/article/details/45724215

1、概述

简单说下流程:

打开输入---->打开输出---->根据输入来创建流---->拷贝流设置---->循环读帧---->判断第一个读完,改输入为第二个---->设置pts和dts---->写入---->善后

2、代码

[cpp] view plain copy
  1. /*
  2. *最简单的视频合并
  3. *缪国凯 Mickel
  4. *821486004@qq.com
  5. *本程序实现把2个视频合并为一个视频,不涉及编解码,但是对视频源有要求,必须是相同的参数
  6. *着重理解第二个视频开始的时候的pts和dts计算
  7. *注:只处理一个视频流和一个音频流,若流多了,估计会crash
  8. *2015-5-14
  9. */
  10. #include "stdafx.h"
  11. #ifdef __cplusplus
  12. extern"C"
  13. {
  14. #endif
  15. #include <libavformat/avformat.h>
  16. #include "libavcodec/avcodec.h"
  17. #include "libavfilter/avfiltergraph.h"
  18. #include "libavfilter/buffersink.h"
  19. #include "libavfilter/buffersrc.h"
  20. #include "libavutil/avutil.h"
  21. #include "libavutil/opt.h"
  22. #include "libavutil/pixdesc.h"
  23. #include "libswresample\swresample.h"
  24. #include "libavutil\fifo.h"
  25. #include "libavutil/audio_fifo.h"
  26. #pragma comment(lib, "avcodec.lib")
  27. #pragma comment(lib, "avformat.lib")
  28. #pragma comment(lib, "avutil.lib")
  29. //#pragma comment(lib, "avdevice.lib")
  30. #pragma comment(lib, "avfilter.lib")
  31. //#pragma comment(lib, "postproc.lib")
  32. #pragma comment(lib, "swresample.lib")
  33. //#pragma comment(lib, "swscale.lib")
  34. #ifdef __cplusplus
  35. };
  36. #endif
  37. AVFormatContext *in1_fmtctx = NULL, *in2_fmtctx = NULL, *out_fmtctx = NULL;
  38. AVStream *out_video_stream = NULL, *out_audio_stream = NULL;
  39. int video_stream_index = -1, audio_stream_index = -1;
  40. int open_input(const char * in1_name, const char * in2_name)
  41. {
  42. int ret = -1;
  43. if ((ret = avformat_open_input(&in1_fmtctx, in1_name, NULL, NULL)) < 0)
  44. {
  45. printf("can not open the first input context!\n");
  46. return ret;
  47. }
  48. if ((ret = avformat_find_stream_info(in1_fmtctx, NULL)) < 0)
  49. {
  50. printf("can not find the first input stream info!\n");
  51. return ret;
  52. }
  53. if ((ret = avformat_open_input(&in2_fmtctx, in2_name, NULL, NULL)) < 0)
  54. {
  55. printf("can not open the first input context!\n");
  56. return ret;
  57. }
  58. if ((ret = avformat_find_stream_info(in2_fmtctx, NULL)) < 0)
  59. {
  60. printf("can not find the second input stream info!\n");
  61. return ret;
  62. }
  63. }
  64. int open_output(const char * out_name)
  65. {
  66. int ret = -1;
  67. if ((ret = avformat_alloc_output_context2(&out_fmtctx, NULL, NULL, out_name)) < 0)
  68. {
  69. printf("can not alloc context for output!\n");
  70. return ret;
  71. }
  72. //new stream for out put
  73. for (int i = 0; i < in1_fmtctx->nb_streams; i++)
  74. {
  75. if (in1_fmtctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO)
  76. {
  77. video_stream_index = i;
  78. out_video_stream = avformat_new_stream(out_fmtctx, NULL);
  79. if (!out_video_stream)
  80. {
  81. printf("Failed allocating output1 video stream\n");
  82. ret = AVERROR_UNKNOWN;
  83. return ret;
  84. }
  85. if ((ret = avcodec_copy_context(out_video_stream->codec, in1_fmtctx->streams[i]->codec)) < 0)
  86. {
  87. printf("can not copy the video codec context!\n");
  88. return ret;
  89. }
  90. out_video_stream->codec->codec_tag = 0;
  91. if(out_fmtctx->oformat->flags & AVFMT_GLOBALHEADER)
  92. {
  93. out_video_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
  94. }
  95. }
  96. else if (in1_fmtctx->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
  97. {
  98. audio_stream_index = i;
  99. out_audio_stream = avformat_new_stream(out_fmtctx, NULL);
  100. if (!out_audio_stream)
  101. {
  102. printf("Failed allocating output1 video stream\n");
  103. ret = AVERROR_UNKNOWN;
  104. return ret;
  105. }
  106. if ((ret = avcodec_copy_context(out_audio_stream->codec, in1_fmtctx->streams[i]->codec)) < 0)
  107. {
  108. printf("can not copy the video codec context!\n");
  109. return ret;
  110. }
  111. out_audio_stream->codec->codec_tag = 0;
  112. if(out_fmtctx->oformat->flags & AVFMT_GLOBALHEADER)
  113. {
  114. out_audio_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
  115. }
  116. }
  117. }
  118. //open output file
  119. if (!(out_fmtctx->oformat->flags & AVFMT_NOFILE))
  120. {
  121. if ((ret = avio_open(&out_fmtctx->pb, out_name, AVIO_FLAG_WRITE)) < 0)
  122. {
  123. printf("can not open the out put file handle!\n");
  124. return ret;
  125. }
  126. }
  127. //write out  file header
  128. if ((ret = avformat_write_header(out_fmtctx, NULL)) < 0)
  129. {
  130. printf( "Error occurred when opening video output file\n");
  131. return ret;
  132. }
  133. }
  134. int _tmain(int argc, _TCHAR* argv[])
  135. {
  136. if(argc < 4)
  137. {
  138. printf("no input file!\n");
  139. return -1;
  140. }
  141. char out_name[20];
  142. sprintf(out_name, "combine.%s", argv[3]);
  143. av_register_all();
  144. if (0 > open_input(argv[1], argv[2]))
  145. {
  146. goto end;
  147. }
  148. if(0 > open_output(out_name))
  149. {
  150. goto end;
  151. }
  152. AVFormatContext *input_ctx = in1_fmtctx;
  153. AVPacket pkt;
  154. int pts_v, pts_a, dts_v, dts_a;
  155. while(1)
  156. {
  157. if(0 > av_read_frame(input_ctx, &pkt))
  158. {
  159. if (input_ctx == in1_fmtctx)
  160. {
  161. float vedioDuraTime, audioDuraTime;
  162. //calc the first media dura time
  163. vedioDuraTime = ((float)input_ctx->streams[video_stream_index]->time_base.num /
  164. (float)input_ctx->streams[video_stream_index]->time_base.den) * ((float)pts_v);
  165. audioDuraTime = ((float)input_ctx->streams[audio_stream_index]->time_base.num /
  166. (float)input_ctx->streams[audio_stream_index]->time_base.den) * ((float)pts_a);
  167. //calc the pts and dts end of the first media
  168. if (audioDuraTime > vedioDuraTime)
  169. {
  170. dts_v = pts_v = audioDuraTime / ((float)input_ctx->streams[video_stream_index]->time_base.num /
  171. (float)input_ctx->streams[video_stream_index]->time_base.den);
  172. dts_a++;
  173. pts_a++;
  174. }
  175. else
  176. {
  177. dts_a = pts_a = vedioDuraTime / ((float)input_ctx->streams[audio_stream_index]->time_base.num /
  178. (float)input_ctx->streams[audio_stream_index]->time_base.den);
  179. dts_v++;
  180. pts_v++;
  181. }
  182. input_ctx = in2_fmtctx;
  183. continue;
  184. }
  185. break;
  186. }
  187. if (pkt.stream_index == video_stream_index)
  188. {
  189. if (input_ctx == in2_fmtctx)
  190. {
  191. pkt.pts += pts_v;
  192. pkt.dts += dts_v;
  193. }
  194. else
  195. {
  196. pts_v = pkt.pts;
  197. dts_v = pkt.dts;
  198. }
  199. }
  200. else if (pkt.stream_index == audio_stream_index)
  201. {
  202. if (input_ctx == in2_fmtctx)
  203. {
  204. pkt.pts += pts_a;
  205. pkt.dts += dts_a;
  206. }
  207. else
  208. {
  209. pts_a = pkt.pts;
  210. dts_a = pkt.dts;
  211. }
  212. }
  213. pkt.pts = av_rescale_q_rnd(pkt.pts, input_ctx->streams[pkt.stream_index]->time_base,
  214. out_fmtctx->streams[pkt.stream_index]->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
  215. pkt.dts = av_rescale_q_rnd(pkt.dts, input_ctx->streams[pkt.stream_index]->time_base,
  216. out_fmtctx->streams[pkt.stream_index]->time_base, (AVRounding)(AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
  217. pkt.pos = -1;
  218. if (av_interleaved_write_frame(out_fmtctx, &pkt) < 0)
  219. {
  220. printf( "Error muxing packet\n");
  221. //break;
  222. }
  223. av_free_packet(&pkt);
  224. }
  225. av_write_trailer(out_fmtctx);
  226. end:
  227. avformat_close_input(&in1_fmtctx);
  228. avformat_close_input(&in2_fmtctx);
  229. /* close output */
  230. if (out_fmtctx && !(out_fmtctx->oformat->flags & AVFMT_NOFILE))
  231. avio_close(out_fmtctx->pb);
  232. avformat_free_context(out_fmtctx);
  233. return 0;
  234. }

3、下载地址

ffmpeg实现视频切割合并相关推荐

  1. 【ffmpeg裁剪视频faster rcnn自动检测 via】全自动实现ffmpeg将视频切割为图片帧,再使用faster rcnn将图片中的人检测出来,最后将检测结果转化为via可识别的csv格式

    目录 前言 一,ffmpeg 自动裁剪 1.1 目录结构 1.2 cutVideoToImage.sh 1.2 myVideo 1.3 myVideo15mins 1.5 myFrames 1.6 运 ...

  2. java使用ffmpeg视频切割聚合截图

    环境信息: 操作系统:centos7 编程语言:java 安装ffmpeg # 安装epel扩展源 sudo yum install -y epel-release # 安装Nux Dextop Yu ...

  3. ffmpeg 将一个视频裁剪多个部分,然后合并所有的裁剪为一个视频

    如果你想利用 ffmpeg 将一个视频裁剪为多个部分,然后合并所有的裁剪为一个视频, 那么你可以执行 : ffmpeg -i input -filter_complex "[0:v:0]se ...

  4. Java使用ffmpeg进行视频格式转换、音视频合并、播放、截图

    封装类: ffplay.ffmpeg.ffprobe是安装的ffmpeg路径. import java.io.BufferedReader; import java.io.File; import j ...

  5. FFmpeg:视频转码、剪切、合并、播放速调整

    安装 去官网按提示安装即可,支持三大操作系统.唯一要吐槽的是,Ubuntu 14.04 等较新的版本,从默认软件列表里移除了 ffmpeg,转而支持 libav,可是 libav 又没弄好,很难用-- ...

  6. python ffmpeg剪辑视频_用ffmpeg快速剪切和合并视频

    如果直接找视频剪切和合并视频的软件,通常出来的都是大的视频编辑软件或者是有图形界面的剪切软件,大型一点的功能太多安装麻烦,小型一点的功能可能不齐全. 只是简单的剪切或者一下合并一下,还是ffmpeg这 ...

  7. 使用ffmpeg从视频文件中提取音频文件、视频抽帧和切割视频

    目录 ffmpeg下载 使用ffmpeg从视频文件中提取音频文件 批量提取文件夹下多个视频文件的音频 使用ffmpeg从视频文件中提取视频帧 使用ffmpeg将按固定时长将视频切割成多个小片段 将分割 ...

  8. C++ 调用 ffmpeg.exe 执行音视频混流合并;

    ffmpeg.exe文件可以去官网下载:FFmpeg 官网似乎不提供32位dll文件的下载了,但是可以下载exe文件来直接调用: #include <iostream> #include ...

  9. python使用danmaku2ass 将xml字幕转换成ass字幕+ffmpeg将ass字幕合并成含有字幕的视频

    文章目录 配置 说明: 一.使用danmaku2ass 将xml字幕转换成ass字幕 项目地址(记得给人家点个赞,我已经默默的点过了): 使用步骤: 1.将项目下载下来, 2.保留danmaku2as ...

  10. FFMPEG将视频切片成ts文件并对ts文件进行ASE加密,并合并成M3U8操作方法

    环境:centos7 开发语言:php 框架:视频转码服务系统 生成ASE加密文件需要用到的命令: #!/bin/sh BASE_URL=${1:-'.'} openssl rand 16 > ...

最新文章

  1. Array 数组去重 总结10方法(7)
  2. 如何在ROS中使用PCL—数据格式(1)
  3. [JAVA] java仿windows 字体设置选项卡
  4. AAAI 2020 | 滴滴东北大学提出自动结构化剪枝压缩算法框架,性能提升高达120倍...
  5. LCS005标准版部署之三
  6. git关闭密码自动存储_RobotFramework实战篇PC端web自动化demo及持续集成
  7. 谁说男生不能美美哒?2020中国男士美妆市场洞察报告.pdf(附下载链接)
  8. 谁说数学好编程就好了?MIT告诉你:不对!
  9. [译]git fetch
  10. 17 java 存在的问题(转)
  11. 前端----HTML
  12. You must install signalwire-client-c to build mod_signalwire
  13. MySQL做学生考勤系统_Jsp+Ssh+Mysql实现的Java Web学生考勤管理系统
  14. 学报格式和论文格式一样吗_求《浙江大学学报》的论文格式要求 - 论文投稿 - 小木虫 - 学术 科研 互动社区...
  15. 网络安全攻防实验室通关教程-注入关
  16. search_web_resources
  17. 将STM32 Flash的一部分虚拟为大容量存储设备 USB_Device
  18. MaximalRectangle
  19. 天耀18期 – 03.Java基本语法【作业】.
  20. mysql存储过程 根据查询的结果集向表中插入数据

热门文章

  1. 资阳停车场系统推荐_专业停车场系统维护业务广泛
  2. 拨号不能建立远程计算机的连接,彻底解决Win8、Win10系统宽带拨号出现“错误720:不能建立到远程计算机的连接”的问题...
  3. php图片加密管理系统,8tupian图片加密平台 v3.0
  4. 什么是m叉树_C#的λ表达式树(LambdaExpression)保姆级超详细简单入门教程
  5. C# 高并发场景下 共享内存 Actor并发模型到底哪个快?
  6. 公网ip经常变动的解决方法
  7. linux 备份 网络配置,如何备份已经配置好的虚拟机linux系统的网络..._网络编辑_帮考网...
  8. 订单业务中如何保证接口的幂等性
  9. html暴风粒子代码,魔兽世界课物品代码及gm指令大全(全部整理自网上).doc
  10. 电脑计算机睡眠和休眠模式区别,电脑休眠和睡眠的区别?