Log in

View Full Version : Jumping to a frame in MP4


mars2010
9th February 2011, 10:51
Hi,
I created xxx.mp4 with raw H.264.
The file created successfully and played well.

The only one problem is it's showing dirty pixel blocks or distortion of the image when I jump to a time position.

Someone guessed it's a problem about finding key frames, but doesn't know the solution.

I use MP4Box to create MP4 files
but I have no idea to create an MP4
showing clean image on jumping to a position.

Do I need to modify some option of MP4Box?
or is there any way to remove those dirty effect on
frame jump?

Thanks in advance for your help.

Blue_MiSfit
9th February 2011, 11:17
Are you playing the video in VLC by any chance?

mars2010
10th February 2011, 01:15
Hi,
I use KMPlayer and can see the distortion on frame jump.

I tried with VLC and didn't see any distortion.
But the problem is it takes one moment to jump to
another frame position.

For other movie files not created by me,
the frame position movement was very fast.
There was no distorted frame or suspension time.

So I think it's not a problem of player.
Perhaps something wrong in the MP4 container...

Do you have any idea?

Thanks.

nm
10th February 2011, 10:54
Hi,
I use KMPlayer and can see the distortion on frame jump.

I tried with VLC and didn't see any distortion.
But the problem is it takes one moment to jump to
another frame position.

If your video is encoded with large keyframe intervals, it will take some time to jump to an arbitrary frame position because all (non-B) frames between the previous keyframe and the chosen frame must be decoded. Your KMPlayer setup doesn't do this correctly and that's why the output is broken until next IDR frame is reached.

Both players should normally jump directly to known keyframe positions, so yes, maybe there's something wrong with your MP4 files. Try remuxing with some other MP4Box build.

mars2010
11th February 2011, 03:35
I tried with the newest version of MP4Box, rev 2485(December 2010),
but there was no better result.

Is there any possibility that the raw 264 file has a problem?

poisondeathray
11th February 2011, 03:44
yes it could be the video

do you get the same behaviour in other containers? e.g. try mkv with mkvtoolnix

what about other players besides vlc and kmplayer? e.g. try mpchc ?

mars2010
11th February 2011, 07:19
I created an MKV with mkvmerge GUI v4.5.0, downloaded from mkvtoolnix.
I put a .264 and .aac and muxed. There was no warning or error.

But the problem is the movie is totally not seekable; I should watch the movie from the beginning to the end.

nm
11th February 2011, 11:06
Strange. How did you create the .264 stream? Can you split a 50 MB clip from the beginning and upload to MediaFire?

mars2010
12th February 2011, 04:19
I uploaded .264 in my skydrive:
http://cid-5355d6c6ebf2200b.office.live.com/self.aspx/TI/480i.264

the .264 file created by other engineer using TI's processor and its library.

I have a doubt whether the .264 file has a problem or not.
I'll be very thankful if you could find some clue...

Thanks!

VFR maniac
12th February 2011, 05:25
I uploaded .264 in my skydrive:
http://cid-5355d6c6ebf2200b.office.live.com/self.aspx/TI/480i.264

the .264 file created by other engineer using TI's processor and its library.

I have a doubt whether the .264 file has a problem or not.
I'll be very thankful if you could find some clue...

Thanks!

It seems your .264 sample have only one IDR-frame, so MP4Box cannot generate many sync sample signatures.
I think the file is enocoded with GDR feature options such as open-gop and/or intra-refresh in x264 terms.
Random access of these features are implemented by Roll Recovery, however there are no demuxers and standalone muxers that support it AFAIK.
Treating non-IDR-frame as sync sample is out-of-spec in MP4.
So if you want to use these feature, you should mux it into other containers.

mars2010
14th February 2011, 09:42
Does it mean that I need to generate more than one IDR frame in the .264 file?

I thought I-Frames are used for seeking.

VFR maniac
14th February 2011, 13:51
I thought I-Frames are used for seeking.

In AVC case, that is false since AVC's delta-frames can refer to other frames jumping over non-IDR I-frames and decoders cannot decode and display them correctly immediately.
Of course, open-gop I-frames can be used for seeking, however these I-frames are not IDR.

About this, the following discussion might be useful.
http://sourceforge.net/projects/gpac/forums/forum/327349/topic/3784919

mars2010
15th February 2011, 09:30
what I understood is...

If I generate several IDR frames
there would be no problem in seeking in MP4 and MKV, right?

VFR maniac
15th February 2011, 09:41
Yes, you can seek any IDR-frames immediately in mp4 and mkv.

Though I don't know spec of MKV, IDR-frames are definitely seekable point.

mars2010
16th February 2011, 11:03
Now it's more clear for the IDR frame, thanks.

I am curious for one more thing.
Are the IDR frames related to A/V synchronization also?

The MP4 containing only one IDR frame is started in sync for a first few minutes,
but slightly out of sync during the play, and the gap is much grown at the end.

It would be nice if it's a totally different problem.

Thanks.