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

2x slowdowns in FFMPEG recording for the scrcpy server #5757

Open
JijaProGamer opened this issue Jan 15, 2025 · 2 comments
Open

2x slowdowns in FFMPEG recording for the scrcpy server #5757

JijaProGamer opened this issue Jan 15, 2025 · 2 comments

Comments

@JijaProGamer
Copy link

  • OS: Windows 11
  • Scrcpy version: 3.1
  • Installation method: Windows release
  • Device model: Default BlueStacks 5
  • Android version: 9

I'm pushing the scrcpy server using the usual method:

adb push scrcpy-server-v3.1 /data/local/tmp/vlc-scrcpy-server.jar
adb forward tcp:6751 localabstract:scrcpy
adb shell CLASSPATH=/data/local/tmp/vlc-scrcpy-server.jar
app_process / com.genymobile.scrcpy.Server 3.1
tunnel_forward=true control=false cleanup=false
max_size=1920 raw_video_stream=true \

However, when trying to record it to file using:

ffmpeg -re -i tcp://localhost:6751 -f h264 test.mkv

It outputs:

frame= 272 fps= 53 q=28.0 size= 2304KiB time=00:00:10.80 bitrate=1747.6kbits/s speed= 2.1x

Meaning that it is 2.1x in slow motion. How would I bring it to 1x?

@JijaProGamer
Copy link
Author

JijaProGamer commented Jan 15, 2025

In conclusion:

Slowmotion 1:
ffmpeg -i tcp://localhost:6751 test.mkv -y

Slowmotion 2:
ffmpeg -re -i tcp://localhost:6751 test.mkv -y

Fast forward (1.25x-2x, depends on CPU, -r 50 being double the fps):
ffmpeg -r 50 -i tcp://localhost:6751 -r 50 test.mkv -y

Seemingly good real time speed, but I'm not sure if it actually is real time or just another trick by luck:
ffmpeg -r 50 -i tcp://localhost:6751 test.mkv -y

Having it -r 50 (so doubling the input framerate) is very worrying in my opinion, so I belive there is another issue here.

EDIT: After further tests, it seems like the "ffmpeg -r 50 -i tcp://localhost:6751 test.mkv -y" method is fast forward too.

@yume-chan
Copy link
Contributor

See #5742 (comment) and #5742 (comment)

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