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.
Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
Please consider supporting us by disabling your ad blocker or buy PlayOn and record Netflix! :)
+ Reply to Thread
Results 31 to 60 of 127
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.
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.
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
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.
I made it on Vista 64, so I would think that it would be OK with Windows 7. Does the avchd2srt commandline tool from HD65 work on your file? The program is based of the same underlying code.
Is the error an unhandled exception? If the underlying FFMPEG library can't read the file, I think I made the program throw that exception. I'll check later when I get home. Also, if you have a small m2ts file you can send me, I can test with that. I only have files from my canon camera, and the ImageMixer program that came with it.
If for some reason the FFMPEG library is unable to open the file you select, the the program pops up a dialog box which says "There is a problem with the subtitle file. You may not have selected a .mts or a .m2ts file or it may be corrupt."
I'll change the message, as it is not a subtitle file that is attempted to be opened, but rather a video file. There are a number of possible errors that will cause this same message to be displayed, all of them due to FFMPEG choking on the file in some way. I will change the error message to reflect which actual error that FFMPEG gives.
By the way, all the source code is available at http://code.google.com/p/sublib1/ so you can feel free to grab it and make changes. If anyone wants to check back in their changes, let me know and I'll add you to the list of people who can check in changes. I made everything there with Visual Studio Express, so anyone can rebuild it if the choose. You'll need to grab the FFMPEG libraries and headers though.
I'm not sure on how to use avchd2srt, I ran the exe file but the cmd window popped up for about half a second then went away and nothing else happened.
It's a command line application . You have to open a command prompt and type in the commands (start=>run => type in cmd). The documentation included lists the commands
Are your files .m2ts or .mts ?
You can make a batch file, to process all the files in a directory by double clicking the .bat file
for %%a in ("*.m2ts") do avchd2srt-core %%a pause
place that .bat file in the same directory as the videos, and place copy of avchd2srt-core.exe in the same directory as well, then double click the .bat file
here , I uploaded for you
yep, in the other thread you said you wanted blu-ray , so the easiest way would be to use multiavchd
there are guides and walk throughs with pictures on the author's site , other people have produced tutorials and guides as well
if you wanted output other than blu-ray, you can use those srt subs to hardsub any file type; that's the versatility of using soft subs , it leaves you every option open with original quality files. If you wanted to re-use the files for other projects, you can do so.
in general, hardsubbing is bad practice. It's like spray painting a car - it permanently defaces the video (requires re-encoding) . Soft subs enable you to toggle on/off, without affecting video quality
If you just wanted to preview the files , you need a player that supports srt subs. For directshow players like WMP, MPC, install directvobsub . The files have to be in the same directory with matched names (but they already should be from that script) e.g
There was some talk about timing issues earlier in this thread , so just preview the files to make sure the timing is ok. If timing is off, provide a video sample so it can be debugged. It works ok for me, but HD65 probably didn't test every camera model or brand out there
Last edited by poisondeathray; 5th Apr 2011 at 12:27.
If I wanted to make the same file type (.m2ts) what program would you suggest?
Thanks for the help poisondeathray and caen44
.m2ts is a transport stream ; it's a container format that can hold different types of audio & video . Think of it as a box that can hold different types of video & audio plus other stuff like subs and metadata. Yours specifically uses h.264 compression (and probably AC3 audio)
if you wanted to re-encode and use the same video and audio format, you could still use multiavchd or avchdcoder , but again you will lose quality re-encoding (also takes time, maybe hours or days depending on your computer)
Everytime you re-encode with a lossy format you incur generation loss (it degrades each round) .
Lets say you don't like the subtitle color, or position, or text size is too small to be legible when you're making a blu-ray for the kids. You can't go back and alter that later if you've already hardsubbed it. Soft subs leave every option open
Last edited by poisondeathray; 5th Apr 2011 at 12:38.
So poisondeathray, if you use Soft subs does it put the date and time on the video itself or under it and if you use Soft subs then you do not need to re-encode the file?
soft subs overlay the data onto the video. It's a function of the plugin or video player - it displays that data "on top" of the video. You don't need to re-encode the file if you use soft subs, that's part the beauty of soft subs . It's not a "permanent" feature. You can toggle it on / off. Think of subtitles when you are watching a retail foreign film on blu-ray or DVD. It's analgous to that
Give it a shot , playback some files on the PC
For blu-ray , multiavchd has both soft sub and hard sub option. If you don't re-encode, you keep the same quality as your original files , and the process will take mintues instead of hours (or days). AVCHD video from camcorders is already blu-ray compliant.
The only time where I think hard subbing might be useful is forensic applications (But I doubt srt subs hardcoding method will be valid in court, it would need time/date from the camera itself) , or if the application you're using doesn't support soft subs
srt subs are basic "text based" subs. They have no size or formatting or fancy display options. But some media players can display them differently (e.g. control size, color etc...). Or you can change them to SSA/ASS subs , which do have display information and text formatting
Since the avchd2srt command line tool worked it must be some mistake in my code, or a difference in the FFMPEG libraries used. Under the hood I copied the code from HD65 that calls FFMPEG functions, so I'm not sure what to fix as it works on all the files I have.
I have posted a new version at http://code.google.com/p/sublib1/downloads/list that gives a little more information about the error types that occur when the program is unable to open a file.
Here is the message I get now with the updated version:
the error type is: Unable to load DLL 'Sublib1.dll': The specified module could not be found (exception from HRESULT: 0x8007007E)
I think I got it poisondeathray
If I want to make DVD's with date and time I would need to use hard subbing. If I want to watch it on my computer I could use soft subbing.
I wish a software vendor like Vegas would just add this as an option. I have video of my parents from 30 years ago and wish I knew when the video was made. That is why I want to put it in my video's so my children will know when the video was made. Thanks for your and caen44's help.
DVD's and Blu-ray can use soft subs (think of when you are watching foreign movies, you can turn them on or off)
If possible, maybe you can provide a sample stream so caen44 can debug the software . A GUI is lot easier to use for most people
Thanks for the sample. It seems to work fine on my computer using the most recent version that I uploaded as mentioned earlier. But I didn't make any changes other than in the displayed error messages between the latest version and what you tried, so it should have worked for you. I don't know. It must be something about the configuration of your system that is different.
The avchd2srt commandline tool must have the FFMPEG libraries statically built into the binary, whereas I used the FFMPEG win32 dlls that are put next to the executable. Maybe you have the FFMPEG dll's registered already on your system because of some other install, and my code is trying to use those? I don't know how you check that.
I do have "HD Writer AE 2.0" loaded on the computer. Maybe it could be that.
That is odd. Did you extract the entire .7z file that I posted into a directory and run the SubTitleMaker.exe that is in there? You would get that error if the sublib1.dll file isn't in the same directory as the SubTitleMaker.exe and the Subextractor.dll.
It would explain why the file you provided works OK for me. I wonder if this works for anyone else other than me? If anyone else reading this has downloaded my utility from http://code.google.com/p/sublib1/downloads/list and can report to me via PM whether it works or not, that would be helpful. I don't know how to make a proper installer or deal with oldschool windows dlls, so I could see how this probably got messed up.
For those interested, I posted an update to the tool at:
This version has a batch tool allowing you to process a directory of .mts files or an entire directory tree. It will search for .mts or .m2ts files, and generate the corresponding .srt file. I found that I had many dozen .mts files in a AVCHD directory tree that I wanted to process at once, so this recursive batch is useful for me.
It has an option to overwrite previous .srt files or not.
I have only given this limited testing. As much as I have tried, I have not been able to make it damage or overwrite any of the .mts or .m2ts video files and I can't see how it could do that, but please be aware that this is not a well tested program so anything might happen. Considering that your video files might be pretty precious, I'd make a backup before messing with them using any program, including this one.
Let me know if you like it.
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
I can reproduce this error if I erase one of the FFMPEG dlls from the directory where the executable is, or if I erase the sublib1.dll file from that directory.
Do you have all these files in the same directory as the .exe?
The only thing that I can think of is that you might have the FFMPEG dlls registered on your system and the version you have is different than the one I am using. I don't know if that would give the same error or not.
Other than the two folks who have responded here with that error, I haven't heard from anyone else that this utility actually works anywhere other than my computer.
You could download the code from my google site, as well as the FFMPEG libraries, and build the program yourself. You'll need visual studio express C++ and C# (both free from Micro$oft). Setting it up to build is a little tricky, there are instructions to build sublib1 (the tricky part) in the wiki on the google site, and I can give you a hand if you wish.
If I do figure this out I'll be sure to post an update, but since I can't get the same problem you folks are having, I'm not sure what to fix.