学习了雷神的文章,慕斯人分享精神,感其英年而逝,不胜唏嘘。他有分享一个转码程序《最简单的基于FFMPEG的转码程序》其中使用了filter(参考了ffmpeg.c中的流程),他曾说想再编写一个不需要filter的版本,可惜未有机会。恰好工作中有相关ffmpeg处理内容,故狗尾续貂,撰写本文。

相关流程:

1.打开输入文件

2.打开输出文件

3.设置解码环境

4.设置输出流信息

5.设置编码环境

6.打开输入流循环读取,解码再编码写入

7.fflush解码和编码ctx

8.关闭文件

本文的代码,为了支持视频精确剪辑,因为GOP关键帧问题,需要使用解码再编码,在编码中对时间做校验

使用方式:

  1. ./mycut input output start end

  如,截取1到10秒的视频:

代码如下:

  1. // mycut.cpp
  2. extern "C"
  3. {
  4. #include <libavutil/time.h>
  5. #include <libavutil/timestamp.h>
  6. #include <libavformat/avformat.h>
  7. #include <libavformat/avio.h>
  8. #include <libavfilter/avfiltergraph.h>
  9. #include <libavfilter/buffersink.h>
  10. #include <libavfilter/buffersrc.h>
  11. #include <libavutil/opt.h>
  12. #include <libavutil/imgutils.h>
  13.  
  14. #include <sys/types.h>
  15. #include <unistd.h>
  16. #include <sys/socket.h>
  17. #include <arpa/inet.h>
  18. #include <strings.h>
  19. #include <stdio.h>
  20. #include <sys/stat.h>
  21. #include <fcntl.h>
  22. #include <errno.h>
  23. #include <sys/file.h>
  24. #include <signal.h>
  25. #include <sys/wait.h>
  26. #include <time.h> // time_t, tm, time, localtime, strftime
  27. #include <sys/time.h> // time_t, tm, time, localtime, strftime
  28. }
  29.  
  30. #define TIME_DEN 1000
  31.  
  32. // Returns the local date/time formatted as 2014-03-19 11:11:52
  33. char* getFormattedTime(void);
  34.  
  35. // Remove path from filename
  36. #define __SHORT_FILE__ (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__)
  37.  
  38. // Main log macro
  39. //#define __LOG__(format, loglevel, ...) printf("%s %-5s [%s] [%s:%d] " format "\n", getFormattedTime(), loglevel, __func__, __SHORT_FILE__, __LINE__, ## __VA_ARGS__)
  40. #define __LOG__(format, loglevel, ...) printf("%ld %-5s [%s] [%s:%d] " format "\n", current_timestamp(), loglevel, __func__, __SHORT_FILE__, __LINE__, ## __VA_ARGS__)
  41.  
  42. // Specific log macros with
  43. #define LOGDEBUG(format, ...) __LOG__(format, "DEBUG", ## __VA_ARGS__)
  44. #define LOGWARN(format, ...) __LOG__(format, "WARN", ## __VA_ARGS__)
  45. #define LOGERROR(format, ...) __LOG__(format, "ERROR", ## __VA_ARGS__)
  46. #define LOGINFO(format, ...) __LOG__(format, "INFO", ## __VA_ARGS__)
  47.  
  48. // Returns the local date/time formatted as 2014-03-19 11:11:52
  49. char* getFormattedTime(void) {
  50.  
  51. time_t rawtime;
  52. struct tm* timeinfo;
  53.  
  54. time(&rawtime);
  55. timeinfo = localtime(&rawtime);
  56.  
  57. // Must be static, otherwise won't work
  58. static char _retval[26];
  59. strftime(_retval, sizeof(_retval), "%Y-%m-%d %H:%M:%S", timeinfo);
  60.  
  61. return _retval;
  62. }
  63.  
  64. long long current_timestamp() {
  65. struct timeval te;
  66. gettimeofday(&te, NULL); // get current time
  67. long long milliseconds = te.tv_sec*1000LL + te.tv_usec/1000; // calculate milliseconds
  68. // printf("milliseconds: %lld\n", milliseconds);
  69. return milliseconds;
  70. }
  71.  
  72. static int encode_and_save_pkt(AVCodecContext *enc_ctx, AVFormatContext *ofmt_ctx, AVStream *out_stream)
  73. {
  74. AVPacket enc_pkt;
  75. av_init_packet(&enc_pkt);
  76. enc_pkt.data = NULL;
  77. enc_pkt.size = 0;
  78.  
  79. int ret = 0;
  80. while (ret >= 0)
  81. {
  82. ret = avcodec_receive_packet(enc_ctx, &enc_pkt);
  83. if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
  84. {
  85. ret = 0;
  86. break;
  87. }
  88.  
  89. else if (ret < 0)
  90. {
  91. printf("[avcodec_receive_packet]Error during encoding, ret:%d\n", ret);
  92. break;
  93. }
  94. LOGDEBUG("encode type:%d pts:%d dts:%d\n", enc_ctx->codec_type, enc_pkt.pts, enc_pkt.dts);
  95.  
  96. /* rescale output packet timestamp values from codec to stream timebase */
  97. av_packet_rescale_ts(&enc_pkt, enc_ctx->time_base, out_stream->time_base);
  98. enc_pkt.stream_index = out_stream->index;
  99.  
  100. ret = av_interleaved_write_frame(ofmt_ctx, &enc_pkt);
  101. if (ret < 0)
  102. {
  103. printf("write frame error, ret:%d\n", ret);
  104. break;
  105. }
  106.  
  107. av_packet_unref(&enc_pkt);
  108. }
  109. return ret;
  110. }
  111.  
  112. static int decode_and_send_frame(AVCodecContext *dec_ctx, AVCodecContext *enc_ctx, int start, int end)
  113. {
  114. AVFrame *frame = av_frame_alloc();
  115. int ret = 0;
  116.  
  117. while (ret >= 0)
  118. {
  119. ret = avcodec_receive_frame(dec_ctx, frame);
  120. if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF)
  121. {
  122. ret = 0;
  123. break;
  124. }
  125. else if (ret < 0)
  126. {
  127. printf("Error while receiving a frame from the decoder");
  128. break;
  129. }
  130. int pts = frame->pts;
  131. LOGDEBUG("decode type:%d pts:%d\n", dec_ctx->codec_type, pts);
  132. if ((pts < start*TIME_DEN) || (pts > end*TIME_DEN)) { // 数据裁剪
  133. continue;
  134. }
  135. frame->pict_type = AV_PICTURE_TYPE_NONE;
  136. // 修改pts
  137. frame->pts = pts - start*TIME_DEN;
  138. //printf("pts:%d\n", frame->pts);
  139.  
  140. ret = avcodec_send_frame(enc_ctx, frame);
  141. if (ret < 0)
  142. {
  143. printf("Error sending a frame for encoding\n");
  144. break;
  145. }
  146. }
  147. av_frame_free(&frame);
  148. return ret;
  149. }
  150.  
  151. static int open_decodec_context(int *stream_idx,
  152. AVCodecContext **dec_ctx, AVFormatContext *fmt_ctx, enum AVMediaType type)
  153. {
  154. int ret, stream_index;
  155. AVStream *st;
  156. AVCodec *dec = NULL;
  157. AVDictionary *opts = NULL;
  158.  
  159. ret = av_find_best_stream(fmt_ctx, type, -1, -1, &dec, 0);
  160. if (ret < 0)
  161. {
  162. fprintf(stderr, "Could not find %s stream in input file \n",
  163. av_get_media_type_string(type));
  164. return ret;
  165. }
  166. else
  167. {
  168. stream_index = ret;
  169. st = fmt_ctx->streams[stream_index];
  170.  
  171. /* Allocate a codec context for the decoder */
  172. *dec_ctx = avcodec_alloc_context3(dec);
  173. if (!*dec_ctx)
  174. {
  175. fprintf(stderr, "Failed to allocate the %s codec context\n",
  176. av_get_media_type_string(type));
  177. return AVERROR(ENOMEM);
  178. }
  179.  
  180. /* Copy codec parameters from input stream to output codec context */
  181. if ((ret = avcodec_parameters_to_context(*dec_ctx, st->codecpar)) < 0)
  182. {
  183. fprintf(stderr, "Failed to copy %s codec parameters to decoder context\n",
  184. av_get_media_type_string(type));
  185. return ret;
  186. }
  187.  
  188. if ((*dec_ctx)->codec_type == AVMEDIA_TYPE_VIDEO)
  189. (*dec_ctx)->framerate = av_guess_frame_rate(fmt_ctx, st, NULL);
  190.  
  191. /* Init the decoders, with or without reference counting */
  192. av_dict_set_int(&opts, "refcounted_frames", 1, 0);
  193. if ((ret = avcodec_open2(*dec_ctx, dec, &opts)) < 0)
  194. {
  195. fprintf(stderr, "Failed to open %s codec\n",
  196. av_get_media_type_string(type));
  197. return ret;
  198. }
  199. *stream_idx = stream_index;
  200. }
  201.  
  202. return 0;
  203. }
  204.  
  205. static int set_encode_option(AVCodecContext *dec_ctx, AVDictionary **opt)
  206. {
  207. const char *profile = avcodec_profile_name(dec_ctx->codec_id, dec_ctx->profile);
  208. if (profile)
  209. {
  210. if (!strcasecmp(profile, "high"))
  211. {
  212. av_dict_set(opt, "profile", "high", 0);
  213. }
  214. }
  215. else
  216. {
  217. av_dict_set(opt, "profile", "main", 0);
  218. }
  219.  
  220. av_dict_set(opt, "threads", "16", 0);
  221.  
  222. av_dict_set(opt, "preset", "slow", 0);
  223. av_dict_set(opt, "level", "4.0", 0);
  224.  
  225. return 0;
  226. }
  227.  
  228. static int open_encodec_context(int stream_index, AVCodecContext **oenc_ctx, AVFormatContext *fmt_ctx, enum AVMediaType type)
  229. {
  230. int ret;
  231. AVStream *st;
  232. AVCodec *encoder = NULL;
  233. AVDictionary *opts = NULL;
  234. AVCodecContext *enc_ctx;
  235.  
  236. st = fmt_ctx->streams[stream_index];
  237.  
  238. /* find encoder for the stream */
  239. encoder = avcodec_find_encoder(st->codecpar->codec_id);
  240. if (!encoder)
  241. {
  242. fprintf(stderr, "Failed to find %s codec\n",
  243. av_get_media_type_string(type));
  244. return AVERROR(EINVAL);
  245. }
  246.  
  247. enc_ctx = avcodec_alloc_context3(encoder);
  248. if (!enc_ctx)
  249. {
  250. printf("Failed to allocate the encoder context\n");
  251. return AVERROR(ENOMEM);
  252. }
  253.  
  254. AVCodecContext *dec_ctx = st->codec;
  255. if (type == AVMEDIA_TYPE_VIDEO)
  256. {
  257. enc_ctx->height = dec_ctx->height;
  258. enc_ctx->width = dec_ctx->width;
  259. enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
  260.  
  261. enc_ctx->bit_rate = dec_ctx->bit_rate;
  262. enc_ctx->rc_max_rate = dec_ctx->bit_rate;
  263. enc_ctx->rc_buffer_size = dec_ctx->bit_rate;
  264. enc_ctx->bit_rate_tolerance = 0;
  265. // use yuv420P
  266. enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P;
  267. // set frame rate
  268. enc_ctx->time_base.num = 1;
  269. enc_ctx->time_base.den = TIME_DEN;
  270.  
  271. enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
  272. enc_ctx->has_b_frames = false;
  273. enc_ctx->max_b_frames = 0;
  274. enc_ctx->gop_size = 120;
  275.  
  276. set_encode_option(dec_ctx, &opts);
  277. }
  278. else if (type == AVMEDIA_TYPE_AUDIO)
  279. {
  280. enc_ctx->sample_rate = dec_ctx->sample_rate;
  281. enc_ctx->channel_layout = dec_ctx->channel_layout;
  282. enc_ctx->channels = av_get_channel_layout_nb_channels(enc_ctx->channel_layout);
  283. /* take first format from list of supported formats */
  284. enc_ctx->sample_fmt = encoder->sample_fmts[0];
  285. enc_ctx->time_base = (AVRational){1, TIME_DEN};
  286. enc_ctx->bit_rate = dec_ctx->bit_rate;
  287. enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
  288. }
  289. else
  290. {
  291. ret = avcodec_copy_context(enc_ctx, st->codec);
  292. if (ret < 0)
  293. {
  294. fprintf(stderr, "Failed to copy context from input to output stream codec context\n");
  295. return ret;
  296. }
  297. }
  298.  
  299. if ((ret = avcodec_open2(enc_ctx, encoder, &opts)) < 0)
  300. {
  301. fprintf(stderr, "Failed to open %s codec\n",
  302. av_get_media_type_string(type));
  303. return ret;
  304. }
  305.  
  306. *oenc_ctx = enc_ctx;
  307. return 0;
  308. }
  309. int test_cut(char *input_file, char *output_file, int start, int end)
  310. {
  311. int ret = 0;
  312.  
  313. av_register_all();
  314.  
  315. // 输入流
  316. AVFormatContext *ifmt_ctx = NULL;
  317. AVCodecContext *video_dec_ctx = NULL;
  318. AVCodecContext *audio_dec_ctx = NULL;
  319. char *flv_name = input_file;
  320. int video_stream_idx = 0;
  321. int audio_stream_idx = 1;
  322.  
  323. // 输出流
  324. AVFormatContext *ofmt_ctx = NULL;
  325. AVCodecContext *audio_enc_ctx = NULL;
  326. AVCodecContext *video_enc_ctx = NULL;
  327.  
  328. if ((ret = avformat_open_input(&ifmt_ctx, flv_name, 0, 0)) < 0)
  329. {
  330. printf("Could not open input file '%s' ret:%d\n", flv_name, ret);
  331. goto end;
  332. }
  333.  
  334. if ((ret = avformat_find_stream_info(ifmt_ctx, 0)) < 0)
  335. {
  336. printf("Failed to retrieve input stream information");
  337. goto end;
  338. }
  339.  
  340. if (open_decodec_context(&video_stream_idx, &video_dec_ctx, ifmt_ctx, AVMEDIA_TYPE_VIDEO) < 0)
  341. {
  342. printf("fail to open vedio decode context, ret:%d\n", ret);
  343. goto end;
  344. }
  345. if (open_decodec_context(&audio_stream_idx, &audio_dec_ctx, ifmt_ctx, AVMEDIA_TYPE_AUDIO) < 0)
  346. {
  347. printf("fail to open audio decode context, ret:%d\n", ret);
  348. goto end;
  349. }
  350. av_dump_format(ifmt_ctx, 0, input_file, 0);
  351.  
  352. // 设置输出
  353. avformat_alloc_output_context2(&ofmt_ctx, NULL, NULL, output_file);
  354. if (!ofmt_ctx)
  355. {
  356. printf("can not open ouout context");
  357. goto end;
  358. }
  359.  
  360. // video stream
  361. AVStream *out_stream;
  362. out_stream = avformat_new_stream(ofmt_ctx, NULL);
  363. if (!out_stream)
  364. {
  365. printf("Failed allocating output stream\n");
  366. ret = AVERROR_UNKNOWN;
  367. goto end;
  368. }
  369. if ((ret = open_encodec_context(video_stream_idx, &video_enc_ctx, ifmt_ctx, AVMEDIA_TYPE_VIDEO)) < 0)
  370. {
  371. printf("video enc ctx init err\n");
  372. goto end;
  373. }
  374. ret = avcodec_parameters_from_context(out_stream->codecpar, video_enc_ctx);
  375. if (ret < 0)
  376. {
  377. printf("Failed to copy codec parameters\n");
  378. goto end;
  379. }
  380. video_enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
  381. out_stream->time_base = video_enc_ctx->time_base;
  382. out_stream->codecpar->codec_tag = 0;
  383.  
  384. // audio stream
  385. out_stream = avformat_new_stream(ofmt_ctx, NULL);
  386. if (!out_stream)
  387. {
  388. printf("Failed allocating output stream\n");
  389. ret = AVERROR_UNKNOWN;
  390. goto end;
  391. }
  392.  
  393. if ((ret = open_encodec_context(audio_stream_idx, &audio_enc_ctx, ifmt_ctx, AVMEDIA_TYPE_AUDIO)) < 0)
  394. {
  395. printf("audio enc ctx init err\n");
  396. goto end;
  397. }
  398. ret = avcodec_parameters_from_context(out_stream->codecpar, audio_enc_ctx);
  399. if (ret < 0)
  400. {
  401. printf("Failed to copy codec parameters\n");
  402. goto end;
  403. }
  404. audio_enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
  405. out_stream->time_base = audio_enc_ctx->time_base;
  406. out_stream->codecpar->codec_tag = 0;
  407.  
  408. av_dump_format(ofmt_ctx, 0, output_file, 1);
  409.  
  410. // 打开文件
  411. if (!(ofmt_ctx->oformat->flags & AVFMT_NOFILE))
  412. {
  413. ret = avio_open(&ofmt_ctx->pb, output_file, AVIO_FLAG_WRITE);
  414. if (ret < 0)
  415. {
  416. printf("Could not open output file '%s'\n", output_file);
  417. goto end;
  418. }
  419. }
  420.  
  421. ret = avformat_write_header(ofmt_ctx, NULL);
  422. if (ret < 0)
  423. {
  424. printf("Error occurred when opening output file\n");
  425. goto end;
  426. }
  427.  
  428. AVPacket flv_pkt;
  429. int stream_index;
  430. while (1)
  431. {
  432. AVPacket *pkt = &flv_pkt;
  433. ret = av_read_frame(ifmt_ctx, pkt);
  434. if (ret < 0)
  435. {
  436. break;
  437. }
  438.  
  439. if (pkt->stream_index == video_stream_idx && (pkt->flags & AV_PKT_FLAG_KEY))
  440. {
  441. printf("pkt.dts = %ld pkt.pts = %ld pkt.stream_index = %d is key frame\n", pkt->dts, pkt->pts, pkt->stream_index);
  442. }
  443. stream_index = pkt->stream_index;
  444.  
  445. if (pkt->stream_index == video_stream_idx)
  446. {
  447. ret = avcodec_send_packet(video_dec_ctx, pkt);
  448. LOGDEBUG("read type:%d pts:%d dts:%d\n", video_dec_ctx->codec_type, pkt->pts, pkt->dts);
  449.  
  450. ret = decode_and_send_frame(video_dec_ctx, video_enc_ctx, start, end);
  451. ret = encode_and_save_pkt(video_enc_ctx, ofmt_ctx, ofmt_ctx->streams[0]);
  452. if (ret < 0)
  453. {
  454. printf("re encode video error, ret:%d\n", ret);
  455. }
  456. }
  457. else if (pkt->stream_index == audio_stream_idx)
  458. {
  459. ret = avcodec_send_packet(audio_dec_ctx, pkt);
  460. LOGDEBUG("read type:%d pts:%d dts:%d\n", audio_dec_ctx->codec_type, pkt->pts, pkt->dts);
  461.  
  462. ret = decode_and_send_frame(audio_dec_ctx, audio_enc_ctx, start, end);
  463. ret = encode_and_save_pkt(audio_enc_ctx, ofmt_ctx, ofmt_ctx->streams[1]);
  464. if (ret < 0)
  465. {
  466. printf("re encode audio error, ret:%d\n", ret);
  467. }
  468. }
  469. av_packet_unref(pkt);
  470. }
  471. // fflush
  472. // fflush encode
  473. avcodec_send_packet(video_dec_ctx, NULL);
  474. decode_and_send_frame(video_dec_ctx, video_enc_ctx, start, end);
  475. avcodec_send_packet(audio_dec_ctx, NULL);
  476. decode_and_send_frame(audio_dec_ctx, audio_enc_ctx, start, end);
  477. // fflush decode
  478. avcodec_send_frame(video_enc_ctx, NULL);
  479. encode_and_save_pkt(video_enc_ctx, ofmt_ctx, ofmt_ctx->streams[0]);
  480. avcodec_send_frame(audio_enc_ctx, NULL);
  481. encode_and_save_pkt(audio_enc_ctx, ofmt_ctx, ofmt_ctx->streams[1]);
  482. LOGDEBUG("stream end\n");
  483. av_write_trailer(ofmt_ctx);
  484.  
  485. end:
  486. avformat_close_input(&ifmt_ctx);
  487. if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE))
  488. avio_closep(&ofmt_ctx->pb);
  489. avformat_free_context(ofmt_ctx);
  490.  
  491. avcodec_free_context(&video_dec_ctx);
  492. avcodec_free_context(&audio_dec_ctx);
  493.  
  494. return ret;
  495. }
  496.  
  497. int main(int argc, char **argv)
  498. {
  499. int ret = 0;
  500. if (argc < 5)
  501. {
  502. printf("Usage: %s input output start end \n", argv[0]);
  503. return 1;
  504. }
  505. char *input_file = argv[1];
  506. char *output_file = argv[2];
  507. int start = atoi(argv[3]);
  508. int end = atoi(argv[4]);
  509. ret = test_cut(input_file, output_file, start, end);
  510. return ret;
  511. }

  

