mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2026-01-24 07:31:22 +01:00
关于bgr3支持4k 60fps的问题 #140
Labels
No labels
bug
enhancement
help wanted
invalid
pull-request
question
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: starred/ffmpeg-rockchip#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @huochen1 on GitHub (Jan 8, 2025).
您好请问一下,就是我这边根据这个命令./ffmpeg -f v4l2 -i /dev/video0 -c:v h264_rkmpp -flags +low_delay -b:v 4M -qp_init 26 -minrate
2M -maxrate 5M -profile:v high -level 4.1 -g:v 100 -vframes 1200 -y bgr3_4k60fps_264.mp4 测试了一下,我的输入源是4k 60fps的bgr3源,发现1200帧平均下来的帧率是54帧(保存下来的视频可以使用ffmpeg查看属性的),而且这个保存下来的视频播放会随着时间的推移越来越卡顿,可能后面都没有54fps了。但是如果是NV12的颜色输入的话,就不会有卡顿的现象,而且也是60fps来的。请问一下这个我要怎么去优化这个以支持BGR3的颜色输入。
@nyanmisaka commented on GitHub (Jan 8, 2025):
Remove
-flags +low_delayand try again?This flag enfores single-core encoder and disable async encoding to reduce latency.
@huochen1 commented on GitHub (Jan 14, 2025):
不要意思现在才看到,根据您的提示输入的还是bgr3 4k 60fps的,我使用了./ffmpeg -f v4l2 -i /dev/video0 -c:v h264_rkmpp -qp_init 20 -profile:v main -vframes 2400 -y bgr3_4k_60fps_264.mp4来进行编码,发现编码的速度是60fps的,我的/dev/video0 设备输入就是60fps,保存下来的视频文件也是60fps的,但是播放的时候缺发现会有明显的卡顿现象,这个是rga的问题吗?
@huochen1 commented on GitHub (Jan 14, 2025):
同样的我也测试了一下NV16格式的,发现也不会卡顿,bgr3的4k 30fps不会卡顿,但是4k 60fps会卡顿。
@nyanmisaka commented on GitHub (Jan 14, 2025):
Please upload a video showing the lag.
@huochen1 commented on GitHub (Jan 14, 2025):
https://github.com/user-attachments/assets/3530ea56-5fcc-4301-a6c1-cd3d449ee17f
上面的是有延迟的,下面这个是没有延迟
https://github.com/user-attachments/assets/674e1de7-c843-4bd1-bc3f-11ede1fab04b
的
@huochen1 commented on GitHub (Jan 14, 2025):
是卡顿
@nyanmisaka commented on GitHub (Jan 14, 2025):
Have you ever tried using software encoder
-c:v libx264rgbto rule out the problem?@nyanmisaka commented on GitHub (Jan 14, 2025):
If the software encoder is also causing the lagging video, then check your video input.
@sathishNexion commented on GitHub (Jan 14, 2025):
I exactly Followed this --> https://github.com/nyanmisaka/ffmpeg-rockchip/wiki/Compilation
But i encountered some errors, Friend
I am using rv1126
@huochen1 commented on GitHub (Jan 15, 2025):
输入源我可以排除掉了,因为我试过很多输入源,都是存在这个问题,我猜想是不是由于BGR3的数据量比NV12大很多,编码处理不过来导致的,虽然他结果也是显示4K 60FPS,就还是会显示卡顿
@sathishNexion commented on GitHub (Jan 15, 2025):
Okay
On Wed, 15 Jan, 2025, 3:10 pm huichen, @.***> wrote:
@huochen1 commented on GitHub (Jan 15, 2025):
我这个不是回复您的,我是回复作者的
@huochen1 commented on GitHub (Jan 15, 2025):
https://github.com/user-attachments/assets/9e78022b-f0fa-4af6-97de-dfdf1b0d2fe2
@nyanmisaka commented on GitHub (Jan 17, 2025):
Make sure you used the MPP library from https://github.com/nyanmisaka/mpp/tree/jellyfin-mpp
The upstream mpp/develop tree is always broken.
@huochen1 commented on GitHub (Jan 17, 2025):
是的,我还再重新编译了一下还是这样的效果,我使用的是Orange Pi 5 Plus的rk3588,HDMI IN的进入来测试的。电脑作为输入的源。我换了一个播放的视频更加明显,好像是丢帧的现象
测试命令:./ffmpeg -f v4l2 -i /dev/video0 -c:v hevc_rkmpp -qp_init 20 -profile:v main -vframes 2400 -y bgr3_4k_60fps_264.mp4
https://github.com/user-attachments/assets/e920af5d-901b-4f9c-a87a-bd5835b7899a
@huochen1 commented on GitHub (Jan 17, 2025):
我发现重复帧过多,在2400帧下的重复帧达到了差不多1/3,可能是这个原因
@nyanmisaka commented on GitHub (Jan 17, 2025):
The actual input frame rate on the encoder side is only about ~47fps, which should explain why the lagging is observed. And hdmirx-related cma alloc failures are observed in
dmesg, so this is not an encoder error.@huochen1 commented on GitHub (Jan 17, 2025):
我这边特意找了一个电脑可以支持HDMI IN输入的4k 60fps的,使用这个命令可以查看当前HDMI IN的帧率,查询帧率: v4l2-ctl -d /dev/video0 --set-fmt-video=width=3840,height=2160, --stream-mmap=3 --stream-skip=1 --stream-poll,
@huochen1 commented on GitHub (Jan 17, 2025):
还有一个发现就是使用potplayer播放器来查看这个滞后的视频,一帧一帧的查看就是会有每四帧会有一个重叠帧,这个重叠帧是不是有可能造成这种视觉上的滞后,我也尝试去调整这几个参数,发现并没有很大的改善。
@nyanmisaka commented on GitHub (Jan 17, 2025):
Your gstreamer command should be zero-copy, no copying from hdmirx->display. FFmpeg's libavdevice/v4l2 does not have this optimization.
The chroma subsample of the video encoded by the rkmpp encoder is 4:2:0, so BGR3/BGR24 is not very useful here. Setting the EDID to only support 4k60 ycbcr420 should be able to disable BGR3/BGR24.
@huochen1 commented on GitHub (Jan 18, 2025):
感谢您的回复,我这边尝试了不知道是不是设置的方式不对,好像v4l2-ctl --set-edid 的方式我看了只能将NV24禁掉,对于BGR3还是无能为力。想请问作者有什么建议可以将HMDI IN的这个BGR3给禁止掉。