Username:
B
I
U
S
"
url
img
#
code
sup
sub
font
size
color
smiley
embarassed
thumbsup
happy
Huh?
Angry
Roll Eyes
Undecided
Lips Sealed
Kiss
Cry
Grin
Wink
Tongue
Shocked
Cheesy
Smiley
Sad
<- 1234567 ->
--
--
List results:
Search options:
Use \ before commas in usernames
snow: anrix ended up using avidemux as its backend for that exact reason. i never found any other cross-platform way to append vobs without desync.
Moo! Flap! Hug!
Thanks Flip, that's enough segments for me to test on.

Quick question about audio commentary on SDA: am I safe to assume that the commentary is at least as long as the meaningful part of the video?  That is, if I truncate one of the middle MP4 files at the moment that the shortest audio track ends (most likely the audio commentary), am I safe to assume that such a truncation will not take out part of the video (except some of the SDA station ID at the end, which doesn't matter)?

Or, are there audio commentaries that stop before the video of actual gameplay stops?  (It seems like you wouldn't want that in an AC track, if there is game music / SFX in the background of the AC track...)
Visit my profile to see my runs!
Craaaap.  Thanks ballofsnow.  I've been watching all of my runs BEFORE appending them with avidemux.  Now that you pointed out the desync/loop thing, I had better wait for a real solution like Poxnor's program.
Yes, a cucco riding the ground.
Quote from Poxnor:
Quick question about audio commentary on SDA: am I safe to assume that the commentary is at least as long as the meaningful part of the video?  That is, if I truncate one of the middle MP4 files at the moment that the shortest audio track ends (most likely the audio commentary), am I safe to assume that such a truncation will not take out part of the video (except some of the SDA station ID at the end, which doesn't matter)?


You should probably use the longest of the three tracks (video, audio, commentary) as the length of a segment. In the files I tested my program on, the audio was shorter than the video, not longer.
Visit my profile to see my runs!
Quote from Garlyle:
It's going to sound absolutely crazy, but I tend to use speedruns to fall asleep - they block out all the rest of the noise of the apartment building in the middle of the afternoon, and the sound of videogames is just... really comforting to me! 


I have no idea how I missed this earlier.  I totally do this too.
the audio commentary is almost always the shortest track in my experience, sometimes substantially (if people don't record during the credits for example).
Quote from InsipidMuckyWater:
Craaaap.  Thanks ballofsnow.  I've been watching all of my runs BEFORE appending them with avidemux.  Now that you pointed out the desync/loop thing, I had better wait for a real solution like Poxnor's program.

Not trying to scare anyone away from using avidemux. It's possible that if the video/audio length mismatch is very small, like 50 ms, that you won't notice any looping.
Visit my profile to see my runs!
With Grappling Hook, by the end of the run the sound was off by ... well, I'm not sure by how much, but the sound was DEFINITELY not matching the video whatsoever.  Just those 20 segments or whatever resulted in a huge offset, so avidemux just isn't a solution for any run that has more than like five segments, which is the overwhelming majority. 

Glad you point this out before I converted any more of my collection.  Smiley
Edit history:
ballofsnow: 2011-04-30 12:31:00 pm
That's a shame. I thought it would append while keeping sync but with a (minor) drawback in the looping. Thanks for confirming.
Edit history:
Exo: 2011-04-30 01:11:47 pm
Exo: 2011-04-30 01:10:25 pm
Exo: 2011-04-30 01:09:23 pm
Exo: 2011-04-30 01:08:57 pm
Exo: 2011-04-30 01:08:30 pm
Sandbagging
Here is a workaround for it.
Unless somebody is gonna write a quick app for it it'd be a pain in the ass to do for small segmented runs ^^

Example :

Lets say we have an mp4 that has an audio track which cuts of 112 ms too early.
MP4Box's info output would look like this :

Code:
MP4Box -info test.mp4

* Movie Info *
Timescale 1000 - Duration 00:02:33.840
Fragmented File no - 2 track(s)
File Brand isom - version 512
Created: GMT Fri Jan 2 00:00:00 1970

File has no MPEG4 IOD/OD

Track # 1 Info - TrackID 1 - TimeScale 25025 - Duration 00:02:33.840
Media Info: Language "Undetermined" - Type "vide:avc1" - 3846 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 640 x 480 - Profile High @ Level 5.1
NAL Unit length bits: 32
Pixel Aspect Ratio 1:1 - Indicated track size 640 x 480
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 48000 - Duration 00:02:33.728
Media Info: Language "Undetermined" - Type "soun:mp4a" - 7206 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1


840ms -728ms = 112ms.  *gasp* !

For testing purposes i will just append the same file onto itself.
To get rid of the unfilled audio parts we need to give our current file a delay matching the non-existant audio.

Code:
MP4Box -add test.mp4#1 -add test.mp4#2:delay=112 cat.mp4

The above line of code adds 112 ms to the files track 2 which incidentally is the audio track and outputs the whole thing as cat.mp4.

After this we concatenate them :

Code:
MP4Box -add test.mp4 -cat cat.mp4 [...] -cat cat.mp4 output.mp4


This should get rid of any random crap happening but is also rather time-consuming unless someone is willing to write an app for the above mentioned proccess.

P.S.: Get to work Poxnor :s
I'm not sure how mkvmerge handles it, but one might as well try. The GUI can easily append pretty much any file types into a matroska container. I don't know if this is desirable, however.
Mayhap I can do some tests with mp4box, though. If all there is to it to iterate a set of files and parse mp4box's output, then that's trivial. I could make a solution for that.
Moo! Flap! Hug!
Quote from Manocheese:
You should probably use the longest of the three tracks (video, audio, commentary) as the length of a segment. In the files I tested my program on, the audio was shorter than the video, not longer.

No can do.

The approach my program uses is as follows.  For each segment except the last, it:
- Trims the segment to the length of the shortest track; then
- Adjusts the final video sample in the video track to create a smooth edge.
The final segment is untouched (so if there's no audio commentary during the credits, the credits won't be cut).

If that approach won't work, then the program fundamentally will not work.  If it will work, however, well...then...yay Smiley

Quote from Exo:
P.S.: Get to work Poxnor :s

Today is tax day, so I have no time to code.  But, I promise the code will be up by Sunday night -- plenty of time tomorrow to get it working with multiple audio tracks.  I figured out how to do that with a bit of playing around yesterday, and now I just have to write the code.

It links against mp4v2, is written in C, and works nicely in OS X / *NIX.  I'm not a Windows programmer, and I have no experience in Windows; but, if I post the code, I'm sure someone in this thread will know how to port it and post a Windows executable.

Cheers
--Poxnor
Edit history:
Exo: 2011-04-30 01:29:25 pm
Sandbagging
Trimming the segment to the length of the shortest track doesnt seem like a good solution.
Wouldn't you cut off a crapload of stuff from a video if the commentary only ranges from the start of the gameplay to the end of it ?

@Mystery : Yeh you'd only need to parse mp4box's info commands to calculate the delay to use. Using a source path would be essential though to catch all the filenames ^^
Edit history:
Mystery: 2011-04-30 01:32:09 pm
I'll give this a try ^^
Hmmm.
"Synchronized on stream 1"
Might we use this somehow? I don't think so quite yet, though.
Edit history:
Exo: 2011-04-30 01:33:51 pm
Sandbagging
Synchronized on stream 1 means that the videotrack (track 1) is as long as the main-container which is very obvious when you think about it ^^
Edit history:
Mystery: 2011-04-30 01:37:36 pm
Yeah, I figured as much. I was just thinking about what to do if the file has multiple tracks and if that information could help in some way.
You'll have to be the mp4box expert here ^^
Edit history:
Exo: 2011-04-30 01:41:59 pm
Exo: 2011-04-30 01:41:49 pm
Exo: 2011-04-30 01:39:27 pm
Sandbagging
It's useless since you need to parse the length of each track anyways to calculate the delays to use.
(You need to check every track's length against track1's length)

I could do an in-depth example if you want/need one.
You could write one if you want to. Although as of now, I'm just going to make it detect the delay with two tracks: one video and one audio.
Then let's scale it from there if it works.
Sandbagging
Sounds like a plan ^^
What do we do if the sound track is longer than the video track, though? Delay the video track?
Quote from Mystery:
What do we do if the sound track is longer than the video track, though? Delay the video track?

I would follow the behaviour of AviSynth's aligned splice, which will cut off the end of the audio to match the video.
Sandbagging
Don't think we're ever gonna deal with that case on any vid posted on sda though ^^
Edit history:
ballofsnow: 2011-04-30 02:09:41 pm
I attached the clips I used from my previous test with avidemux in case you need 'em. They are an extreme example, so if you can get them working then we're good.



Edit history:
Mystery: 2011-04-30 03:16:57 pm
Mystery: 2011-04-30 03:08:09 pm
Mystery: 2011-04-30 02:48:07 pm
OK, so one hurdle down. I managed to make the application find the difference between the length in the audio and video tracks in my test file.
The only annoying thing is that there seems to be some sort of race condition where if I run the application normally it won't capture mp4box's output. I have to put breakpoints to get it. I have to fix that.

EDIT: Alright. Bug squashed.
It's funny how a small loop condition can be the cause of such a large error -_-
Now going to make them properly append.

I still haven't figured out how to append with mp4box, though?
Edit history:
Exo: 2011-04-30 03:20:37 pm
Sandbagging
It's written in my example :

MP4Box -add file1.mp4 -cat file2.mp4 [...] -cat fileX.mp4 output.mp4