View Full Version : [mkv] different fps for different audio tracks, possible?
tormento
22nd June 2009, 10:18
I do own an international Matrix BD with a fps of 23.976 and an italian Matrix DVD with 25 fps. What I'd like to do is mux the BD video with italian AND english audio BUT they have different fps.
I have correctly converted the video part with a 23.976 fps. Now I'd like, if possible, tell Matroska to use 23.976 fps when playing the eng audio and 25.000 fps when playing italian audio.
Do you thing it is possible? If not, do you know other containers that could make it?
Thanks.
sneaker_ger
22nd June 2009, 18:06
No, it's not possible (http://forum.doom9.org/showthread.php?t=129730) and I know no container that does support that.
The "standard" solution to that problem would be to reencode the Italian track.
talen9
22nd June 2009, 19:47
Or, simpler but slightly more prone to errors during playtime, use the "stretch" stream capatibility of Matroska format/muxers, I think if you'll look for it in the forum you'll find more info about that :)
tormento
23rd June 2009, 14:10
It's a real pity. I think it should be simple enough to be implemented as a new feature for matroska..
The problem is that audio tracks cannot be stretched properly without resampling the audio. Resampling also requires reencoding, so that might be your best or only option. There is nothing a container can do about it effectively -- while it can adjust the timecodes so that the audio should match playback systems such as DirectSound or any other sound player usually disregard those timecodes and play audio at the sampling frequency it was recorded at.
tormento
2nd July 2009, 11:34
The problem is that audio tracks cannot be stretched properly without resampling the audio.
Yes but I'd like to change the fps of the video, not of the audio ;)
That is possible (use mkvmerge's --delay option or mmg's equivalent), but if you have two audio tracks that are synced to different FPS'ed video tracks then you won't have much luck syncing the one video track to both audio tracks simultaneously.
tormento
2nd July 2009, 11:56
That is possible (use mkvmerge's --delay option or mmg's equivalent)
There is no delay, only different fps.
I have seen that a lot of people mux the BD video with DVD audio to create a mixed BD9 that would not be available in their language. With only one language it is simple, you have only to change the video fps in the 2nd tab of your tool (format specific options).
It would be nice to join that property with the ones of the audio tracks (i.e. BD audio gives 23.976 video, DVD audio gives 25 fps video), giving us the possibility to have a single BD9 with 2 languages without resample audio.
I hope my english supports my idea.. :o
Again, you cannot sync one video track to two audio tracks that were originally synced to video tracks with different FPS. Technically impossible -- you have to resample/stretch one audio track with an audio processing tool.
tormento
2nd July 2009, 12:57
Well, you can create a mkv with original 23.976 fps and original 23.976 fps audio. You can also create a mkv with 23.976 video telling to use 25 fps instead and an alternative 25 fps audio. Why is not possible to create a unique mkv that changes the video fps according to the chosen audio?
That is a feature that the container does not support.
Death KnightŪ
26th July 2009, 20:46
As a MKV fix program Meteorite (http://divfixpp.sourceforge.net/project_meteorite) developer, AFAIK, MKV store Audio stream as its time codes, not by frame counts. So this is not problem for MKV, only merge DVD audio to BD mkv. Thats all...
Explanation : For Example output from my internal tool:
Cluster Number:1 Cluster Size: 116078 Timecode: 0
ptr:11 BlockGroup Size: 14344 Block Size: 14341 TrackNum: 1 Relative TimeCode: 0 Flags: 0x04: Xiph lacing: 7 frames
ptr:14358 BlockGroup Size: 815 Block Size: 812 TrackNum: 2 Relative TimeCode: 0 Flags: 0x00: no lacing
ptr:15176 BlockGroup Size: 52 Block Size: 46 TrackNum: 2 Relative TimeCode: 167 Flags: 0x00: no lacing ReferenceBlock: -167
ptr:15230 BlockGroup Size: 48 Block Size: 43 TrackNum: 2 Relative TimeCode: 83 Flags: 0x00: no lacing ReferenceBlock: 84
ptr:15280 BlockGroup Size: 48 Block Size: 43 TrackNum: 2 Relative TimeCode: 42 Flags: 0x00: no lacing ReferenceBlock: 41
ptr:15330 BlockGroup Size: 48 Block Size: 43 TrackNum: 2 Relative TimeCode: 125 Flags: 0x00: no lacing ReferenceBlock: -83
ptr:15380 BlockGroup Size: 14344 Block Size: 14341 TrackNum: 1 Relative TimeCode: 256 Flags: 0x04: Xiph lacing: 7 frames
ptr:29727 BlockGroup Size: 54 Block Size: 48 TrackNum: 2 Relative TimeCode: 334 Flags: 0x00: no lacing ReferenceBlock: -209
ptr:29783 BlockGroup Size: 48 Block Size: 43 TrackNum: 2 Relative TimeCode: 250 Flags: 0x00: no lacing ReferenceBlock: 84
ptr:29833 BlockGroup Size: 48 Block Size: 43 TrackNum: 2 Relative TimeCode: 209 Flags: 0x00: no lacing ReferenceBlock: 41
...
So, As you see, It's not important that if audio synced to 25 fps or 30... MKV tags frames time, not frame number.
And there is also Tracks part of MKV has default duration of audio frames as time. Not frame. For example assume that this movies audio (track 1) has 32000000 nanoseconds & synced 30 fps. Than we add second Audio tracks that synced to 25 fps, that second audio tracks default duration become 38400000 nanoseconds. Because this two track has same length... I think you got the point.
+Tracks
+TrackEntry
|-TrackNumber: 1
|-TrackUID: 2997561248
|-TrackType: 2
|-FlagEnabled: 1
|-FlagDefault: 1
|-FlagForced: 0
|-FlagLacing: 1
|-MinCache: 0
|-TrackTimecodeScale: 1
|-MaxBlockAdditionID: 0
|-CodecID: A_AC3
|-CodecDecodeAll: 1
|-DefaultDuration: 32000000
|-Language: und
+Audio
|-SamplingFrequency: 48000
|-Channels: 6
+TrackEntry
|-TrackNumber: 2
...
...
|-TrackTimecodeScale: 1
|-MaxBlockAdditionID: 0
|-CodecID: V_MPEG4/ISO/AVC
|-CodecDecodeAll: 1
|-CodecPrivate: 0164001FFFE100186764
|-DefaultDuration: 41708332
|-Language: eng
+Video
|-PixelWidth: 1280
|-PixelHeight: 720
|-FlagInterlaced: 0
|-DisplayWidth: 16
|-DisplayHeight: 9
Thats means MKV tags time codes, not frames. So your audio track perfectly matched whatever you convert movie to down sample or not. Because Audio track has same length.
Only problem that BD audio and DVD audio is not identical as sound/timebase... Like DVD AC1 parts has some minor gaps on file end and start. There is a 0.5 second gap become 5 second if you merge 10 DVD part together. So that could make BD and DVD audio tracks is not identical. I insist that is your real problem...
And if all goes wrong, you have weapon to use "TrackTimecodeScale".
MKV can scale audio/video track as you want.
Definition of TrackTimecodeScale:
The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs).
mosu and sneaker_ger told opposite but I think they don't aware this property of MKV. You can scale your audio track on the fly in MKV stream.
Best Regards.
Erdem
:devil: It's normal that lots of grammatical errors in this post. Sue who teach english to me :devil:
Mosu
26th July 2009, 21:01
I'm perfectly aware of TrackTimecodeScale. However, there are situations in which this parameter doesn't help you at all -- if the different audio tracks come from different sources and their video content is not identical. How can this happen? Well it is often the case that video discs from different regions have slightly differing content, either due to different mastering processes or due to intentional changes by the author.
There is also the case that some videos are played back at different FPS. For example, in Europe stuff is played at 25 FPS while the original is 23.397, and the audio tracks are re-sampled to match the faster playback. This results in some audio tracks being shorter than other ones and that is a situation that TrackTimecodeScale doesn't help with. That's what I was referring to when I said that "you cannot sync one video track to two audio tracks that were originally synced to video tracks with different FPS". Either the audio tracks and video tracks sync up properly or they don't. If they do you're in luck. If they don't and the audio track is just off by a constant amount then you're in luck, too, because those can be fixed easily. However, that's not always the case.
Death KnightŪ
26th July 2009, 23:31
To Mosu: Thing that I not want to accept that, syncing audio to FPS is not correct thing to told. You can't sync audio to frame rate but time.
Assuming as audio stuffs are identical. ( except situations that you told at top, like slightly different video content... )
Movie length is a constant, not variable. Video content dependent to FPS but Audio part is "independent" from movies FPS.
That means if you re-encode video to 30 fps to 15 fps, movie length will NOT became half because each frame shows twice time of original movie.
If movie x minute on original, than its exactly x minute on european or different FPS'ed version of that movie. ( Again if sources are identical )
Thus you can take audio stream from one media and put it another one. Thats all. Your AUDIO doesn't know if Videos frame rate is 25 or 30 or 15...
It's like using time codes for subtitle instead frame numbers.
As you well know, srt subtitles are conforms both 25 fps, 27 fps 30 fps version of video IF video is proper DVD RIP, independent from releaser or videos FPS because its tags TIME not FPS.
For example, in Europe stuff is played at 25 FPS while the original is 23.397, and the audio tracks are re-sampled to match the faster playback.
Nope! Audio Track doesn't play faster to match Videos fps. Because video is in same length as time( but frame count..) Audio track plays as it needed to be. in MKV, audio and Video tracks connects each other with "time", not frame number. I think this is the point we cant agree on. This is what I know about this problem. Wish being correct.
Salute from Istanbul,
Best regards.
Erdem
Milvus
27th July 2009, 00:00
Unfortunately you're wrong. What Mosu is taking about is PAL Speed-up. (http://en.wikipedia.org/wiki/PAL_speedup#576i_speed-up) Consequences :
- The exact same movie does not have the same lenght in NTSC and PAL land.
- SRT subtitles from a proper DVD-Rip could be not in sync, if used with a proper DVD-Rip from another country. (Of course, if you use your own DVDs as sources, you know the framerate of everything, and resyncing is easy with various softwares).
- Audio resampling must be done, properly or not (people with good ears the difference in pitch).
Death KnightŪ
27th July 2009, 15:26
Himm, good to learn that.
So, TrackTimecodeScale for rescue us in this situations... :)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.