ffmpeg 4.2.1版本,樣例代碼 transcoding.c 轉碼後幀率減半bug

av_packet_rescale_ts(&packet,ifmt_ctx->streams[stream_index]->time_base,stream_ctx[stream_index].dec_ctx->time_base);

 

後面的參數stream_ctx[stream_index].dec_ctx->time_base時間基準錯誤,應該賦予幀率的值,假如轉碼後爲25幀,修改如下

stream_ctx[stream_index].dec_ctx->time_base.num = 1;
stream_ctx[stream_index].dec_ctx->time_base.den = 25;
av_packet_rescale_ts(&packet,ifmt_ctx->streams[stream_index]->time_base,stream_ctx[stream_index].dec_ctx->time_base);

發佈了5 篇原創文章 · 獲贊 1 · 訪問量 2774
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章