Log in

View Full Version : eac3to -slowdown (to fix non-standard frame rate)


simps
4th October 2010, 09:15
The video stream in my mkv file has a non-standard frame rate of 23.976000.
I know I can use eac3to source.mkv fixed.mkv -slowdown to change it to 24000/1001.

If I do that, will the video suffer any kind of quality degradation? And what about the audio/video sync? Will it remain perfectly synced?

tebasuna51
4th October 2010, 11:32
If I do that, will the video suffer any kind of quality degradation?
I think the quality remain the same.
And what about the audio/video sync? Will it remain perfectly synced?
Please put the eac3to info log.

If fps in mkv container is already 24000/1001, but the video stream show the non-standard frame rate of 23.976000, and audio/video play in sync, you don't need do nothing.

When you use something like:
eac3to input.mkv output.mkv -changeToXX.XXX
you can only change the container mkv fps (and you can lose audio/video sync).

If you want change the video stream fps, with eac3to, you need extract it, for instance:
eac3to input.mkv 1: output.h264 -changeToXX.XXX
and after replace the video stream in the mkv container.
This process don't change audio/video sync because fps in mkv container take preference over fps in video stream.

simps
4th October 2010, 14:49
eac3to v3.24
command line: eac3to c:\b\elite.mkv
------------------------------------------------------------------------------
MKV, 1 video track, 1 audio track, 5 subtitle tracks, 1:54:44, 24p /1.001
1: h264/AVC, 720x384 23.976p
2: AC3, Portuguese, 5.1 channels, 384kbps, 48kHz
3: Subtitle (ASS)
4: Subtitle (ASS), Danish
5: Subtitle (ASS), Finnish
6: Subtitle (ASS), Norwegian
7: Subtitle (ASS), Swedish
[v01] The video bitstream is encoded in a non-standard framerate. <WARNING>
[v01] The video track contains the (probably incorrect) "full range" flag. <WARNING>

simps
4th October 2010, 14:53
If you have a mkv container with 24000/1001 and a 23.976000fps video stream inside, then, eac3to source.mkv fixed.mkv -slowdown will change the fps in the video stream from 23.9760000 to 24000/1001, not only in the mkv container, but in the video stream itself.

tebasuna51
4th October 2010, 16:48
Don't work for me:
eac3to source.mkv fixed.mkv -slowdown
MKV, 1 video track, 2 audio tracks, 0:06:18, 24p /1.001
1: h264/AVC, Spanish, 720p23.975
2: AC3, Spanish, 5.1 channels, 640kbps, 48kHz
v01 The video bitstream is encoded in a non-standard framerate.
v01 The video bitstream framerate field doesn't match the container framerate.
Was asked to modify track 2: to 23.976, but the original FPS is not supported.
The same message using -changeTo23.976 instead -slowdown.

Only work with:
eac3to source.mkv 1: fixed.mkv -changeTo23.976
MKV, 1 video track, 2 audio tracks, 0:06:18, 24p /1.001
1: h264/AVC, Spanish, 720p23.975
2: AC3, Spanish, 5.1 channels, 640kbps, 48kHz
v01 The video bitstream is encoded in a non-standard framerate.
v01 The video bitstream framerate field doesn't match the container framerate.
v01 Extracting video track number 1...
v01 Writing new framerate "24fps /1.001" to bitstream.
v01 Muxing video to Matroska...
Added fps value (24 /1.001) to MKV header.
Done.
Also work:
eac3to source.mkv 1: fixed.h264 -changeTo23.976

But always you need remux with audio (and subs).

simps
4th October 2010, 19:22
The video in that MKV is encoded with 23.976/1.000fps. I consider that "non-standard". The correct framerate would be 24.000/1.001fps. That's why eac3to (correctly) posts a warning. You can fix the problem by using "eac3to 24.s01e01.mkv fixed.mkv -slowdown". That will patch the video bitstream from 23.976/1.000 to 24.000/1.001. I don't think you will notice a difference when watching, though. Would be just for "peace of mind".

This was posted by madshi, check his post here:
http://forum.doom9.org/showthread.php?p=1244511#post1244511

It should work for 23.9760000... I think you had 23.975 in your sample and I don't know if it works for that frame rate...
Try some 23.97600000, and see if eac3to source.mkv fixed.mkv -slowdown will change the video stream frame rate to 24000/1001.

tebasuna51
4th October 2010, 21:37
You are right.
eac3to source.mkv fixed.mkv -slowdown
MKV, 1 video track, 1 audio track, 0:00:28, 24p /1.001
1: h264/AVC, Spanish, 640x480 23.976p (4:3)
2: AC3, Spanish, 2.0 channels, 192kbps, 44.1kHz
v01 The video bitstream is encoded in a non-standard framerate.
v01 Extracting video track number 1...
a02 Extracting audio track number 2...
v01 Writing new framerate "24fps /1.001" to bitstream.
v01 Muxing video to Matroska...
a02 Creating file "fixed - 2 - AC3, Spanish, 2.0 channels, 192kbps, 44.1kHz.ac3"...
Added fps value (24 /1.001) to MKV header.
Done.
When video stream fps is exactly 23.976/1.000 this work and audio (and subs) streams are extracted without change.

