Genymobile / Genymobile/scrcpy

Recorded or Displayed video puts some older frames after more recent frames – [feature request] option to select encoder

Open
#666 10 comments 0 reactions 0 assignees View on GitHub
feature request
Dominant language
C
Stars
150k
Forks
13.7k
Avg merge
4d 13h
Merged PRs (30d)
2

Description

I downloaded scrcpy 1.9 on 7/24/2019 with the goal of recording video from my Droid Turbo onto my Windows 7 x64 PC. When I connect with USB and run scrcpy and have it display to my screen, and the video from the phone has a lot of motion, it's common for the display from scrcpy to periodically appear to show maybe 1 frame that probably would have been the correct frame to display about 1/10 of a second ago. So whatever motion was happening appears to jump backwards to where it would have been maybe 1/10th of a second ago for just one frame and then jump back to what the phone is currently displaying; it's a very jarring appearance. Depending on the size I am displaying with scrcpy, these frame jumps may happen as frequently as once a second. If I reduce the display size very small like scrcpy --max-size 400, the frame jumps are less frequent, but they still happen occasionally, maybe a few times every 10 seconds.

I have had my phone display its CPU and memory usage while running this, and it seems to display around 15.00/14.00/14.00 as the CPU usage and the bar only seems to go around 15% across the screen so I interpret that as 15% CPU usage. The phone memory remains with over 1 GB free while this happens. My PC CPU usage is only around 5% while it happens, and only 4 out of 8 GB of memory are in use; these are when I'm running scrcpy --max-size 1920.

I also tried having scrcpy do the file recording. I ran one with mp4 and one with mkv, with the --no-display option so it wouldn't need to do double work, but the mp4 and mkv files it created still have the same kinds of frame jumps I would see in the live display. I play the files in VLC, and I've checked that I'm not just getting some kind of playback issue with the mp4 and mkv files by advancing individual frames in VLC and I can still see the motion get jumped backwards for a frame.

I do not usually run it with --render-expired-frames, and when I've tried it, the frame jumps seem just as frequent, possibly more frequent. When I use ctrl+i, I often see skipped frames, but I am fairly certain I have observed these frame jumps in the display even during periods where no skipped frames are logged. The display on the phone itself always looks perfect during the whole thing, and the game doesn't feel any less responsive than it would while scrcpy was not running.

Do you have any suggestions to get it where it doesn't end up displaying or recording an older frame after it has already displayed/recorded a newer frame? I can probably share the mp4 and mkv file with google drive or something later if that would help.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the reported frame-ordering problem with scrcpy 1.9 using live display and recording with --no-display, --max-size 1920 or 400, and --render-expired-frames. Compare individual frames in VLC and inspect whether skipped frames correlate with older frames appearing after newer ones. Done should mean identifying whether an encoder-selection option can prevent the issue and documenting the supported behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, c
Domain
audio-video-rtc
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.