Replies: 3 comments
-
|
At the same time, I found that during the first three communications of Scrcpy, the first byte sent is 00, followed by 64+12 bytes of device information, video, and resolution information. However, if I don't actively filter out the first byte, it will cause an error in parsing the video stream metadata. |
Beta Was this translation helpful? Give feedback.
-
You must decode the stream using a decoder. You need to save the latest
I found https://github.com/Streampunk/beamcoder (seems abandoned) and https://github.com/mmomtchev/ffmpeg (pretty new). They use n-api to call FFmpeg APIs. Using a WebAssemly port of FFmpeg might be another option, the performance might not be as good as native FFmpeg libraries.
You can use webm-muxer package. WebM is a subset of Matroska (MKV), and this package has a An example can be found in old-demo: https://github.com/tango-adb/old-demo/blob/aab87732cc685286e4c62791b04256ea4a464422/packages/demo/src/components/scrcpy/recorder.ts#L231. Some API might have changed since it was last updated. This implementation saves latest Of course you can also use FFmpeg API. However it can't be done using FFmpeg command line, because the H.264 stream doesn't contain timestamps: Genymobile/scrcpy#5742 (comment)
You are correct. Theoretically speaking, the first |
Beta Was this translation helpful? Give feedback.
-
|
Thank you for your help. As you mentioned, I found the project at https://github.com/mmomtchev/ffmpeg to be amazing. Someone has already done what I want to do. I need to decode H.264 to get the latest screenshots, possibly taking 5-10 screenshots per second to capture the most recent frames. This is what I currently need, but I need to learn some keyframe-related concepts. For packaging with MKV, using FFmpeg's command line is definitely simpler for me. I've already noticed the issue with timestamps in H.264, as mentioned in the comments. The situation improves after using the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm not very familiar with video formats. I created a simple demo and can now obtain H264 information, but I'm facing two issues:
Beta Was this translation helpful? Give feedback.
All reactions