Log in

View Full Version : x264 encode -> .mp4 output


simps
20th May 2009, 14:10
I just started encoding with x264, and I chose a .mp4 file as the output.

x264 showed this:
mp4 [info]: initial delay 2002 (scale 24000)

What does that mean? I will mux it with aac audio into a .mkv container. Will it be in sync? Or will I need to adjust some delay?

[]'s
Simps

Comatose
20th May 2009, 14:45
Try it.

Trahald
20th May 2009, 21:17
I just started encoding with x264, and I chose a .mp4 file as the output.

x264 showed this:
mp4 [info]: initial delay 2002 (scale 24000)

What does that mean? I will mux it with aac audio into a .mkv container. Will it be in sync? Or will I need to adjust some delay?

[]'s
Simps

Probably you are using b-frames and the delay is to make sure that pts is never < dts . 2002 is 2 frames in .mp4 land using 24000 as the scale and NUIT of 1001. this delay is normal and is accounted for

10L23r
21st May 2009, 05:43
so the audio doesn't need to be delayed when muxing?

b66pak
21st May 2009, 17:26
nope...
_

VFR maniac
21st May 2009, 18:10
If you mux it matroska container, probably no problem.
If you leave it as mp4, you might have to be delaying the audio.

At present, Gabest's (MPC) MP4 Splitter doesn't deny initial decoding delay, while Haali Media Splitter does.
So if you use Gabest's, you should delay the audio.
And if you use Haali's, you shouldn't do that.

roozhou
21st May 2009, 19:56
If you mux it matroska container, probably no problem.
If you leave it as mp4, you might have to be delaying the audio.

At present, Gabest's (MPC) MP4 Splitter doesn't deny initial decoding delay, while Haali Media Splitter does.
So if you use Gabest's, you should delay the audio.
And if you use Haali's, you shouldn't do that.

What about MPlayer?

VFR maniac
21st May 2009, 21:10
In my past experiments, MPlayer doesn't discard.
Here is the results.

[discard]
Haali Media Splitter (current)
Nero MP4 Splitter
MainConcept MP4 Demultiplexer
[not discard]
MPlayer
VLC media player
QuickTime Player
Gabest's MP4 Splitter
(in the future, Haali Media Splitter?)


Support for edts
[plus delay]
VLC media player
Nero MP4 Splitter
[minus delay]
MPlayer
Haali Media Splitter
[no support]
QuickTime Player
Gabest's MP4 Splitter
MainConcept MP4 Demultiplexer


The results is very complex.
In Japan, therefore, I and seraphy had designed DTS hacking, which reads DTS beforehand by the time of the second CTS.

Ritsuka
21st May 2009, 22:15
QuickTime for example shows the delay as it should, because the composition time is CT(n) = DT(n) +
CTTS(n) . (where DT is the decode time stored in stts atom and ctts the offset stored in the ctts atom)
So they use an edit lists to shift the video so the first presentation timestamp is 0.

But given the brokenness status of most of the current mp4 demuxers and muxers, I don't really know what you could do to make it right in every player.
Maybe someone with a better understanding of this problem will reply.