nextcloud-metadata icon indicating copy to clipboard operation
nextcloud-metadata copied to clipboard

Metadata for MTS / M2TS files

Open luxzg opened this issue 1 year ago • 4 comments

AVCHD video files used a lot by Sony and Panasonic. File info: https://fileinfo.com/extension/mts

Doesn't contain much data in my case, but I'd love to have at least the date/time of the recording shown in the file info.

Thanks for a nice app!

luxzg avatar Apr 03 '23 19:04 luxzg

@luxzg thanks for the request. Maybe you also have a sample, and could attach it to the issue?

gino0631 avatar Apr 04 '23 00:04 gino0631

Sure, file is bit larger even though it's very short so I have uploaded to wetransfer here: link

I've also noticed that in Memories I get at least basic info, but still that requires switching apps all the time. Anyway, if it will help you can also peek at their code. Image below from Memories web page for this same file that I've put on wetransfer. image

Edit: note that file info says "9 days ago" which is what Files app shows, but Info tab shows "Sun, Jan 8, 2012 6:07 PM" which is when it was actually recorded

Thank you for looking into this :)

luxzg avatar Apr 04 '23 05:04 luxzg

Thanks for the information.

MPEG TS files do not support any metadata as such (you can check this ExifTool Forum thread) - it can only be contained in elementary audio, video etc. streams they contain. This means the support is limited to certain cases - that's why I asked for a sample.

In this case, the recording time most probably comes from H.264 video stream, as explained here. I'll try to implement a similar logic.

gino0631 avatar Apr 04 '23 13:04 gino0631

Ah, interesting, I did not know that. I've read the link finally, so if it helps - camera for that sample was Panasonic TM-700 (since thread says each manufacturer does it slightly differently).

If you're also looking at the video stream to get this data, I assume you can also fetch the resolution and similar (not very important in my case, as I record 99,999% with same settings, but might be useful to someone else). Windows (File Explorer & File Properties) usually display this information for audio and video.

Thank you again, so very nice for picking this up! If I can help in any other way let me know.

luxzg avatar Apr 05 '23 09:04 luxzg