View Full Version : Joints 1.0.2: joining files with unequal audio/video
Turtleggjp
9th September 2009, 16:04
I'm (neuron2) adding a link to Joints here to make it easy to find for newcomers to the thread:
http://neuron2.net/misc/joints102.zip
-----
It could only be to add frames at the end of your files. With the workaround, yes, they get added at different spots but the desync can never be more than one frame at any given time, which is not perceptible.
And to be honest, developing a proper solution for this is very low on my priority list.
I think you're looking at solving this problem the wrong way. The way I do it with my AVCHD camcorder is by removing audio frames instead of adding (repeating) video frames. I did my usual calculations that I do when I have a series of clips to the 3 sample clips he posted. Here are my results:
Clip1:
Video Frames: 3780 (126.126 sec)
Audio Frames: 3942 (126.144 sec)
Excess Audio: ~18ms <-Greater than 16ms (half of one frame) so DROP one audio frame!
Audio is now ~14ms too short.
Clip2:
Video Frames: 1290 (43.043 sec)
Audio Frames: 1346 (43.072 sec)
Excess Audio: ~28ms <-WAIT! Audio is already 14ms behind.
Adjust for previous clip: ~14ms <-Less than 16ms (half of one frame) so Leave this one alone!
Audio is now ~14ms too long.
Clip3:
Video Frames: 810 (27.027 sec)
Audio Frames: 845 (27.040 sec)
Excess Audio: ~13ms <-WAIT! Audio is already 14ms ahead.
Adjust for previous clip: ~27ms <-Greater than 16ms (half of one frame) so DROP one audio frame!
Audio is now ~5ms too short
Presto! Your clips are never more than 16ms out of sync either way. I've been doing this for a little over a year now with my camcorder's footage, and it works great. In fact, I just finished a trip that had about 271 clips.
I use a spreadsheet in Excel to help me set everything up, including using DGAVCIndex to index all my clips and produce an audio file for each one. Using the .dga file for each clip, I can determine the number of video frames. I then run AC3 Cutter on all the audio clips, and it reports the number of audio frames. Once I have this information, all the information I posted above can be calculated. I then have tsMuxeR join all my clips together (with unsyncronized audio) and then have AC3 Cutter go in and trim out all the audio frames that I determined need to be cut out. I can then run tsMuxeR again, but this time have it not use the audio in my clips, but instead use the audio file created by AC3 Cutter. I now have a .M2TS file with all my videos joined together, and with syncronized audio.
If this sounds like a complicated process, well yes it is. I consider it more of a proof-of-concept. Eventually, I'd like to either make up a little tool that would be able to generate the synced audio track, given a series of clips, or else hope that someone like Neuron2 would be willing to add code to his tools to create the synced audio track. All you need to know to do the calculations is:
1. Number of video frames per clip (Indexer already knows this)
2. Video frame rate (Indexer already knows this)
3. Number of audio frames per clip (this could be trickier)
4. Audio frame rate (31.25 fps for AC3 audio, the most common in AVCHD camcorders).
By creating a "camcorder mode" in the indexer, AC3 audio can be assumed for now until more codecs start showing up. That might help figuring out #3.
What do you think Neuron2? I'm willing to help you on this if you need any more info.
Matt
Guest
9th September 2009, 17:56
Yes, I understand that cutting audio is an option, but I assumed it may create objectionable pops.
But anyway, sure, it's possible. First, I'd prefer to do this with a preprocessing tool rather than in the DGNV tools. But second, as I said, it's very low on the priority list for me, especially since I have an acceptable (to me) workaround that doesn't involve the massive effort you are going through.
Turtleggjp
9th September 2009, 19:24
Yes, I understand that cutting audio is an option, but I assumed it may create objectionable pops.
I think I understand what you mean by pops. I want to clarify that my method is only useful for camcorder files, not seamless branching Blu Rays like Ratatouille. Files on a seamless branching Blu Ray should naturally combine together (perhaps with a video frame repeat or two) and the audio should not be cut. With camcorders though, the clips do not naturally combine together (since they are usually created from two different scenes) and so there is already a "pop" at the junction.
One other thing, I can think of a couple different types of "pops." One is caused by having a complete audio frame missing, which simply results in missing data. This can be tricky to hear if the audio is quiet. Even if it is loud, it may take careful listening to hear. These "pops" are not too bad, but should probably still be avoided. The other kind of "pop" occurs when a program blindly trims audio data as if it were LPCM. This can result in a very loud pop or chirp, since the compressed data has now been altered significantly. These types of "pops" should definitely be avoided.
This is why I suggested the "camcorder mode" option. My method works for camcorder files, like the ones posted, but should not be used for seamless branching Blu Rays.
But anyway, sure, it's possible. First, I'd prefer to do this with a preprocessing tool rather than in the DGNV tools. But second, as I said, it's very low on the priority list for me, especially since I have an acceptable (to me) workaround that doesn't involve the massive effort you are going through.
Ok, I'll see what I can do about a preprocessing tool. I've wanted to do that for a while now, as I think it would be very useful for people with AVCHD camcorders. You'll have to be patient though, I'm not a highly experienced developer like Neuron2...
EDIT: BTW, it was only a massive effort creating the Excel file that I use as a template. Now, it's just a moderate effort. :)
Guest
9th September 2009, 19:58
How do you automate the actual audio frame cuts? Does AC3 Cutter take a cut list of some sort? What is the link to this cutter tool?
I'm starting to get a little interested. :)
rack04
9th September 2009, 20:33
How do you automate the actual audio frame cuts? Does AC3 Cutter take a cut list of some sort? What is the link to this cutter tool?
I'm starting to get a little interested. :)
Speaking of cut list, is there a way to translate the trim/cut points (pressing [ and then ]) specified in the dga/v/m files to a cut list to trim the audio at the same points?
For example:
RANGE 1110441 4582562
Guest
9th September 2009, 20:58
First things first. We're thinking along the same lines, but I want to know about this cutter thing first.
Turtleggjp
9th September 2009, 21:06
Found it:
http://forum.doom9.org/showthread.php?t=92325
I actually use a modified version that fixes a couple issues with his parsing of the cut list. I've been using it for a couple years now to cut the audio on my captured TV shows.
Basically, it takes a VirtualDub style .vcf file as its cut list, which my Excel spreadsheet generates for me. For example, here is the one it generated for those 3 sample clips:
VirtualDub.subset.AddRange(0,3941);
VirtualDub.subset.AddRange(3942,1346);
VirtualDub.subset.AddRange(5288,844);
Guest
9th September 2009, 21:33
Reading that thread, the author says it's buggy and shouldn't be used!
Who made your modifed version of it? Is it also buggy? Can we have the source code?
What is the syntax of the AddRange() function?
I'm sure people will ask: What about AAC, LPCM, and MPEG audio? :(
Turtleggjp
9th September 2009, 22:14
Reading that thread, the author says it's buggy and shouldn't be used!
I think he was refering to the way he determined which audio frames to take, which was buggy. I figured out how to do it right, and modified the code, which leads to...
Who made your modifed version of it? Is it also buggy? Can we have the source code?
I modified it, as far as I know it is not buggy, and yes here is the source code.
What is the syntax of the AddRange() function?
AddRange(StartFrame, NumberOfFrames), just like VirtualDub.
I'm sure people will ask: What about AAC, LPCM, and MPEG audio? :(
Good question. Do you know of any camcorders that use these? As I said, my method is so far only for AVCHD camcorder clips, not Blu Rays.
Bottom line, AC3 cutter does have a lot of extra stuff in it that I never need, like patching bitrates to a higher one in order to maintain constant bitrate. I basically threw this method together with what I had and filled in the gaps where needed. I figured your tools already know how to pull the audio files out of .M2TS files, so it's just a matter of looking at the audio and counting how many frames are in it. With a little analysis, you can determine when to throw out a frame when joining files together.
Really bottom line, this works great for me, and I would be happy to share what I know to get it working for others as well.
EDIT: Most of my modifications to the code are in the "parseVCF" function in the "ac3functions.c" file. I seem to have commented it pretty well, so I hope you can follow what I did.
Guest
9th September 2009, 23:55
Thanks, Matt. I think I may make something out of this along the lines of the preprocessing utility we discussed above. Automatic cut list generation is a must.
Turtleggjp
10th September 2009, 00:17
Absolutely. That's basically what my Excel spreadsheet does is generate that cut list. Prior to that though, it also creates a batch file that calls DGAVCIndex for each clip, and then another batch file that runs AC3 Cutter on all the audio clips created by the first batch file (to have it report number of audio frames for each one). Once the data from these two runs is gathered into my spreadsheet, it can make the cutlist. After that, AC3 Cutter does the actual cutting after tsMuxeR has (blindly) joined all the clips together and then demuxed the audio track.
Guest
10th September 2009, 22:58
OK, first phase completed. I have a working GUI that takes a file list and determines the info needed for the cuts. Tested it successfully on the camcorder files and on Ratatouille M2TS files. The app is tentatively named "Joints".
Next step: integrate the cutter code so that the GUI app can directly correct the already demuxed audio file. Of course that will make the whole thing open source.
Guest
11th September 2009, 01:37
Matt, I've run into a problem with your code. The syntax you give above for your AddRange calls passes the audio frame numbers, e.g. 3942 as the start of the second range. But it appears that these are interpreted as video frame numbers in the code:
FrameTime = 1 / vfps;
Time = ((sFrame + nFrames) * FrameTime) - dDelay + Sync;
RoundUp = ((Time / AC3Time) - (long)(Time / AC3Time)) >= .5;
tPtr->endFrame = ((long)(Time / AC3Time)) + RoundUp; You can see that Time is calculated using the video frame rate! Also, doesn't VirtualDub expect video frame numbering in those calls?
So, please explain. I do not see any reason for the cutter to know about the video frame rate if it is receiving cut data referred to audio frame numbering.
I can fix it to use the audio frame numbering as it should but thought I better mention it so you are aware that you may have been doing things wrongly.
Turtleggjp
11th September 2009, 02:03
Matt, I've run into a problem with your code. The syntax you give above for your AddRange calls passes the audio frame numbers, e.g. 3942 as the start of the second range. But it appears that these are interpreted as video frame numbers in the code:
FrameTime = 1 / vfps;
Time = ((sFrame + nFrames) * FrameTime) - dDelay + Sync;
RoundUp = ((Time / AC3Time) - (long)(Time / AC3Time)) >= .5;
tPtr->endFrame = ((long)(Time / AC3Time)) + RoundUp; You can see that Time is calculated using the video frame rate! Also, doesn't VirtualDub expect video frame numbering in those calls?
So, please explain. I do not see any reason for the cutter to know about the video frame rate if it is receiving cut data referred to audio frame numbering.
I can fix it to use the audio frame numbering as it should but thought I better mention it so you are aware that you may have been doing things wrongly.
I thought of this last night. What's going on is that this program was originally designed to work with video frames as cut points, not audio frames. This is because the .vcf files were supposed to come from VirtualDub, which is talking about video frames with its AddRange function. In fact, the code I fixed deals with this conversion from video frame rate to the audio frame rate. This fix is almost unnecessary for the application we are talking about, since when I call this program, I specify a frame rate of 31.25 (AC3 frame rate). This is supposed to make the conversion from video frame rate to audio frame rate a simple 1:1 conversion. I say almost unnecessary, because the program does not recognize the simplicity of the conversion and did all its calculations anyway. Due to the bugs in the code, it would occasionally miss cut the audio by a frame here and there. I built a checking function into my Excel spreadsheet to catch these errors, so I could correct them (This got to be tedious sometimes). Once I corrected the code, these errors have never happend again, but my code still does not do a simple 1:1 mapping of the cut points when a frame rate of 31.25 is specified.
I made my fixes to the code in order to cut audio on HD captures long before I had my AVCHD camcorder. When I finally got my camcorder and realized what was happening when I tried to merge my clips together, I realized I needed a way to cut frames out. This led me back to AC3 Cutter. So as you can see, it's a classic case of using a program for something that it was not exactly intended to be used for.
Anyway, to answer your question, you can probably ignore the code that seems to be converting video frames to audio frames. Whenever I run this program for this purpose, the two are the same.
Matt
EDIT: Here is a sample of one of my command lines:
"E:\Apps\AC3 Cutter v0.4\AC3 Cutter.exe" -fr 31.25 -vcf "E:\Video Camera\AVCHD\090828 - Lake Basin\090828 \
- Lake Basin.vcf" -o "E:\Video Camera\AVCHD\090828 - Lake Basin\090828 - Lake Basin.txt" \
"Q:\090828 - Lake Basin.track_4352.ac3" "E:\Video Camera\AVCHD\090828 - Lake Basin\090828 - Lake Basin.ac3"
Guest
11th September 2009, 02:15
Whoa, you lie about the frame rate!
That's real hacky. I'll have to clean it all up. I assume you are not a professional software developer. :)
Turtleggjp
11th September 2009, 02:31
Whoa, you lie about the frame rate!
That's real hacky. I'll have to clean it all up. I assume you are not a professional software developer. :)
Yes it is. You can probably just throw out all that code that converts video frames to audio frames, since you are already calculating the audio frames that need to be taken.
Like I said, this program was not designed for this particular application. Turned out, I was able to get it to work pretty well, and then it turned out that my fixes made it work perfectly. I've been meaning to write a tool like you are doing, but I feel fortunate that I was able to port my "code" over from Excel into a C++ program. As you have guessed, no I am not a professional software developer (yet...).
Guest
11th September 2009, 07:13
OK, I have fixed up the cutter. It is still separate and my GUI writes a cut list.
I applied it to the Ratatouille BD and the result was perfect sync. The process removed 512ms (16 frames) of audio as needed.
I will integrate the cutter into the GUI and then make a beta release.
Matt, I want to commend you and thank you for bringing this idea and process to the fore.
Guest
11th September 2009, 14:58
It's all done and integrated into one convenient GUI.
You first demux the AC3 audio as usual. Then you open Joints, specify the source transport files, select the AC3 file, set your PIDs and frame rate, and then hit Process. When it finishes you have a trimmed AC3 file. A cut list is also written.
I just have to write the help file and then you can have it.
Guest
11th September 2009, 17:42
Here is the first version. Source code will be released after some initial feedback.
http://neuron2.net/misc/joints100.zip
Guest
12th September 2009, 01:37
Now with VC-1 video support:
http://neuron2.net/misc/joints101.zip
Inspector.Gadget
12th September 2009, 02:34
I read the documentation included in the 1.0.0 download: is that audio frame length issue present any time a Blu-ray playlist spans more than one M2TS file? Does the Blu-ray playlist structure somehow compensate for this?
Thanks for the tool BTW, it amazes me how quickly the forums' crack tream of developers always comes up with something!
Guest
12th September 2009, 02:53
I read the documentation included in the 1.0.0 download: is that audio frame length issue present any time a Blu-ray playlist spans more than one M2TS file? Yes. Here are the possible video frame times @ different frame rates:
23.976: 41.7 ms
24: 41.67
25: 40
29.97: 33.37
30: 33.33
An AC3 frame is 32 ms. Therefore, because the streams have integral numbers of frames, the probability is very high that the video and audio streams are not exactly the same length.
This is not an issue for BluRay players because they maintain sync using the PTS timestamps. It becomes an issue when you naively concatenate the streams for transcoding or remuxing.
The more files you have the greater the potential problem. For example, on the Ratatouille BD, there are 31 M2TS files in the main movie playlist, and the cumulative desync is 512ms towards the end of the movie. You notice that!
Does the Blu-ray playlist structure somehow compensate for this? No. At playback time the sync is maintained using the PTS timestamps.
Turtleggjp
12th September 2009, 06:17
Sorry I haven't been around much today to comment, I'm in the process of experimenting with Linux on my home system, and haven't had an easy way to get to this site all day.
Matt, I want to commend you and thank you for bringing this idea and process to the fore.
Thank you. That means a lot to me coming from a legend like yourself.
Yes. Here are the possible video frame times @ different frame rates:
23.976: 41.7 ms
24: 41.67
25: 40
29.97: 33.37
30: 33.33
An AC3 frame is 32 ms. Therefore, because the streams have integral numbers of frames, the probability is very high that the video and audio streams are not exactly the same length.
This is not an issue for BluRay players because they maintain sync using the PTS timestamps. It becomes an issue when you naively concatenate the streams for transcoding or remuxing.
The more files you have the greater the potential problem. For example, on the Ratatouille BD, there are 31 M2TS files in the main movie playlist, and the cumulative desync is 512ms towards the end of the movie. You notice that!
I'm assuming that for right now this only works with AC3. Since you are also interested in using this program with Blu Ray disks, I'm sure you will eventually run into DTS and other formats that will need similar trimming. LPCM should be easy to trim though.
I'll give this a try tomorrow with one of my sets of footage from my video camera. I already have an audio track trimmed by my method, so I'll see how it compares to what your program creates.
No. At playback time the sync is maintained using the PTS timestamps.
For a brief time when I tried using PowerDVD to play Blu Ray discs, I remember during "Meet the Robinsons" how the video would seem to pause slightly at times during the movie. This is probably how the player maintained sync across multiple files using the timestamps. I don't suppose it would be possible to re-create this type of behavior when indexing a Blu Ray movie with your tools, would it? Perhaps listing a frame in the index file twice would cause it to be decoded twice, thus creating a repeated frame. Like I said before, the technique of removing audio works great for camcorder files where the audio has a natural break, but on a movie like Ratatouille, some people might prefer to not have data missing like that.
Guest
12th September 2009, 14:00
I didn't notice anything in the Ratatouille audio after cutting. But of course the alternative strategy of adding video could be considered. I'll be driven by demand, i.e., based on what crops up in the wild and what users actually ask for based on real cases.
laserfan
12th September 2009, 15:14
I guess this is one of those "if you don't know why you'd need it, then you don't need it" tools, but as usual I'm confused about something; in the docs it's stated:
...load the transport stream files into your demuxer and demux the AC3 audio in the
normal way. At this point the AC3 file is not synchronizeded to the video, due to the presence of the
excess audio. Joints will create a new AC3 file with the excess audio deleted.
If my "normal way" of demuxing is to use eac3to, which not only demuxes but also re-joins (to make a single continuous audio track), then is its re-joining defective? neuron2 I know you don't like to comment on others' tools, but if you didn't use eac3to to demux Ratatouille then what do you use normally? :confused:
Guest
12th September 2009, 16:25
I use DGIndex (and NV variants) of course!
I doubt that eac3to adjusts the audio to account for these joins, but I haven't tested it. I'll test it and report back.
laserfan
12th September 2009, 16:46
I use DGIndex (and NV variants) of course!...oops... :o
Thanks for indulging me... :)
Turtleggjp
12th September 2009, 20:34
I use DGIndex (and NV variants) of course!
I doubt that eac3to adjusts the audio to account for these joins, but I haven't tested it. I'll test it and report back.
Actually, I think it does. I remember using it on The Simpsons Movie (DTS Master Audio) and it did some adjustments on that. The movie was only in 4 pieces though, so it wasn't nearly as complex as Ratatouille. I do remember using eac3to for Ratatouille though, and it did do a good job at cutting the AC3 audio.
Turtleggjp
13th September 2009, 00:13
My initial test today was with a series of 132 clips from my camcorder. At first, it did not make any cuts, and the cuts file had only 0,0 in every line. Turned out, my audio PID was 1100 instead of the default 1101. After correcting this, the cut list now matches what I was getting when I created my .vcf file using my old method. However, the result is still exactly the same size as the original (about 2 seconds and 59 KB should be removed). I'm going to try it again with a shorter series of clips right now. Will report back later...
Guest
13th September 2009, 01:07
However, the result is still exactly the same size as the original (about 2 seconds and 59 KB should be removed). Sorry I can't believe that. You're going to have to offer me a set of files that creates this claimed problem.
Turtleggjp
13th September 2009, 01:36
Tried another series of clips, this time only 19. Now it is actually cutting, and the results are almost in 100% agreement with what I created with my method. The files are identical in size (the one created by Joints and the other one created by my old method), and your cut list matched mine perfectly. Where we disagree is when I do a binary comparison of the files. There seems to be 7 places where it looks like a single AC3 frame does not match. I'm guessing that this is at the cut points, because checking my Excel file for that batch, there are 7 times when a frame needs to be removed. So the question is, do you drop the last frame of the previous clip, or the first frame of the next clip? Either method will work, but if we are doing things differently, that would explain why the files are not 100% identical.
Oh, and a little feature request: Since most camcorder clips are in sequence, it would be nice if you could give file names in the input list file as a range. For example:
00788.m2ts - 00919.m2ts
That is my range for the 132 clips I first tried. Multiple ranges would be nice too, for example my other big trip would look like this:
00137.m2ts - 00260.m2ts
00375.m2ts - 00521.m2ts
That would certainly make things easier for us camcorder users.
Turtleggjp
13th September 2009, 01:55
Sorry I can't believe that. You're going to have to offer me a set of files that creates this claimed problem.
Just ran it again from scratch (freshly opened the Joints program) and now it is cutting. It looks like it was some sort of initialization problem, because when I was having trouble, I had already run the program once with the wrong audio PID, and then I just ran it again with the correct audio PID but without closing and re-opening the program first. So probably what happened was that the old cut list was still being used instead of the newly generated one.
Your file is still 4KB bigger than mine, but I think it might be a problem with my method. I noticed in my number of frames to cut column that there was a -3 value instead of the usual 0 or 1. Turns out, that particular clip was the one that DGAVCIndex Alpha 23 choked on (saw it as a 188-byte packet stream instead of 192), and I had to index it with a later version, which probably dropped some of the audio.
Anyway, it is looking very good so far! When I get a chance, I'll run it on that huge series of clips I mentioned earlier.
EDIT: Just fixed my glitch on the 132 clip series. I'm still 1KB (exactly 1024 bytes) smaller than you. Still investigating...
EDIT2: No big deal, you just have one extra audio frame at the end of your file. Turns out a 256kbps AC3 audio frame is exactly 1024 bytes.
Guest
13th September 2009, 04:45
It looks like it was some sort of initialization problem, because when I was having trouble, I had already run the program once with the wrong audio PID, and then I just ran it again with the correct audio PID but without closing and re-opening the program first. So probably what happened was that the old cut list was still being used instead of the newly generated one. Indeed. I need to reinitialize the cut list when the process button is hit. Thanks for pointing it out.
I have an extra frame at the end? Is it listed as a cut in your spreadsheet output? Can't cut it on a whim. :)
Turtleggjp
13th September 2009, 04:51
I have an extra frame at the end? Is it listed as a cut in your spreadsheet output? Can't cut it on a whim. :)
I'm not sure where the extra frame is coming from right now. As far as I can tell, our cut lists match up 100%. I'll look into whether or not my method is somehow dropping the last frame from the last clip. Should be easy to figure out.
Guest
13th September 2009, 04:54
OK, thanks. I'll add your range idea also.
Turtleggjp
13th September 2009, 05:05
OK, thanks. I'll add your range idea also.
Excellent.
BTW, I ran my big set of clips (271 clips, 15.6GB of data, 2 hours, 18 minutes, 51 seconds of video) and the results were the same as the last set, that extra frame (1024 bytes) is there at the end of your file. I'll look into this shortly...
EDIT: It looks like my method is dropping the last frame sometimes, while your program is not. I'm not sure why it is dropping the last frame because according to my spreadsheet it should not be. Probably just another bug in the original AC3 Cutter code. Anyway, it looks like the Joints program is correct.
EDIT2: I just looked into the other area where our files are different. When a frame gets dropped, the two files were different for the duration of one frame. I thought it was because I was dropping the last frame of the first file and Joints was dropping the first frame of the second file. Turns out, I was actually dropping the second to last frame of the first file and keeping the last frame. This is where the files did not match. The next frame was the first one of the next clip, and the two files once again match. Must be a problem with the way AC3 Cutter numbers the audio frames. So once again, Joints is correct. This is probably related to the problem of the last frame getting dropped with my method.
Efenstor
13th September 2009, 15:27
Yes, it works perfectly! Though I must use a filelist printing software (PrintFolders) to create the list of files, would be better to use multiple selection in GetOpenFileName. :) One thing also missing in the readme: the new line at the bottom of the list is compulsory. Saving the options in an INI also would help (my camcorder uses 1100 for audio). The rest is perfect.
Turtleggjp
13th September 2009, 18:03
Yes, it works perfectly! Though I must use a filelist printing software (PrintFolders) to create the list of files, would be better to use multiple selection in GetOpenFileName. :) One thing also missing in the readme: the new line at the bottom of the list is compulsory. Saving the options in an INI also would help (my camcorder uses 1100 for audio). The rest is perfect.
That's great news! I'm glad if it helps you so much. I'm sure all of your suggestions will be added to the program. Right now, he just wanted to get it out there and let those of us with camcorders start messing with it. Did you see my suggestion about input ranges? Neuron2 said he was going to add that, so that should make things a lot easier right there.
Guest
13th September 2009, 18:12
All suggestions will be implemented. Thank you both for your valuable ideas.
Turtleggjp
13th September 2009, 21:34
One more request. It would be beneficial to me at least if Joints could also output the number of video frames for each clip to a file. A simple list like this would work:
00137.m2ts 1125
00138.m2ts 645
00139.m2ts 675
...
This would help me because I will still want to use my spreadsheet to create chapter points in my videos, and I'll need the number of video frames for each clip for that. This could be an option in the GUI, since I doubt it would be of much use for Blu Rays. Thanks!
Guest
13th September 2009, 21:39
Can I also print the number of audio frames or will that get in the way for you? I'd just add the info to the cuts.txt file.
Give me a few days. I've just finished up the INI file support. Want to work on my quantum physics simulations for a while. (BTW, my paper demolishing Bell's Inequality was accepted by Physics Essays and will appear in December.)
Guest
13th September 2009, 21:52
Here's how the cuts.txt will be:
00066.mts [3780/3942]: 0,3941
00067.mts [1290/1346]: 3942,1346
00068.mts [810/845]: 5288,844
The numbers in brackets are the vid frame count / aud frame count. This is good because you can see where the frames were deleted by comparing the audio frame count to the audio block length.
Will that serve your needs?
Guest
13th September 2009, 23:31
Just dashed off a new version:
* Adds range support to the playlist file (read help file!)
* Outputs file name and frame counts in the cuts.txt file.
* Adds INI file support.
http://neuron2.net/misc/joints102.zip
I probably won't support any other file open method because the dir /B trick described in the help file is so easy, and because we have ranges now.
Guest
13th September 2009, 23:44
I jst added the source code to the 1.0.2 zip to satisfy GPL.
Guest
14th September 2009, 00:32
If my "normal way" of demuxing is to use eac3to, which not only demuxes but also re-joins (to make a single continuous audio track), then is its re-joining defective? I just tested eac3to on a set of the files at issue. It does NOT correct for this situation and its demuxed audio is binary identical to the uncorrected audio demuxed by DG tools.
If you have this problem you will certainly know about it.
Interestingly, on the web there is a lot of discussion about the sync issue with Ratatouille BD. Looks like we're the first guys to realize what the cause really is and how to fix it. Score another one for Doom9 forums!
laserfan
14th September 2009, 01:20
I just tested eac3to on a set of the files at issue. It does NOT correct for this situation and its demuxed audio is binary identical to the uncorrected audio demuxed by DG tools.
If you have this problem you will certainly know about it.
Interestingly, on the web there is a lot of discussion about the sync issue with Ratatouille BD. Looks like we're the first guys to realize what the cause really is and how to fix it. Score another one for Doom9 forums!I don't do a lot of BD backups/conversions and OTTOMH can remember only Enchanted had a lot of m2ts files in the set--seemed to convert OK tho. In any case thanks for following-up wrt eac3to! Can't begin to tell you how impressed I am w/you and Turtleggjp for your pursuit/quickness in devising yet another nifty tool! Congrats and
:thanks:
Turtleggjp
14th September 2009, 04:09
Here's how the cuts.txt will be:
00066.mts [3780/3942]: 0,3941
00067.mts [1290/1346]: 3942,1346
00068.mts [810/845]: 5288,844
The numbers in brackets are the vid frame count / aud frame count. This is good because you can see where the frames were deleted by comparing the audio frame count to the audio block length.
Will that serve your needs?
I don't need the audio frames for doing my chapters, but they don't hurt, and it would be nice to have them for completeness. I think the brackets and colon throw me off more. I like to import the file into Excel as a text file, and when I do it gives me options for separating things into columns. I can tell it to use spaces, commas, and the '/' to delimit the columns, but that still leaves me with "[3780" in one column and "3942]:" in the next column. While your method looks nicer, I think what would work best for me with Excel would be just this:
00066.mts 3780,3942 0,3941
00067.mts 1290,1346 3942,1346
00068.mts 810,845 5288,844
Since I've discovered that flaw in my processing of the audio, I'll be re-doing a lot of clips in the near future, so I'll be giving this tool a good workout. Thanks again!
Guest
14th September 2009, 04:24
I can't get excited about changing the log file format to allow for Excel's shortcomings. On the other hand, I don't want to leave you stranded. Decisions, decisions...
Guest
14th September 2009, 04:37
Re-download 1.0.2. I revised the log file format to make you happy.
Turtleggjp
14th September 2009, 05:51
Just finished running Joints 1.0.2 on my large set of clips, and with the aid of your new log file format, I was able to confirm that all your numbers matched mine! Very happy with this little tool. :thanks:
Just a few more suggestions, no real rush on these as far as I'm concerned. By all means, work on your real work first before trying to tackle these:
1. I think it would be helpful if your indexers could read in the same file that Joints does for the list of files. This way, we can use the same list for indexing (and demuxing) as well as repairing.
2. Blu Ray Playlist support. This would also be nice to have in the indexers as well. This could require a bit more effort to implement, but there might already be code out there to help.
3. This is more of a note to the users than a feature request. Most camcorders will split a clip into multiple pieces if the file size exceeds 2GB. Why? I don't know. I've seen Blu Ray files larger than 25GB, and the FAT32 file system used on the camcorder cards supports up to 4GB files. Anyway, this situation is less common because you usually have to shoot continuously for over 15 minutes to exceed 2GB on a camcorder. Still, it can come up while filming things like school concerts or plays. If you have clips like this they should NOT need special processing by Joints, and can simply be combined with a DOS copy command like this:
copy /b "00002.mts"+"00003.mts"+"00004.mts"+"00005.mts" "L:\Gala.m2ts"
That was the command I used to combine 4 clips together into one. I'm not 100% sure this will work with all camcorders, but it worked with mine. Therefore, I'd suggest that you combine clips like this prior to processing with Joints, and then use the resulting file with your other smaller clips in Joints if needed. @neuron2, if you are interested in adding support into Joints to check for this condition, I have some sample clips you can look at. They are 2GB in size, so maybe you would only need the first and last few MB or so of the file. Let me know if you are interested in this.
:thanks: again!
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.