Author Topic: "Dead" keyframes in mp4 cut  (Read 7432 times)

harrym

  • Newbie
  • *
  • Posts: 36
"Dead" keyframes in mp4 cut
« on: April 10, 2016, 11:22:02 AM »
I am using Avidemux for postprocesing cuts at ffmpeg mp4 videos. But i have problem, that some keyframes are unusable for cutting. If I cut video at this dead keyframe, video is freezing (audio is going on) at least to the first usable(?) keyframe. it is very irreteable. I must forcely recut the video on another keyframe. :'(

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6060
Re: "Dead" keyframes in mp4 cut
« Reply #1 on: April 10, 2016, 12:38:53 PM »
You're saying plenty and not providing info at all?
Provide (upload)  a small sample of video, give time index of this dead key frame. (10 seconds video duration would probably do)
- used avidemux? version, 32 or 64 bit, if nightly: revision (ryymmdd)?
- what should we understand with "ffmpeg mp4 videos"?
- ...

ps:- Use a free dropbox account, mega or similar webservice (free public access, without registration to download your uploaded video) thank you.[/quote]

AQUAR

  • Hero Member
  • *****
  • Posts: 1077
Re: "Dead" keyframes in mp4 cut
« Reply #2 on: April 11, 2016, 12:05:50 PM »
Are you putting h.264 in MP4?

In H.264, the frame can be segmented into sequences of macroblocks called slices.
These slice sequences can be independently processed (multi threading!).

I wonder if these I/Idr frames are actually B frames with an Intra slice?
 
« Last Edit: April 11, 2016, 12:13:30 PM by AQUAR »

fish

  • Full Member
  • ***
  • Posts: 114
Re: "Dead" keyframes in mp4 cut
« Reply #3 on: April 12, 2016, 03:27:40 AM »
I also have encountered a problem which may be related. When cutting mp4 in copy mode to I frames, the video between the first I frame and second I frame appears as black video. It doesn't happen with every video (I may just have been lucky in selecting the position of a first cut) but it does happen repeatedly, if the same cut is repeated at the same place. If a different I frame is chosen, for the first cut, in the same video, the black frames may or may not be present. If I move the edit forward to the next I frame (were the video starts after the black frames) and make the first cut, no black frames occur.
The same thing often occurs when editing DVB-T in MKV mode.
v2.6.12 64bit is the first version this has occurred in my case, I didn't try v2.6.11.
The same edits using Machete are fine. I have tried playing the edited video in various players and the black video is present in all the players.
« Last Edit: April 12, 2016, 03:46:43 AM by fish »

jcgeny

  • Newbie
  • *
  • Posts: 19
Re: "Dead" keyframes in mp4 cut
« Reply #4 on: April 12, 2016, 06:32:20 AM »
you have to cut first between I frames to create a smaller file , may be something of 5 mns from a 60 minutes one .
then you reuse this part and select the frames you want , then you recompile the video and you will be able to append it to others files you made like that : the files being recompiled again to create a movie .
beware of the audio ac3 codec . i have good result to recompile it in aac and some bugs with the ac3 .
the best is to compile in aac and at end to create an ac3 if you have some hardware decoding it , like a creative labs card

fish

  • Full Member
  • ***
  • Posts: 114
Re: "Dead" keyframes in mp4 cut
« Reply #5 on: April 12, 2016, 07:34:17 AM »
I have been doing something similar. Because I have Machete (I don't like using it because it is unresponsive) If my first cut gives the black frames, I simply move to the next I frame and start there. I then cut the short start section with Machete and append on to the main file with Avidemux.
Strange thing is, the problem only seems to happen on the first cut and not every I frame but I think, alternate I frames, depending on which is chosen as the first cut. Every other cut in the file is fine.
It is interesting that you seem to suspect the audio may be causing a problem, I have be using copy for audio as I usually do. I will try re encoding the audio to see if that has an effect.

fish

  • Full Member
  • ***
  • Posts: 114
Re: "Dead" keyframes in mp4 cut
« Reply #6 on: April 25, 2016, 05:14:34 PM »
I have gone back to v2.6.10, the last version I've used and the problem is gone.

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10967
Re: "Dead" keyframes in mp4 cut
« Reply #7 on: April 26, 2016, 05:29:20 AM »
If you had a reproducible test case, that would help
(including files)

fish

  • Full Member
  • ***
  • Posts: 114
Re: "Dead" keyframes in mp4 cut
« Reply #8 on: April 29, 2016, 01:21:00 PM »
The files are nothing unusual, just some mp4 files and DVB-T HD files of the type I have been editing in copy mode for quite a few years. I have just started noticing the problem after installing v2.6.12. I didn't try v2.6.11. It may well be at my end if no one else is seeing the problem.
Thanks for the great work on this software by the way, I have got a lot of use out of it over the years.

fish

  • Full Member
  • ***
  • Posts: 114
Re: "Dead" keyframes in mp4 cut
« Reply #9 on: June 13, 2016, 03:22:14 PM »
After a few weeks using v2.6.10, I decided to give v2.6.12 another try. When I un installed v2.6.10 I noticed that the v2.6.10 files were still in the Avidemux folder so I deleted them before installing v2.612. After about 2 weeks there has been no problem with black frames at the start of edited video files.

EDIT. False alarm, I am still seeing the black frames issue at the start of some edits.
« Last Edit: July 27, 2016, 01:59:08 PM by fish »

harrym

  • Newbie
  • *
  • Posts: 36
Re: "Dead" keyframes in mp4 cut
« Reply #10 on: July 23, 2016, 08:41:03 AM »
Is this problem solved? It is very frustrating... :(

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10967
Re: "Dead" keyframes in mp4 cut
« Reply #11 on: July 23, 2016, 08:57:13 AM »
Did you provide a test case ?

harrym

  • Newbie
  • *
  • Posts: 36
Re: "Dead" keyframes in mp4 cut
« Reply #12 on: July 30, 2016, 09:25:31 AM »
Did you provide a test case ?

http://files.uloziste.com/2d3920436f039e9b/test.mp4

00:01:02.920 - good I-frame
00:01:03.960 - dead I-frame
00:01:11.400 - dead I-frame


The test case was created on Windows 10 64bit by-
ffmpeg.exe -i "%%a" -vf "scale=0:400" -sws_flags lanczos -c:v libx264 -aspect "16:9" -preset slower -crf 23 -c:a aac -b:a 64k -ss "01:00" "%%~na.mp4"

ffmpeg version N-81118-gfb91850 gcc 5.4.0 zeranoe.com

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10967
Re: "Dead" keyframes in mp4 cut
« Reply #13 on: July 30, 2016, 07:50:33 PM »
does not seem to be easy to reproduce, might have been fixed
Can you try with a nightly ?
(http://www.avidemux.org/nightly)

harrym

  • Newbie
  • *
  • Posts: 36
Re: "Dead" keyframes in mp4 cut
« Reply #14 on: July 31, 2016, 10:26:01 AM »
does not seem to be easy to reproduce, might have been fixed
Can you try with a nightly ?
(http://www.avidemux.org/nightly)

It seems that the problem is solved