Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. avcodec_get_context_defaults3(vstrm->codec, vcodec);
  2. vstrm->codec->width = dst_width;
  3. vstrm->codec->height = dst_height;
  4. vstrm->codec->pix_fmt = vcodec->pix_fmts[0];
  5. vstrm->codec->time_base = vstrm->time_base = av_inv_q(dst_fps);
  6. vstrm->r_frame_rate = vstrm->avg_frame_rate = dst_fps;
  7. if (outctx->oformat->flags & AVFMT_GLOBALHEADER)
  8. vstrm->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
  9.  
  10. // open video encoder
  11. ret = avcodec_open2(vstrm->codec, vcodec, nullptr);
  12. if (ret < 0) {
  13. std::cerr << "fail to avcodec_open2: ret=" << ret;
  14. fclose(time_fp);
  15. return 2;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement