Hello, the recording videos are missing some metadata like length and frame width/height. VLC can play them normally, but if you try to look for videos details in windows 10, adobe premiere, and other video players. They can't read the metadata and some players cannot read the files.
It could be an encoding problem. I'm comparing a scrycpy video (test.mp4) and adb recording (adb video.mp4)
https://imgur.com/a/IuKqsTn
I hope this helps. Thanks!

the recording videos are missing some metadata like length and frame width/height
These metadata are present for both files in your screenshot.
I see nothing important missing.
The only difference is the codec id, which is isom on the left and mp42 on the right, but both should be ok.
In the windows explorer, you can see the windows 10 is able to preview the file and read the metadata.
I found a post with a similar mp4 file problem: https://forum.videohelp.com/threads/374899-no-frame-info-(height-width)-shown-in-the-movie-properties-details
The video files cannot be opened on:
It works fine on VLC. I have to transcode the video with Handbrake to make it work.
It seems that some quick-access metadata is missing. If you go to properties on Windows, there are not video details.
Thank you for your work!
Thank you for the details.
I will investigate when I have some time (and currently I don't have access to any of the software that you listed which fail).
For now, could you paste the result of scrcpy -v please?
In particular, I would like to know which #ifdef branch is executed here. If it's the "new version" branch (which uses codecpar), I am interested in the result with the "deprecated" version (which uses codec):
diff --git a/app/src/recorder.c b/app/src/recorder.c
index 2e846e9..b13bb5a 100644
--- a/app/src/recorder.c
+++ b/app/src/recorder.c
@@ -63,25 +63,11 @@ SDL_bool recorder_open(struct recorder *recorder, AVCodec *input_codec) {
return SDL_FALSE;
}
-// In ffmpeg/doc/APIchanges:
-// 2016-04-11 - 6f69f7a / 9200514 - lavf 57.33.100 / 57.5.0 - avformat.h
-// Add AVStream.codecpar, deprecate AVStream.codec.
-#if (LIBAVFORMAT_VERSION_MICRO >= 100 /* FFmpeg */ && \
- LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 33, 100)) \
- || (LIBAVFORMAT_VERSION_MICRO < 100 && /* Libav */ \
- LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(57, 5, 0))
- ostream->codecpar->codec_type = AVMEDIA_TYPE_VIDEO;
- ostream->codecpar->codec_id = input_codec->id;
- ostream->codecpar->format = AV_PIX_FMT_YUV420P;
- ostream->codecpar->width = recorder->declared_frame_size.width;
- ostream->codecpar->height = recorder->declared_frame_size.height;
-#else
ostream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
ostream->codec->codec_id = input_codec->id;
ostream->codec->pix_fmt = AV_PIX_FMT_YUV420P;
ostream->codec->width = recorder->declared_frame_size.width;
ostream->codec->height = recorder->declared_frame_size.height;
-#endif
ostream->time_base = (AVRational) {1, 1000000}; // timestamps in us
int ret = avio_open(&recorder->ctx->pb, recorder->filename,
It seems the If block code is executed, libavcodec is 58.18.100
>scrcpy -v
scrcpy v1.5
dependencies:
- SDL 2.0.9
- libavcodec 58.18.100
- libavformat 58.12.100
- libavutil 56.14.100
I copied the file with ffmpeg and it fixed the metadata issue.
ffmpeg -i test.mp4 -c:v copy test_final.mp4
@Gapplay Could you tell me whether this video has metadata issues, please? test.mp4
@rom1v that video is working correctly on all video players/programs I've tried.
Great, then I have a fix :tada:
Fixed on dev branch.
Thanks to my colleague @robUx4 who helped me a lot during the FOSDEM to fix this issue (and others which prevented recording to MKV, now it also works :tada:)
Do you have an ETA for when this might be released?