support MTS file format

Bug #695517 reported by Damon Lynch
30
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Rapid Photo Downloader
Fix Released
Wishlist
Damon Lynch

Bug Description

The MTS video format is used by Panasonic and Sony. Currently, neither kaa metadata or hachoir-metadata can extract any metadata from it. Therefore, it is ignored by Rapid Photo Downloader.

This is the folder structure used:

http://forum.videohelp.com/threads/305757-date-time-stamp-on-AVCHD-possible?s=cba8f17f83dedec4d2e254cf2f6372f8&p=1882774&viewfull=1#post1882774

The clip info file may contain metadata.

Related branches

Damon Lynch (dlynch3)
Changed in rapid:
status: New → Confirmed
importance: Undecided → Wishlist
assignee: nobody → Damon Lynch (dlynch3)
Revision history for this message
kmtathome (kmtathome) wrote :

I would love to see this implemented.. My Sony Cybershot DSC-TX7 creates MTS files and currently I'm having to copy them off the media cards by hand. Thanks!

Revision history for this message
Damon Lynch (dlynch3) wrote :

The implementation of this feature depends on support in hachoir-metadata. A hachoir-metadata developer has started to work on this. It's far from easy, as the documentation for the format is not publicly available. But I hope we can have some good news soon.

Revision history for this message
Jonathan R. Schmid (jonathan-r-schmid-deactivatedaccount) wrote :

After reading you last comment, Damon, I googled for "hachoir-metadata MTS" and this seems to be the relevant mailing list discussion: http://<email address hidden>/msg00503.html (just wanted to link to it from here in case others are interested in the details).

P.S.: Thank you a lot for RPD, it does make a difference!

Revision history for this message
thomas oberthanner (thomas-oberthanner) wrote :

hi, as i face the same problem, i wonder what information do you need to extract from the file to do an import? i just found http://owl.phy.queensu.ca/~phil/exiftool/ which is able to extract this information of one of my files:

ExifTool Version Number : 8.50
File Name : 00000.MTS
Directory : .
File Size : 8.5 MB
File Modification Date/Time : 2011:06:05 14:12:27+02:00
File Permissions : rwxr-xr-x
File Type : M2TS
MIME Type : video/m2ts
Video Stream Type : H.264 Video
Audio Stream Type : A52/AC-3 Audio
Audio Bitrate : 192 kbps
Surround Mode : Not indicated
Audio Channels : 2
Date/Time Original : 2011:06:05 13:28:27+00:00
Make : Panasonic
Audio Sample Rate : 48000

would that be enough?

let me know, if there is a way, i can help!
tom

Revision history for this message
kmtathome (kmtathome) wrote :

My apologies if this is off topic, but I suspect there are others out there waiting for support for MTS files in RPD.

After digging into exiftool some more, I found the following workaround until support for MTS files makes its way into Rapid Photo (via hachoir metadata of course). All I wanted to be able to do was to read the MTS files off from the media card, change the filename based on the creation date of the file, and to copy them to a directory hierarchy of my choosing. exiftool can actually do this pretty easily with a little trial and error. The hierarchy I use is:

Year/Month/Day/filename.MTS, where filename is YearMonthDay_HourMinuteSecond.MTS

So a typical file looks like this:

./2011/05/27/20110527_211355.MTS

So with exiftool (version 8.61 in ubuntu 11.04), I can accomplish this with the following command:

exiftool -v1 -o . '-filename<DateTimeOriginal' -d ./%Y/%m/%d/%Y%m%d_%H%M%S.MTS -r -ext MTS /media/disk

This searches for all the MTS files on my media card (/media/disk) and copies them to the directory and file hierarchy defined by the -d flag. After these are imported, I run RPD against the media card again to pull off the JPG files.. A couple of links that were helpful to me:

http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html
http://ninedegreesbelow.com/2011/imaging/exiftool_digikam/exiftool_digikam.html

Note that this does NOT preserve creation time from the original file, but given my file naming scheme it doesn't matter to me...

Maybe this can help someone else until the functionality is finished in the most excellent RPD....

Revision history for this message
thomas oberthanner (thomas-oberthanner) wrote :

@kmtathome:
THANK YOU for this perfect idea. this will do the trick until mts support will hopefully be implemented in rpd one day !

Damon Lynch (dlynch3)
Changed in rapid:
milestone: none → 0.4.3
Revision history for this message
Damon Lynch (dlynch3) wrote :

I am now working on this code in Rapid Photo Downloader. Can someone who has an MTS video file which is longer than one minute run this from the command line:

exiftool -j -duration video.mts

obviously you have to change the video.mts to be the name of your video file. Copy and paste the exact output back into this bug report, thanks.

Revision history for this message
kmtathome (kmtathome) wrote :

Awesome.. Here's the output from a rather large/long MTS file:

$ ls -l 20111013_055016.MTS
-rwxrwxrwx 1 root root 1005256704 2011-10-15 16:36 20111013_055016.MTS
$

$ exiftool -j -duration 20111013_055016.MTS
[{
  "SourceFile": "20111013_055016.MTS",
  "Duration": "0:10:56"
}]

Revision history for this message
Damon Lynch (dlynch3) wrote : Re: [Bug 695517] Re: support MTS file format

Thanks. It looks like the output of exiftool varies based on the type of
file it's reading. Some values are strings, others are floats. And in this
case, it seems that if the duration is less than one minute, it says for
example "36 s".

Revision history for this message
kmtathome (kmtathome) wrote :

I noticed this too.. Turning off the string conversion (-n flag) doesn't have this issue. Could this be used instead?

$ exiftool -n -j -duration 20111013_055016.MTS
[{
  "SourceFile": "20111013_055016.MTS",
  "Duration": 656.050481777778
}]

$ exiftool -n -j -duration 20111013_060119.MTS
[{
  "SourceFile": "20111013_060119.MTS",
  "Duration": 6.53604977777778
}]

Revision history for this message
Damon Lynch (dlynch3) wrote :

Indeed it does, thanks. I didn't notice that before.

Revision history for this message
Damon Lynch (dlynch3) wrote :

I've written the code and pushed it to launchpad. Let me know if you want a tarball to test it out on your video files. I would definitely appreciate it if you did that, in case there are bugs.

Changed in rapid:
status: Confirmed → Fix Committed
Revision history for this message
kmtathome (kmtathome) wrote :

Would be happy to test it. Please send the tarballl..

Revision history for this message
Stian Jordet (stian-web) wrote :

I'm a bit slow, but I have tested now. And as expected it works perfectly :) Thanks a lot! :)

Damon Lynch (dlynch3)
Changed in rapid:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.