Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
110.25k stars 10.57k forks source link

Using ^C to stop mp4 recording corrupts file (windows) #5373

Open evillurker opened 3 hours ago

evillurker commented 3 hours ago

Describe the bug

When finishing with ^C recording, it says it completed but the file is corrupt when choosing mp4 method. mkv doesn't produce this bug but it produces jagged quality in the first few seconds. I tried using adb to kill the process but it keeps recording when trying to do that. Corruption not always occurs but around 50% of the time

rom1v commented 3 hours ago

Do you use "Windows Terminal"? https://github.com/Genymobile/scrcpy/issues/5122#issuecomment-2265289619

I tried using adb to kill the process but it keeps recording when trying to do that.

That's should not be possible. if you kill adb, then scrcpy terminates, and this terminates the recording.

Please post a whole console output when you kill adb (also include the command you executed).

Does it work correctly when you close the scrcpy window (not the terminal)?

evillurker commented 1 hour ago

Nevermind, seems like all I had to do is taskkill adb.exe

rom1v commented 1 hour ago

But the best is to close the scrcpy window.

Ctrl+c should also work in theory, but not with Windows terminal for some reason.

evillurker commented 1 hour ago

Ctrl C in the console window works 50% of the time, the other 50% in windows it corrupts the header of the mp4. I am waiting for the --time-limit on your next version, until then I have to make my own GUI to stop recording

rom1v commented 1 hour ago

Ctrl+c should also work in theory, but not with Windows terminal for some reason.

Ctrl C in the console window works 50% of the time

When I say that it does not work, I mean that it abruptly kills the process (which is never ok), instead of sending the equivalent of SIGINT so that the process terminates gracefully and scrcpy can finish running properly.

rom1v commented 1 hour ago

I am waiting for the --time-limit on your next version

You can use the binary from #5370, it includes the time-limit fix (afbaf59abba79a79ab6f4c659ff3d832e02a8e7f).

evillurker commented 1 hour ago

I am waiting for the --time-limit on your next version

You can use the binary from #5370, it includes the time-limit fix (afbaf59).

Thank you, I didn't know I can download it. This will be very useful.