LiTr icon indicating copy to clipboard operation
LiTr copied to clipboard

Transformed Videos missing metadata?

Open jungiebook opened this issue 3 years ago • 21 comments

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?

jungiebook avatar Nov 04 '22 09:11 jungiebook

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.

izzytwosheds avatar Nov 07 '22 14:11 izzytwosheds

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.

jungiebook avatar Nov 08 '22 00:11 jungiebook

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

izzytwosheds avatar Nov 08 '22 17:11 izzytwosheds

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

jungiebook avatar Nov 09 '22 23:11 jungiebook

Interestingly enough, even on Google Drive web UI, one shows the thumbnail and the other does not šŸ˜… image

jungiebook avatar Nov 09 '22 23:11 jungiebook

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.

izzytwosheds avatar Nov 12 '22 05:11 izzytwosheds

I see, I am on Pixel 6a.. :( Is there anything I can try, since I’m getting a repro?

On Fri, Nov 11, 2022 at 9:20 PM Izzat Bahadirov @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/linkedin/LiTr/issues/222#issuecomment-1312370326, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ525MWOTIKJRRSISHFVG63WH4SIZANCNFSM6AAAAAARW7SZGY . You are receiving this because you authored the thread.Message ID: @.***>

jungiebook avatar Nov 12 '22 06:11 jungiebook

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?

izzytwosheds avatar Nov 13 '22 01:11 izzytwosheds

I am using the LiTr API in my app :)

On Sat, Nov 12, 2022 at 5:21 PM Izzat Bahadirov @.***> wrote:

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?

— Reply to this email directly, view it on GitHub https://github.com/linkedin/LiTr/issues/222#issuecomment-1312610886, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ525MUXOIYVHE76BOTQZLLWIA7BHANCNFSM6AAAAAARW7SZGY . You are receiving this because you authored the thread.Message ID: @.***>

jungiebook avatar Nov 14 '22 20:11 jungiebook

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

jungiebook avatar Dec 02 '22 20:12 jungiebook

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 avatar Dec 02 '22 21:12 izzytwosheds

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 avatar Dec 23 '22 16:12 izzytwosheds

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 avatar Dec 23 '22 17:12 izzytwosheds

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

izzytwosheds avatar Dec 23 '22 17:12 izzytwosheds

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

charlesx2013 avatar Jan 10 '23 06:01 charlesx2013

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

charlesx2013 avatar Jan 10 '23 18:01 charlesx2013

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

izzytwosheds avatar Jan 12 '23 02:01 izzytwosheds

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?

izzytwosheds avatar Jan 23 '23 21:01 izzytwosheds

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

charlesx2013 avatar Jan 23 '23 21:01 charlesx2013

Awesome news! Thank you so much!

jungiebook avatar Jan 23 '23 22:01 jungiebook

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.

izzytwosheds avatar Jan 28 '23 15:01 izzytwosheds