FFmpeg简单转码程序--视频剪辑的更多相关文章

  1. 最简单的基于FFMPEG的转码程序

    本文介绍一个简单的基于FFmpeg的转码器.它可以将一种视频格式(包括封转格式和编码格式)转换为另一种视频格式.转码器在视音频编解码处理的程序中,属于一个比较复杂的东西.因为它结合了视频的解码和编码. ...

  2. 最简单的基于FFMPEG的转码程序 —— 分析

    模块:  libavcodec    - 编码解码器         libavdevice   - 输入输出设备的支持         libavfilter   - 视音频滤镜支持         ...

  3. [开源]基于ffmpeg和libvlc的视频剪辑、播放器

    [开源]基于ffmpeg和libvlc的视频剪辑.播放器 以前研究的时候,写过一个简单的基于VLC的视频播放器.后来因为各种项目,有时为了方便测试,等各种原因,陆续加了一些功能,现在集成了视频播放.视 ...

  4. 基于ffmpeg和libvlc的视频剪辑、播放器

    以前研究的时候,写过一个简单的基于VLC的视频播放器.后来因为各种项目,有时为了方便测试,等各种原因,陆续加了一些功能,现在集成了视频播放.视频加减速.视频剪切,视频合并(增加中)等功能在一起.有时候 ...

  5. 「小程序JAVA实战」小程序视频处理工具ffmpeg(47)

    转自:https://idig8.com/2018/09/16/xiaochengxujavashizhanxiaochengxushipinchuligongjuffmpeg46/ 前面已经把视频成 ...

  6. Java Web 中使用ffmpeg实现视频转码、视频截图

    Java Web 中使用ffmpeg实现视频转码.视频截图 转载自:[ http://www.cnblogs.com/dennisit/archive/2013/02/16/2913287.html  ...

  7. Flink源码分析 - 剖析一个简单的Flink程序

    本篇文章首发于头条号Flink程序是如何执行的?通过源码来剖析一个简单的Flink程序,欢迎关注头条号和微信公众号"大数据技术和人工智能"(微信搜索bigdata_ai_tech) ...

  8. FFmpeg 入门(1):截取视频帧

    本文转自:FFmpeg 入门(1):截取视频帧 | www.samirchen.com 背景 在 Mac OS 上如果要运行教程中的相关代码需要先安装 FFmpeg,建议使用 brew 来安装: // ...

  9. ffmpeg/ffplay源码剖析笔记<转>

    转载:http://www.cnblogs.com/azraelly/ http://www.cnblogs.com/azraelly/archive/2013/01/18/2865858.html ...

随机推荐

  1. Mac生成APP图标和启动图的脚本

    概述 之前用的一个批量导出APP图标和启动图的软件,今天发现收费了,于是自己造了个简单的轮子. 实现 Mac上的sips命令,可以很方便的帮助用户修改图片尺寸 Xcode里面的APP启动图资源包含两部 ...

  2. SSH免密码登录远程linux服务器

    Linux下实现SSH无密码验证登陆 ssh配置 主机A:10.0.5.199 主机B:10.0.5.198 需要配置主机A无密码登录主机A,主机B 先确保所有主机的防火墙处于关闭状态. 在主机A上执 ...

  3. 关于CodePlex

    CodePlex是微软的开源工程网站,涉及诸多微软最新技术的开源工程. 网址:http://www.codeplex.com/ 应常去看看.

  4. Missing artifact com.sun:tools:jar:1.5.0解决的方法

    前一阵子下了最新的JavaEE版本号的eclipse,导入mavenproject之后,pom文件一直报Missing artifact com.sun:tools:jar:1.5.0.非常纳闷,to ...

  5. 【H5】ie8如何兼容html5标签(hack)

    ie8是识别不了html5语义化标签的,解决方法: 在头部文件的<head></head>里面下如下代码    (这段代码的意思是如果ie版本低于ie8,就创建所有HTML5新 ...

  6. opatch auto 安装11.2.0.4.20190115 PSU遇到 OUI-67133: Execution of PRE script failed,with returen value 1 报错

    AIX 7.2 下Oracle 11.2.0.4  RAC数据库root用户在使用 /u01/app/11.2.0/grid/OPatch/opatch auto /soft/28813878 -oc ...

  7. Linux磁盘与文件系统管理(二)

    fsck 检查并修复文件系统中的错误,即针对有问题的系统或磁盘进行修复,类似的命令还有e2fsck,修复前有以下要求: 1)文件系统必须是卸载状态 2)不要对正常的分区使用fsck,不加参数的情况下, ...

  8. The Gene of Bitizens

    1.          Summary The document is about the general idea of the architecture design of the Bitizen ...

  9. matlab2016b配置libsvm的各中坑及解决办法

    Q1:matlab2016b不能自动关联m文件! A1: (1)首先准备好工具,工具链接:pan.baidu.com/s/1t_KaFZNOFln9m57sMBTrkQ:提取码:x49w. (2)下载 ...

  10. 2_C语言中的数据类型 (三)原码、反码、补码

    1.1       原码 将最高位做为符号位(0代表正,1代表负),其余各位代表数值本身的绝对值 +7的原码是00000111 -7的原码是10000111 +0的原码是00000000 -0的原码是 ...