Then you need remux all audios and subs with the new fixed.mkv

To close the thread:
1) The answers to your first post are:
- The video quality not change
- The audio/video sync remain the same

2) Is not necesary make the change. Like madshi say:
That will patch the video bitstream from 23.976/1.000 to 24.000/1.001. I don't think you will notice a difference when watching, though. Would be just for "peace of mind".

3) I recommend use instead:
eac3to source.mkv 1: fixed.mkv -changeTo23.976
- This work for any video stream fps (not only 23.976/1.000)
- You only need replace the video stream in source.mkv without the useless audio (and subs) extracted. If source.mkv have chapters the info remain with this method.

simps
5th October 2010, 07:28
Thanks tebasuna51. What I don't get, is this:

The difference between 24000/1001 and 23.976/1000 is 0.0000239 seconds or 0.0239ms.
x=24000/1001 = 23.9760239
y=23976/1000 = 23.9760000
x-y=0.0000239 seconds

In a 3 hour footage / movie, there will be 10800 seconds.
So 10800 x 0.0000239 = 0.25812 = 258ms

So by the end of the footage / movie, there will be a delay of 258ms and that is a HUGE delay, everyone can notice the audio/video sync issue.

I get confused when madshi says we won't see a difference between 23.976/1000 and 24000/1001. For sure there should be only ONE correct frame rate that will match the audio speed. I guess it has to do with the container frame rate? You said it has priority over the video bitstream frame rate? So it doesn't matter much if the video stream is pathed to 23.976, 24000/1001 or 25fps, you can set the correct frame rate on the mkv container, and that is it?

tebasuna51
5th October 2010, 08:58
...
I guess it has to do with the container frame rate? You said it has priority over the video bitstream frame rate? So it doesn't matter much if the video stream is pathed to 23.976, 24000/1001 or 25fps, you can set the correct frame rate on the mkv container, and that is it?
Exact.

Most the times the value in video streams is a bad rounded value put by some faulty software. If you put this value also in container is when you can have the audio/video async.

I see many samples with the absurd value 23.975 used in my first sample. To make the test with the exact value 23.976000 I need encode an AviSynth script with:
Assumefps(23.976)
instead use the correct values:
Assumefps(24000, 1001) or Assumefps("ntsc_film")

MeteorRain
13th October 2010, 17:43
Thanks tebasuna51. What I don't get, is this:

The difference between 24000/1001 and 23.976/1000 is 0.0000239 seconds or 0.0239ms.
x=24000/1001 = 23.9760239
y=23976/1000 = 23.9760000
x-y=0.0000239 seconds

In a 3 hour footage / movie, there will be 10800 seconds.
So 10800 x 0.0000239 = 0.25812 = 258ms

wrong unit.

fps1 - fps2 = 23.976023976 - 23.97 = 0.000023976 frame/second
for a 10800 seconds movie, you get a delay of
10800sec * 0.000023976f/sec = 0.23976 frames, which is 10.8ms

-= OR =-

(fps1 - fps2) / fps1 = 0.0001% delay, which is far less than you can notice

simps
13th October 2010, 18:39
wrong unit.

fps1 - fps2 = 23.976023976 - 23.97 = 0.000023976 frame/second
for a 10800 seconds movie, you get a delay of
10800sec * 0.000023976f/sec = 0.23976 frames, which is 10.8ms

-= OR =-

(fps1 - fps2) / fps1 = 0.0001% delay, which is far less than you can notice

You are right. Thanks for pointing the error. So the delay from 23.976 to 24000/1001 can't be easily noticed. 10ms is just to small, really.

tebasuna51
13th October 2010, 19:43
With my sample (23.975 and 2:41:42) the delay go to 414 ms at end of file if the video stream fps is used.

MeteorRain
15th October 2010, 08:48
With my sample (23.975 and 2:41:42) the delay go to 414 ms at end of file if the video stream fps is used.

in this case, just leave it away would be a good choice.

if you are rather a perfectionist and really want to correct it without re-encoding it, you would have to insert one frame per about 23260 frames. extract the video to mp4 and let mp4box to copy an IDR frame randomly every 23260 frames may solve the problem. but that would be really pain

tebasuna51
15th October 2010, 10:34
...
if you are rather a perfectionist and really want to correct it without re-encoding it, you would have to insert one frame per about 23260 frames.
Nope, please read my previous post (http://forum.doom9.org/showthread.php?p=1448388#post1448388).

The movie play ok, is just a bad fps value put in video stream.