Just for info: cutting at non-I-frames stilly shaky with r8944

Started by fkuebler, October 03, 2013, 10:44:11 AM

Previous topic - Next topic

fkuebler

Some things appear to be still shaky, but I have no 100% reproducability. Mostly the picture is like this:

a) when I cut the leading part of an mp4 at a P frame before the first I frame, then the resulting file has no video at all, when played with VLC, and a greenish picture when played with QT player. I assumed, that there could be no video, because the P frame needs information from the preceding I frame. But why then the video doesn't start again at the next I frame?

b) but when I cut the leading part of an mp4 at a P frame after the first I frame, then the resulting often also has no video, like in a), at least mostly.

c) when cutting like in a) or b), sometimes the Avidemux generated mp4 has only come 10 kByte and cannnot be played at all (or is finished before something can be seen). This happened only once or two times for me.

Cutting the same mp4s at an I frame is still rock solid.

mean

Only reason i can see is that the original MP4 is not 100% compliant
normally mp4 stores the initialization data separately
whereas AVI and others repeat initialization headers at each I-frame

In the latter case, if you cut on non intra you dont have initialization header

fkuebler

For the case that you are interested, I provide you with same small samples. Both test files (https://dl.dropboxusercontent.com/u/90792628/Test1.mp4 and https://dl.dropboxusercontent.com/u/90792628/Test2.mp4) are very small and (hopefully) innocent mp4s generated by Handbrake with profile ATV3. For both files I did the following with Avidemux (my notion of 1st I frame is the beginning of the file, displayed by Avidemux as standing at 60ms):

a) cut the beginning at the 5th P frame ("5th" was just arbitrary), resulting in the files https://dl.dropboxusercontent.com/u/90792628/Test1-cut-at-5th-P.mp4 resp. https://dl.dropboxusercontent.com/u/90792628/Test2-cut-at-5th-P.mp4

==> I got the warning, pressed OK, and in both cases the resulting file is only 2 kByte and cannot be played.

b) cut the beginning at the 1st P frame after the second I frame, so after jumping once to the next I frame, and then jumping once to the next P frame. The resulting files are https://dl.dropboxusercontent.com/u/90792628/Test1-cut-at-1st-P-after-2nd-I.mp4 and https://dl.dropboxusercontent.com/u/90792628/Test2-cut-at-1st-P-after-2nd-I.mp4

==> In the first case, the resulting file is a full mp4, but does not display video, only audio. In the second case, the resulting file is only 5 kByte and unplayable.

c) only for https://dl.dropboxusercontent.com/u/90792628/Test2.mp4: cut the beginning at the 1st P frame after the third I frame, so after jumping twice to the next I frame, and then jumping once to the next P frame. The resulting file is https://dl.dropboxusercontent.com/u/90792628/Test2-cut-at-1st-P-after-3rd-I.mp4

==> The resulting file is also only 2 kByte and unplayable.

I hope this can help.

mean


fkuebler

Quote from: mean on October 07, 2013, 06:33:17 AM
Maybe better

Yes. With r8947 the samples can be cut, and in all cases, when playing, audio starts immediately, and the video starts from the first next I frame on, as I would expect as a layman.

Thanks.

fkuebler

#5
I got an mkv file, which played well, but had only one I frame. My Handbrake generated from this an mp4 file with apparently regular I frames: https://dl.dropboxusercontent.com/u/90792628/Serial%20Mom.mp4. This is a small tail-shortened version for your convenience.

When I cut this mp4 with r8947 at any of the early I frames (in my example at the 5th), then the resulting mp4 https://dl.dropboxusercontent.com/u/90792628/Serial%20Mom-cut-at-5th-I-frame.mp4 is played with VLC such, that audio starts immediately, but video doesn't also start at the beginning (i.e. at the cut point), but only app. 10 sesonds later at the next I frame.

For comparison I have left my test files from October 5 also uploaded, which you used for making r8947.

EDIT:
I should add, that after cutting a front part with r8947, the playback within Avidemux itself works correct, starting audio and video right from the cut point. It is only after saving the cut mp4V2 file, that with VLC the audio starts immediately, while video starts only with the next I frame (in this case 10 seconds later).

fkuebler

Something with 8947 appears to have gone completely wrong:

I could not cut any HB (nightly builds) generated mp4, at I frames, without getting the effects described in my previous post.

An mp4 cut at an I frame with 8947, saved, and then loaded again either into 8944 or into 8947 doesn't play at all, but stays at the beginning. I found this to be true for several samples.

I have gone back to 8944, and I suggest you take 8947 down.

fkuebler


fkuebler

I noticed the new 8973 and hoped, that I could cut a front part of my mp4 at an I frame. But doing so resulted in the same bug as described for 8947 with my (still uploaded) test files: from the I frame, where I did cut (i.e. start the resulting mp4) until the following I frame only audio can be heard when playing with VLC (2.09). Only from then on also video is displayed.

With 8944 the proper cutting at an I frame is possible, and therefore I am still using it. But as reported, 8944 does not do proper cutting with B and P frames.

A little pity...

mean


fkuebler

Quote from: mean on December 02, 2013, 02:41:49 PM
ah, i sort of forgot that topic

Good to hear, so there's still hope, apparently... ;-)

When is it worthwhile to look again at the download section?

mean

I'll update that topic
Please keep the sample files available

mean

ok, i can confirm the problem but strangely enough it is only with your sample as far as i can see

Looking into it

fkuebler

Quote from: mean on December 03, 2013, 06:56:02 AM
ok, i can confirm the problem but strangely enough it is only with your sample as far as i can see

I just took just some other mp4, and immediately got the same effect with 8973, when playing after the cut with VLC. I have shortened the sample, and you may try it as well: https://dl.dropboxusercontent.com/u/90792628/Maus.mp4

Some remarks/observations:
- this mp4 came from a different kind of source than the previous one, but common to the other samples is, that the final mp4s were all generated with Handbrake. But with the latest file I took the very latest nightly build of HB, so that we can exclude a temporary HB bug.
- When I mistakenly forgot to specify mp4v2 in Avidemux, but left it there as AVI but still named the file *.mp4, then the video part between the cut point and the first subsequent I frame ist not suppressed completely by VLC, but some greenish rubbish is displayed.

Good luck.

mean