Is there any simple free tool out there that takes an AVCHD stream (.m2ts etc) and yields a text-based subtitle file (.srt etc) with the frame specific metadata as content? My Sony camera generates this metadata (time, date, shutter info, geo info) and stores it for each frame (perhaps group of frames) and DVMP seems to be the only tool that can read it. But DVMP is not free.
+ Reply to Thread
Results 1 to 30 of 124
If someone knows a related forum to post this question in please advise as well...!
Bumping this thread because I have the same request and it is more than 7 months later.
DVMP appears to do this, but this feature is disabled in the demo version, and $70 seems a bit steep, anyway.
multiAVCHD has potential, but needs some work in this area, especially for geotagging.
My ambition is to extract the date/time and geotagging data, to place in a subtitle track of my edited home videos on a Bluray disk or DVD.
I recently came across http://hirntier.blogspot.com/2010/02/avchd-timecode-update.html
This seems to have potential as well - bgavdump can read the metadata in the stream, it seems straightforward to create the converter we're looking for from that.
However, to date I've not been able to compile it successfully (on Ubuntu 9.10).
Any help appreciated.
OK - I finally created a converter using the ffmpeg library. Testing it at the moment. Let me know if anyone is interested.
So, in goes an m2ts file (from a Sony camcorder for instance) and out comes the corresponding subtitle srt file with date, time and geo information. My mediaplayer plays them nicely together.
Does someone have a little program/script that takes latitude/longitude info and converts it to place/state/country?
HD65, thanks for taking up the challenge. I am interested (see my earlier post) and willing to beta test. I have a Sony HD camcorder which produces mts/m2ts files containing date, time, geotagging and camera settings metadata. Ideally, I would like to create .sub files to use with Sony Vegas and DVD Architect.
Not sure how many people read this thread but the "avchd2srt" program seems OK sofar, so looking for a few more testers.
From Sony HD files it will extract time, date and geo info and translate it to a corresponding SRT file. It also translates the position info to an address. Note that this is not taken from MODD or MOFF files, but from meta-data in the video stream.
Would be interested to hear about some more experience with it, in particular on non-Sony AVCHD files.
It runs on Ubuntu (10.10), also under Windows via vmplayer.
Very interesting. Sorry for being a noob, but is there any way in running this under Windows?
(I do not have linux and I'm not familiar with that OS).
HD65, I've got a Canon AVCHD camcorder, and a Fedora system. I'll give it a shot.
The distribution comes with the source and explanations on how it compiles. If you manage to compile the ffmpeg package under windows, then adding this one should be a breeze.
You may find that running Ubuntu via VMPlayer under windows is a lot less difficult than you thought. It's all free software, and will open a new world for you! No partitioning or whatever needed, actually quite straightforward.
Be interesting to see how it works for Canon. If it does not, please make a short clip available and I can start looking.
http://www.mediafire.com/?f2wpl8frcfhj4na. But note: this is the core program only. It just takes one input file, and sends SRT to output and other info to stderr. It does not translate position to address.
So for correct use, open a CMD window and type "avchd2srt-core YOURFILE.MTS > YOURFILE.srt 2> YOURFILE.INF".
Let me know what you think...
Sorry it took a while for me to respond.
This is surely great !
It works like a charm here.
Sample screenshot showing it
Here the srt and inf file contents
So I'm very happy and pleased to finally see a way to get the datecodes from AVCHD files.
What I do not understand is why there are no tools like this. Al least they are hard to find.
When looking at the DV format, there are numerous (free) tools to extract the info and save it as sub/srt.
Why are there not more such tools for the AVCHD format ?
First for your info, I'm using a Panasonic HDC-HS60 camcorder.
So, what are your plans with this tool? Are you enhancing it further?
For the DV format I use DVSubmaker :
This tool offers a template system, where you can use tags to indicate how the datecode is presented.
For instance, here a screenshot showing this on one of my video's:
The language of the days and month can be adjusted. Also the rate of datecode display (second, minutes etc).
I could write a wrapper around your tool to convert the generated srt into needed formats.
I do not know if your sourcecode is public so I can tweak it to get the needed results.
But this is already very cool !
I don't intend to develop it much further. I'm tuning it a little, essentially for it to behave a bit better on windows. The linux version works fine already, I'm especially pleased with the translation of GPS position info to an actual address on linux.
The source code is in the linux distribution, not the windows distribution. Wait for version 0.4 before your tweak it - that's the one which compiles flawlessly under windows/mingw as well.
Last edited by HD65; 17th Jan 2011 at 00:57.
To elaborate some more on the tweaked output of avchd2srt.
I was thinking of creating the output exact like the intermediate file of DVSubMaker.
It extracts the DV avi and saves a .dvdt file which has this format:
00000001 07 04 08 12 09 30 00000019 07 04 08 12 09 31 00000044 07 04 08 12 09 32 00000069 07 04 08 12 09 33 00000094 07 04 08 12 09 34 00000119 07 04 08 12 09 35 00000144 07 04 08 12 09 36 00000169 07 04 08 12 09 37 00000194 07 04 08 12 09 38 00000219 07 04 08 12 09 39 00000244 07 04 08 12 09 40 00000269 07 04 08 12 09 41 00000294 07 04 08 12 09 42 00000319 07 04 08 12 09 43 00000344 07 04 08 12 09 44 00000369 07 04 08 12 09 45
When avchd2srt creates such a formatted file, it can be read by DVSubMaker and creates a .sub file from it.
This .sub file can be formatted using the build in options of DVSubmaker.
I tried the windows version,
nice work , and thanks HD65
I posted V04 here: http://www.mediafire.com/?q0j3h61u4jwrt3s. This one compiles under Linux as well as Windows/MinGW, has a few new features and bug fixes.
The package contains the source, both the linux and windows executables and the Readme.
Here is a picture showing the features:
From the Readme:
AVCHD2SRT for Windows and Linux
FFMPEG-based program to extract the time/date/GPS/speed information from a h264 video stream and make this available in a subtitle file of the SRT format.
On the linux version, using googleapi, the location information is translated to an address (street/place/state/country) where possible and added. An internet connection and the packages "lynx" and "awk" are required for this to work.
Tested on Ubuntu 10.10 and Windows 7 – older/other versions may work as well.
Last edited by HD65; 31st Jan 2011 at 15:17.
I'm new here, and after getting a new camera that records in AVCHD, I have spent the last week trying to find a way to get the time/date metadata into subtitles. I usually use Corel Moviefactory which does this automatically for DV files.
Anyway I ran into this thread after much googling, and sure enough this tool works. Thank you!
Except for one thing. The srt file that it creates generates subtitles that are exactly 2 fold to long for my video clip. For instance, if my video clip is 00:01:28 in length, the tool generates subtitles that go up to 00:02:56. Its funny because the text of the title counts up in one second intervals, but the subtitle duration is set for 2 second intervals, when it should only be one. So the subtitles don't sync match the video clip when played together.
Further inspection tells me that this only happens to files that have been "concatenated" into a m2ts file by the crappy imagemixer software that came with my camera. Srt files generated from the original clips are ok. The output of the avchd2srt tool tells me that the problematic input file has a frame rate of 29.97 but that the working file has a framerate of 59.96.
Any ideas will be helpful. Thanks so much for this nice little tool.
- Use version 0.4 of avchd2srt. It's a lot slower, but uses a different setting to determine frame rate.
- Use a different tool to concatenate your video segments
- Use subtitleworkshop or something to change the frame rate of the srt file
I'd be curious to hear whether that helps. If bullet 1 solves your trouble I may need to post an update....
Thanks for the advice.
What definitely works if if I use tsmuxer for joining the avchd files. If I do that, then your tool works perfectly. It's a little more work than using the combining feature of the Imagemixer software that came with my camera, but it works. If I get time, I might write a small program to dig through my video files and build the tsmuxer command so that I dont need to click a hundred times on the tsmuxer gui.
I'll also try the version 4 of your tool and let you know if that works better on the crippled files that ImageMixer makes, and let you know if that helps.
On a completely different topic, do you know if it is possible to use the FFMPEG dlls from the visual studio express environment? I pulled your c code into there, but can't compile from within visual studio. I guess I need some sort of mingw or something (http://www.ffmpeg.arrozcru.com/wiki/index.php?title=Building_64-bit_static_libraries). Unfortunately, this has passed the limit of what I can figure out myself...
I just checked, and yes indeed, your version 4 of the avchd2srt tool processes the files combined with ImageMixer correctly and I get the correct timing on the subtitle file.
And you are right, it is indeed a lot slower. But since I don't actually need to be clicking on things while it is working, that gives me time to play computer games. So I'll consider it a feature.
Thanks again. This is awesome.
Thanks so much.
I think I can see where you changed the code to use a different way of determining the frame rate, the other method being commented out but still visible in the source.
I also think I am 80% of the way to compiling your code under visual studio. In case you are interested I found this link:
The SDK shared library seems to have all the headers needed to compile under visual studio. Your source compiles to object code, but the linking fails. If this works then I don't have to figure out mingw, and I won't need to bug you to customize it to my needs.
On the other hand the odds of me actually getting it to compile are low, so I really appreciate you posting the 0.6 version.
Thanks so much.
Could you make some test video files available: the ones from the camera and the combined one using Imagemuxer?
Reason I ask is that I have trouble finding the most robust way to extract the fps. Using the old method (which seems to work better for you) fails on my tests for Panasonic video fragments.
I am away from my main computer for the weekend (skiing, yahoo), but will be able to get you some when I get back home on Tuesday. I'll put them somewhere on the internet and send you a message with the link.