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 127
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.
Be interesting to see how it works for Canon. If it does not, please make a short clip available and I can start looking.
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.
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...
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....
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.
I wrapped up the fantastic little program made by HD65 in a simple GUI that allows you to select between two methods of determining the frame rate. The file is here:
I haven't really tested this on any mts clips longer than a few minutes, so I don't really know how stable it is. Feel free to try it and let me know. Un-7zip the file above into any location and Run the SubTitleMaker.exe file. All the dlls in the zip file need to be in the same folder as exe for it to work.
HD65, if you don't object, I'll place all the source code up on google code so that anyone here can download it and modify it for their liking.
Please don't use the file in my last post. I was confused by the FFMPEG documentation and the program will crash trying to read subtitles from very large files. I have corrected the problem, and it seems to work ok for me. I also added the ability to select to display the time in the subtitles or not.
The download link is:
If I make changes or improvements, I'll post them there also.
Many thanks for making this nice work available to us.
I have got a Canon HF S11, which outputs AVCHD MTS files. I tried avchd2srt-core.exe under Windows 7 and it did work, it produced the correct srt file.
However, I have not been able to add this srt file to my mts files using Tsmuxer, and when I tried VLC to read both files it stops dead [it can read my mts file if it was put in another folder, but when both files are in the same folder and have the same name for e.g file1.mts and file1.srt, VLC will stop dead showing nothing].
I tried with WMP Classic (using vrm7 and vrm9 output), it played the mst file but did not show the subtitles.
Is there a way to put the srt file within MTS envelope without the need to re encode ?
I need to run my MTS files with their subtitles on a stand alone media player.
Any help would be appreciated
I have found that vlc player does not read the subtitle (.srt) files, and crashes (as you described) when one attempts to open a mts file with a corresponding .srt file in the same directory.
However, I found that the lastest version of SMplayer works nicely in this regard. It is available here:
Also, I found a bug in the batch tool of the program I posted early. I have fixed that, so you should be able to create subtitles on a whole directory tree of .mts files, and view them with SMplayer. The latest version I have posted has the fix.
Thanks very much caen44
Is there a way to get avchd2srt-core.exe to export only the date from an AVCHD file? I would prefer it in this format:
Day Month Date, Year (ie, Tuesday July 26, 2011). I don't want the time.
Whenever I try to run the cmd script I get "Files was unexpected at this time", if I run avchd2srt-core.exe, it works but without the address info. wget and gawk are installed.
There is no such message generated by the script or core itself.
What version are you using and how are you using it (file names? paths? wild cards?). How is it installed (in a folder of video files or in a separate folder in the PATH)? What version of windows? Has it ever worked for you?
If everything fails try editing the avchd2srt.cmd script taking out the line with "@ECHO OFF". That will indicate where it goes wrong.
I just took the code from HD65 and put a simple GUI around it.
I don't know about the Visual AVCHD time stamp, the description suggests that it can actually stamp the time and date right into the video. I don't know if it creates subtitle files (although it would be real easy for it to do so, if the author so desired).
The code I posted just makes a subtitle file that you can import into your DVD authoring software along with your video file.
As far as being better than Visual AVCHD, I doubt that it is, particularly considering that this is the first hobby programing project that I have done. It is better in one way, though, it is free (HD65 used gpl v3 for his code, same for the gui).
It does what I need if for, and if it is of any use to anyone else, even better.
Does this program work on Windows 7 64bit?
I tried opening a M2TS made by Panasonic but get a error message saying I'm not opening a m2ts file.
Last edited by jjblackisback; 4th Apr 2011 at 15:04.