hbiyik / FFmpeg

PLEASE USE https://github.com/nyanmisaka/ffmpeg-rockchip REPO INSTEAD.
https://github.com/nyanmisaka/ffmpeg-rockchip
Other
89 stars 7 forks source link

rkmppdec 解码异常的问题 #13

Closed lion117 closed 1 year ago

lion117 commented 1 year ago

测试背景1

  1. 在麒麟aarch64 系统上使用ffmpeg 播放 mp4视频文件
  2. ffmpeg版本为4.2.2的版本
  3. RK3399

异常情况

  1. 获取解码后的av_frame_get_best_effort_timestamp 异常为负值. frame->pts 间歇性的为0. packet->pts完全正常

    同一份业务代码,(ffmpeg库不同) 在ubuntu-x64平台下运行正常. 可正确获得pts. 均无此类情况.

    
    av_frame_get_best_effort_timestamp(&player->vframe);  

2.  接受视频源为仅有I帧和P帧的数据. 设置解码器内部禁止缓冲, 输入packet pts和输出vframe的pts 总是间隔一帧. 实际解码器内部缓冲1帧.导致端到端时延增加约40ms

player->vcodec_context->delay = 0; // 禁止内部缓冲 avcodec_decode_video2(player->vcodec_context, &player->vframe, &gotvideo, packet);

hbiyik commented 1 year ago

Hello, i can not Chinese, but i will answer as much as i understood from google translate.

1) What kind of video format are you using. Mp4 is just a container, i need to know the actual encoding format. If you are using mpeg1, mpeg2 or even mpeg4, mpp has known issues with calculating the PTS and has been recently fixed in https://github.com/rockchip-linux/mpp/commit/62922f3cc1b416e1a9444e75759bd8d8dd2340e1 and https://github.com/rockchip-linux/mpp/commit/ae444a6cb5cde1116ea523ed31b0e5cc13a0b536, so i would suggest to verify which version of mpp you are using.

2) If you could upload the source video file to some place, i can check myself when i have time. Currently i burned my SSD in rock5b so do not have the environment, may be next week i can give a look.

hbiyik commented 1 year ago

no update provded closing, feel free to reopen.