Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

遇到音画不同步的现象 #21

Open
qiuxuewen opened this issue Jul 27, 2023 · 5 comments
Open

遇到音画不同步的现象 #21

qiuxuewen opened this issue Jul 27, 2023 · 5 comments

Comments

@qiuxuewen
Copy link

利用硬件编解码直播流时,比如udp流,生成的mp4文件会出现“音画不同步“。
这是必现的,请问你有遇到这个问题吗? 如果有遇到,可否讨论下这个问题可能出现的地方在哪。
命令如下
ffmpeg -y
-thread_queue_size 2048
-c:v h264_rkmpp
-i "udp://239.3.1.109:8001"
-vf "scale_rga=520:410,fps=15"
-ar 16000 -ac 1 -b:a 32k
-b:v 200k
-c:v h264_rkmpp
-t 60
test_1.mp4

@jjm2473
Copy link
Owner

jjm2473 commented Jul 31, 2023

试试删掉fps滤镜。
就算要使用fps,不是应该先fps吗?

@qiuxuewen
Copy link
Author

我最初的命令也是先fps,我已经都试过了,都是不同步。一个现象是我试了其他播放器包括浏览器都是不同步,但是“IINA”播放器是同步的。但是软解软编都没问题。

@jjm2473
Copy link
Owner

jjm2473 commented Aug 1, 2023

哦,那我就不知道原因了,反正我用来转码文件没问题,不过我没使用fps滤镜。也许是解码器没有输出时间轴?

@qiuxuewen
Copy link
Author

我发你几个文件,你试着看下哪个环节有问题,这几个都是硬件编解码。你知道如何”软解硬编“吗?我后面加”hwupload“好像没用。
test_noscale_nofps.mp4.zip
test_nofps.mp4.zip
test_fps15.mp4.zip

@jjm2473
Copy link
Owner

jjm2473 commented Aug 2, 2023

软解硬编就是要指定软件解码器ffmpeg -c:v h264 -i /usr/local/test.mp4 -vf 'scale_rga' -c:v h264_rkmpp -q:v 80 -f matroska -y test.mkv

不需要hwuploadscale_rga会自动判断

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants