亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在ffmpeg中使用濾鏡,進行疊加字符

如何在ffmpeg中使用濾鏡,進行疊加字符

慕無忌1623718 2018-10-01 16:16:27
查看完整描述

1 回答

?
肥皂起泡泡

TA貢獻1829條經驗 獲得超6個贊

以下是本人的部分代碼:
//解碼一個avpacket
static int get_video_frame(VideoState *is, AVFrame *frame, int64_t *pts, AVPacket *pkt)
{
int got_picture, i; int ret = 1;
//if (packet_queue_get(&is->videoq, pkt, 1) < 0)
// return -1;
if ((i = av_read_frame(is->ic, pkt)) < 0)//如果讀到文件尾部就退出
return 0;

i=avcodec_decode_video2(is->video_st->codec, frame, &got_picture, pkt);

if (got_picture==0)
;//return 0;

*pts = frame->pkt_dts;
if (*pts == AV_NOPTS_VALUE)
*pts = 0;

/*if (((is->av_sync_type == AV_SYNC_AUDIO_MASTER && is->audio_st) ||
is->av_sync_type == AV_SYNC_EXTERNAL_CLOCK) &&
(framedrop>0 || (framedrop && is->audio_st)))
{
//SDL_LockMutex(is->pictq_mutex);
if (is->frame_last_pts != AV_NOPTS_VALUE && *pts)
{
double clockdiff = get_video_clock(is) - get_master_clock(is);
double dpts = av_q2d(is->video_st->time_base) * *pts;
double ptsdiff = dpts - is->frame_last_pts;

if (fabs(clockdiff) < AV_NOSYNC_THRESHOLD &&
ptsdiff > 0 && ptsdiff < AV_NOSYNC_THRESHOLD &&
clockdiff + ptsdiff - is->frame_last_filter_delay < 0)
{
is->frame_last_dropped_pos = pkt->pos;
is->frame_last_dropped_pts = dpts;
is->frame_drops_early++;
ret = 0;
}
}
}*/
if (ret)
is->frame_last_returned_time = av_gettime() / 1000000.0;

查看完整回答
反對 回復 2018-10-17
  • 1 回答
  • 0 關注
  • 1308 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號