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

Transformed Videos missing metadata? #222

Open
jungiebook opened this issue Nov 4, 2022 · 21 comments
Open

Transformed Videos missing metadata? #222

jungiebook opened this issue Nov 4, 2022 · 21 comments

Comments

@jungiebook
Copy link

Hello!

Any time I run a video through the MediaTransformer.transform on Android and save that to my device, I noticed that it changes in the way it displays in Android Files app or the Photos app.

For example, in the Files app of Android, it looks like this:
image

The one with the thumbnail visible is the original video that hasn't gone through transform method. The 12.32MB video on the top left is the output of transform using the same original video. When I click it to the fullscreen viewer, it plays the video fine, but even in the Android Photos app, it looks like this:
image

Any idea what could be happening?

@izzytwosheds
Copy link
Contributor

Hi,

It is possible that LiTr might be stripping out some metadata when transcoding. We use bare minimum when creating new video. I will look into this.

@jungiebook
Copy link
Author

FWIW - I tried reencoding the video with FFMPEG, and the video seems now fixed - the thumbnail and the time duration load accurately on the Files/Photos app on Android.

@izzytwosheds
Copy link
Contributor

Can you share one of videos? I will try to debug and see what is happening.
You can share on google drive with ibahadirov at linkedin.com

@jungiebook
Copy link
Author

Hi @izzytwosheds , let me know if you can see the videos in the link!
https://drive.google.com/drive/folders/1VRrqdq2C0QAK53VPsm5SGgLW8eP88sZW?usp=sharing

@jungiebook
Copy link
Author

Interestingly enough, even on Google Drive web UI, one shows the thumbnail and the other does not 😅
image

@izzytwosheds
Copy link
Contributor

Which device did you create LiTr on? Looks like duration metadata is missing, so MediaMetadataRetriever cannot extract it, which is most likely causing problems. I cannot reproduce this problem on my Pixel 3, so I am suspecting that this problem could be device specific.

@jungiebook
Copy link
Author

jungiebook commented Nov 12, 2022 via email

@izzytwosheds
Copy link
Contributor

I will think about possible test cases and get back to you shortly. Are you using LiTr demo app or are you calling LiTr API in your app?

@jungiebook
Copy link
Author

jungiebook commented Nov 14, 2022 via email

@jungiebook
Copy link
Author

Hello! Just wanted to check in and see if you were able to find anything on this front

@izzytwosheds
Copy link
Contributor

I haven't made much progress, with work and all. Can you check one thing, though? Can you try using LiTr demo app on your phone and see if problem happens again?

@izzytwosheds
Copy link
Contributor

Another thing to try - can you remove metadata tracks from that video and see if that helps? There is a flag in TransformationOptions now.

@izzytwosheds
Copy link
Contributor

This is very interesting. MediaExtractor on my Pixel 3 cannot extract any metadata from transcoded video you provided. ffprobe can handle it, and shows all metadata. Looks like something is happening when MediaMuxer on your Pixel 6a is writing that video. Maybe those metadata tracks are affecting it somehow - I am seeing their format change between original and transcoded videos.

@izzytwosheds
Copy link
Contributor

Which Android OS version do you have on your device? I will try to get ahold of similar device here, to debug.

@charlesx2013
Copy link

if its any help, @izzytwosheds I'm able to reproduce this using the LiTr api on a Samsung s10 running Android 12!

@charlesx2013
Copy link

i've also tried removing metadata tracks and it still occurs.

@izzytwosheds
Copy link
Contributor

izzytwosheds commented Jan 12, 2023

Thank you @charlesx2013 ! Does this happen with LiTr demo app as well?

@izzytwosheds
Copy link
Contributor

Thank you very much, guys! I was able to reproduce it. Fix was merged, I hope it fixes the problem on your devices as well. Will you have to wait for the new release to verify this?

@charlesx2013
Copy link

awesome, thank so much! yes, we will have to bump litr to the next release version to test it.

@jungiebook
Copy link
Author

Awesome news! Thank you so much!

@izzytwosheds
Copy link
Contributor

I released version 1.5.5 which has the fix. Let me know if it fixes this issue. I will close it if it does.

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

3 participants