News:

--

Main Menu

Articfacts and Stuttering Frames

Started by Maveriick, April 24, 2017, 06:09:25 AM

Previous topic - Next topic

Maveriick

I am still struggling with editing MKVs.  It seems like over half the time I clip some footage from an MKV I am left with artifacts, frames that don't change or stuttering frames.  It is always the video and not the audio.  I really hope this question doesn't get me in some sort of trouble because I do plan to continue to use avidemux, but are there alternatives that I can tryout to compare performance?  Free is not a requirement.  I am happy to pay for it.  Again, I just want to compare results.

I am trying each nightly build Windows 64 bit build running on Windows 7.

Jan Gruuthuse

Why would you get into trouble?

Clip? Is this cutting video in [Copy] mode for both video and audio output?
You do select the editing points with keyboard up/down arrow only? or
Don't use the keyboard left or right arrow key. or
New codecs don't use frames as in the old days (avidemux 2.5 branch)!

small YouTube demo: Fast Edit with Copy Mode

Maveriick

I though asking about alternatives to Avidemux might be taboo.

I do all my edits using the up/down arrows only.  I do exactly the same things as shown in the video link you posted.  I don't know if it makes any difference but the MKV files I am editing were created from BluRay discs.

Regardless of how I do it, I still end up with garbage in-between frames.

I am hoping someone could point me to alternatives to avidemux so that I can compare performance to avidemux.  Maybe my expectations are too high.

eumagga0x2a

Quote from: Maveriick on April 24, 2017, 04:16:06 PM
I though asking about alternatives to Avidemux might be taboo.

Of course not, but I'm not aware of anything else except of command-line ffmpeg.

QuoteI do all my edits using the up/down arrows only.  I do exactly the same things as shown in the video link you posted.  I don't know if it makes any difference but the MKV files I am editing were created from BluRay discs.

Regardless of how I do it, I still end up with garbage in-between frames.

Likely the old unsolved issue with misdetected I-frames (or fields misinterpreted as frames) in interlaced h.264 videos. You should pay attention to the frame type up/down arrows seek to. Does it really show "I" or maybe "P" or even "B"? What does MediaInfo report about the source MKV files?

Maveriick

#4
When I use the UP/DOWN buttons to jump from key frame to key frame the Frame Type always says "I-FRM (00)".

If I use the RIGHT/LEFT buttons, frames change randomly from B_FRM (00), P-FRM (00), and I-FRM (00).

What should I use?  Up until now I have always used the UP/DOWN buttons.

eumagga0x2a

Are the source videos interlaced or not?

Maveriick

Where do I find that info?  This is what properties says:


=====================================================
Video
=====================================================
Codec 4CC:      AVC1
Image Size:      1920 x 1080
Aspect Ratio:      1:1 (1:1)
Frame Rate:      28.571 fps
Total Duration:      01:58:41.166

=====================================================
Extra Video Properties
=====================================================
ExtraDataSize:      124
Extra data:      01 64 00 29 FF E1 00 35 67 64

=====================================================
Audio
=====================================================
Codec:         DTS
Channels:      6
Bitrate:      192000 Bps / 1536 kbps
Frequency:      48000 Hz
Total Duration:      01:58:41.157


Which frame type would I use for interlaced and which would I use for non-interlaced?

dosdan

#7

Maveriick

#8
Scan type is progressive.  Which frame type should I use when editing in Avidemux? Do I use 'P' frame types when editing?  When would I use 'I' or 'B'?

dosdan

#9
Quote from: Maveriick on April 24, 2017, 11:43:42 PM
Which frame type should I use when editing in Avidemux? Do I use 'P' frame types when editing?  When would I use 'I' or 'B'?

Cut on I-frames aka key-frames.  An I-frame doesn't compress well as it contains the full image info, hence the reason why there are less I-frames compared to the other types of frames. P & B frames only contain partial image info to encode changes.

Dan.

Maveriick

#10
I though the scan type had something to do with where to cut.  Interlaced or progressive.  Is this correct?  Do I use 'P' frames because my file's scan type is progressive?

So do I use the UP/DOWN buttons to find 'I' frames or the LEFT/RIGHT buttons to find 'I' frames?  How frequently should I find a key frame?  Every second or two?  Every half second?  Every few frames?

dosdan

#11
Quote from: Maveriick on April 25, 2017, 01:27:40 AM
I though the scan type had something to do with where to cut.  Interlaced or progressive.  Is this correct?  Do I use 'P' frames because my file's scan type is progressive?

The "P" in P-frame stands for "Predicted", not "Progressive".  P-frames encode the relative motion changes that have occurred in a forward direction between frames i.e temporal compression i.e compression across time i.e compression of the differences between frames.

B-frames ("B" for "Bi-directional") encode changes in both forwards and backwards directions. 

Only I-frames ("I" for "Intra") encode a full image, by spatially encoding the information inside that 1 frame. (Like the lossey compression used in a JPEG stills file.) Only I-frames have enough info to standalone. You can't represent the image at a P or B frame until you trace all the way back to the previous I-frame, and in the case of a B-frame, also either to the next P- or I-frame (I'm not sure which).  So with a IPPPPPIPPPPPIPPPPP frame sequence, which has an I-frame every six frames, if you wanted to cut at the 3rd P-frame from the start, the encoder would need the info from IPPP to form a complete image frame i.e. go back to the preceding I-frame and then apply the sequential changes to this key-frame as detailed in the 3 subsequent P-frames. The editing program would need to re-code the complete video stream, unless the editor supported "smart rendering", in which case it would only re-encode around this cut and copy the rest of the compressed video stream unchanged (assuming there were no other significant changes).

https://en.wikipedia.org/wiki/Intra-frame_coding
https://en.wikipedia.org/wiki/Inter_frame
https://en.wikipedia.org/wiki/Video_compression_picture_types


Quote from: Maveriick on April 25, 2017, 01:27:40 AM
So do I use the UP/DOWN buttons to find 'I' frames or the LEFT/RIGHT buttons to find 'I' frames?  How frequently should I find a key frame?  Every second or two?  Every half second?  Every few frames?

It depends on the AVC encoder. For example, 1080p50 50Mpbs AVC files (.MP4) from my camcorder have an I-frame usually every 24 frames.

When edited, resized to 720p50 and reecoded at approx. 6Mpbs with the Sony AVC codec in Sony Vegas Pro 12, they now have I-frames every 26 frames.

When I upload this file to YT and then d/l it using Youtube-dl, the 3Mbps 720p50 AVC version has an I-frame every 304 frames.


Dan.
   

Maveriick

OK.  That really helps.  Thank you.  As I learn more and more my laundry list of my ideal editing too continues to grow.  For example,

Smart Rendering
TureHD Sound
h265

Any ideas of where I can find such a tool?  True HD audio support is almost nonexistent.

Jan Gruuthuse

Quote from: Maveriick on April 25, 2017, 03:13:54 AM
>8 >8 Smart Rendering >8 >8
It used to give Smart copy, partial re-encoding of the video,  in Avidemux 2.5 branch, until version 2.5.4. I don't see this returning: due to big concept differences between Avidemux 2.5 <> 2.6 and upcoming 2.7
Quoteh265
h265 = HEVC / x265
You have for Video Output following choices, depending your hardware / OS
[HEVC (x265)]
[Nvidia HEVC]


p3trus

... just to make sure... when doing a full re-encode (both video & audio), ADM should be able to handle any cut point / frame type?
Ie When trying to cut on a [I B B P B B* P B B I ...] frame, ADM will decode I B B P B first, to get a full frame for B* and feed this as first frame to the encoder?