Bug and comments on Smart Copy in Video Pro X

peter-duke schrieb am 15.03.2018 um 10:03 Uhr

I have Version 15.0.5.211 of Magix Video Pro X.

1. The bug.

If you render an AVCHD clip (50i or 50p) that has not been altered, using Smart Copy (default or Main Concept codec) then the end of the clip is truncated by one GOP. If you re-render the rendered clip then it is also truncated by a further GOP, and so on. If you have a series of unaltered clips on the timeline, all clips will be truncated by one GOP in the output.

This should be trivial to fix.

2. Comments.

These are some conclusions I have reached after some experimentation with Smart Copy, for those who may be interested.

I tested a 50i AVCHD clip from a Sony camera and a 50p clip from a Panasonic camera. The 50i camera creates a GOP length of 13 frames (26 fields), while the 50p camera creates a GOP length of 24 frames. According to VideoReDo, the first two frames are B frames followed by an IDR frame (a special I frame) in both cases. Then follow a series of B and P frames (not the same) to complete the GOP before an I frame and so on.

All clips that I looked at from both cameras had an integral number of GOPs (or GsOP for purists!) in each clip. When you press the button to stop recording, the camera keeps on going for a moment to complete the GOP to make it happy, which makes me unhappy, because I generally have to trim a bit off the end of each clip.

If you trim the start of a clip, it removes an integral number of GOPs plus two frames such that it is the largest chunk possible that does not remove wanted frames. On the other hand, when you trim the end, an integral number of GOPS is deleted, which may include up to one GOP of wanted frames.

Although the clips as recorded have an integral number of GOPs, if you trim the start, the output will have two frames less than an integral number of GOPs. The first frame will now be a normal I frame.

Kommentare

mindsong schrieb am 16.03.2018 um 08:33 Uhr

Thanks for that info. Knowing that this sort of oddity has occurred may save some of us some of our own debugging and head-scratching time.

Question: did you happen to establish if this effect occurs with both SW and/or HW accelerated export modes?

I've just found that some display monitor blackouts I've been seeing only occur with HW acceleration enabled during playback, and wonder how many other oddities I've been bumping into may be related.

Might be something to check. Thanks again for sharing your research. Seems like sloppy programming - hopefully easily fixed as you mentioned.

--mindsong

johnebaker schrieb am 20.03.2018 um 00:53 Uhr

@peter-duke

Hi

. . . . . According to VideoReDo, the first two frames are B frames followed by an IDR frame (a special I frame) in both cases. Then follow a series of B and P frames (not the same) to complete the GOP before an I frame and so on . . . .

There are 2 types of GOP, an Open GOP, which is what you are seeing, and a Closed GOP which always start and end with an IDR and I frame.

The differences between the 2 cameras GOP structures is due to the 50p clip having a full frame rate of 50 fps - by convention the p in 50p means full frames, whereas the 50i clip has a true framerate of 25fps (full frames), again by convention the i in 50i means fields per second - there are 2 fields per frame thus giving the true full frame rate of 25 fps.

Both GOPs are approx 1/2 sec long, the internal structure is different due to the amount of data to be stored - the 50p (50 full frames) GOP store should double the data of a 50i (25 full frames) GOP, however to achieve a reasonable file size for similar GOP lengths, more B and P frames are added in the GOP, thus results in a 50p file being slightly larger in size, but not double the size, compared to a 50i file.

. . . .If you trim the start of a clip, it removes an integral number of GOPs plus two frames such that it is the largest chunk possible that does not remove wanted frames. On the other hand, when you trim the end, an integral number of GOPS is deleted, which may include up to one GOP of wanted frames. . . .

This is not what happens, what I think you are seeing is the reorganisation of the GOP's on exporting again ie the effect of the re-rendering, to fit the export formats specified GOP structure, where a cut/trim occurs within a GOP.

To demonstrate of this try the following using VPX only:

  1. Start a new project and add 1 image to the timeline, 5 - 7 secs long is sufficient. Apply the Title, Timecode, Presets, Frame counter to the image, and export as AVCHD file - see note 1.

    This gives you a video file with the frame counter rendered into the video so it cannot be changed in the next steps - this is the source clip to be trimmed - note the start and end frame counter numbers.
     
  2. Start a new project and import the AVCHD file exported in 1. Zoom in to show the individual frames and delete the first 5 frames (the clips start will now be in the middle of a GOP) and export to a second AVCHD file.
     
  3. Repeat the step 2, however delete the last 5 frames of the clip and export to a third AVCHD file (the end will now be in the middle of a GOP).
     
  4. Start a new project and load the trimmed videos exported in steps 2 and 3.

    Step through the frames - you will see that the frame counter misses only the frames you deleted, not a whole GOP of frames.

    If a whole GOP was deleted the frame counter should start at frame 26*, for the clip trimmed at the start, or be 25* frames less than the total frame count of the original created in step 1. This also applies if you delete 5 frames in the middle of the image - the frame counter will jump only the missing 5 frames.

Notes

  1. The export preset used and the asterisked (*) numbers quoted are using the default settings for the AVCHD transport stream 1920x1080 25i preset export which gives a GOP length of 25.
     
  2. The preset is labelled as AVCHD transport stream 1920x1080 25i which is strictly not correct according to the conventional meaning of the i when referring to video, as given above.

    To follow convention it should be labelled as AVCHD transport stream 1920x1080 50i or AVCHD transport stream 1920x1080 interleaved 25fps, however it is generally taken that 25i refers to the 25 fps interleaved format.

John EB

Zuletzt geändert von johnebaker am 20.03.2018, 00:57, insgesamt 2-mal geändert.

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

peter-duke schrieb am 21.03.2018 um 01:37 Uhr

@mindsong

I have only tested software encoding. I am testing other software as well, and testing hardware encoding would double the work at least, and I am not interested in it at the moment.

@johnebaker

I am a bit confused at where GOPs technically start in my AVCHD video files because I read statements on the web like "The first picture of each coded video sequence is an IDR picture." However, VideoReDo and TMPGEnc MPEG Smart Renderer (TMSR) agree that the first two frames in both my 50i and 50p video files are B frames and then the third frame is an IDR frame. (This seems to be the only IDR frame in each video file.) TMSR highlights the first frame (not the IDR frame) and all subsequent I frames in red, presumably indicating the start of each GOP. If that is the case then the first GOP has two extra frames in it. My AVCHD files are presumably open GOP or there would be no need for an IDR frame at all.

So far as 50i and 25i are concerned, I agree that it is confusing. I think 50i may have become popular because marketing people like bigger numbers. I use 50i because most people seem to do so these days, but personally I would prefer 25i.

If I understand your demonstration, you are dealing with normal (dumb) rendered videos. If that is the case, your findings are just what I would expect. My post is about smart copied videos, which does no re-rendering whatsover. You can't smart copy video to which effects, such as frame numbers, have been applied.

Just for interest, I rendered a 50p AVCHD clip as generated by my camera in VPX. The original 24 frame GOP sequence (plus two B frames at the start) with only one IDR frame was converted to a 50 frame GOP sequence in which the first frame and all I frames were IDR.

 

 

johnebaker schrieb am 21.03.2018 um 14:19 Uhr

@peter-duke

Hi

. . . . I read statements on the web like "The first picture of each coded video sequence is an IDR picture." . . . .

Did the poster of this comment qualify which type of GOP they were referring to, if not they should have. They are referring to a Closed GOP which always starts with an IDR frame.

. . . . the first two frames in both my 50i and 50p video files are B frames and then the third frame is an IDR frame . . . .

That is the correct sequence for an Open GOP which I believe is what you have.

. . . . If I understand your demonstration, you are dealing with normal (dumb) rendered videos. If that is the case, your findings are just what I would expect. My post is about smart copied videos . . . . You can't smart copy video to which effects, such as frame numbers, have been applied . . .

If you re-read my previous post you will see that the test video I used was created from a clip with the frame numbers effect added to a clip and exported to AVCHD video thus the frame numbers were rendered into the exported video.

It was this exported video clip that was used testing, there being no need to apply frame numbers, as they had been previously rendered into the clip which was smart copied after cutting off the start or end.

The good news is I can replicate the issue you are having with incorrect removal of the required number of frames.

The bad(?) news is that I get different results to yours - my video clips are from a Sony Camera, AVCHD format 25fps (50i) with a GOP length of 13.

In the testing I have done with over a dozen clips with slow pans through to fast action changes, I get the following:

For a cut at the start or end - SmartCopy does not remove a full GOP + a few frames, it leaves between 2 - 7 frames before the cut, and removes up to 12 frames at then end of the clip.

The number of extra frames appears to be related to the speed of a pan or action crossing the screen.

From my testing, my conclusion is that, while SmartCopy does work, the results you get will depend greatly on the GOP size and nature of the clips content eg speed of action in the clip.

SmartCopy appears to be going to the first/last available I frame before the cut to copy from/to. The number of frames varying appears to match the speed of fast pans or action crossing the screen, the faster the action the lower then number of extra frames at the start and lost at the end.

. . . . personally I would prefer 25i . . . .

By convention this would give a framerate of 12.5 fps, the eyes vision persistence is too short, and this would be seen as annoying flicker when being viewed.

HTH

John EB

 

 

 

 

Zuletzt geändert von johnebaker am 21.03.2018, 15:18, insgesamt 2-mal geändert.

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

Scenestealer schrieb am 21.03.2018 um 23:16 Uhr

Hi

Some good work has gone in here.

My findings from testing Panasonic 50P clip which I have Intel software rendered with the frame counter effect burned in from 1 to 553 frames. This gives a 50frame GOP using the AVCHD Transport stream 50fps preset.

  1. SW render 552fr
  2. SmartCopy render of SW rendered clip 550fr - this tends to support Peter-Dukes finding of the 2 extra B frames at the start being cut off.
  3. SC of SW render with 20 frames cut from start 550fr - obviously going back to the first I frame.
  4. SC of SW render with 20 frames cut from start and finish - 530fr - has included all of first GOP and cut all of last GOP as Peter D predicted.

John, it is interesting that you think the frame action content has some effect as I wondered that it might affect the outcome of your earlier test where you used a still image where there would be no change in the frame content between the I frames....

Peter D

which makes me unhappy, because I generally have to trim a bit off the end of each clip.

Do you realise that you can make a setting in Program settings where you can automatically trim a selectable number of frames off the start or finish on import. I always cut 20frames off the end of my 50p clips on import to get rid of the wobble as you hit the stop button and lower the camera at the end of recording.

I have so far been unable to get a Smart Render to work with either the MC or default Intel codec with a message coming up in the post render information box saying smart render has occured but with some errors, despite the SR/SC box showing the correct information about which bits will be SR and which will be Rendered. The out put file is saved with only a few hundred Kbytes of data.

Peter

System Specs: Intel 6th Gen i7 6700K 4Ghz O.C.4.6GHz, Asus Z170 Pro Gaming MoBo, 16GB DDR4 2133Mhz RAM, Samsung 850 EVO 512GB SSD system disc WD Black 4TB HDD Video Storage, Nvidia GTX1060 OC 6GB, Win10 Pro 2004, MEP2016, 2022 (V21.0.1.92) Premium and prior, VPX7, VPX12 (V18.0.1.85). Microsoft Surface Pro3 i5 4300U 1.9GHz Max 2.6Ghz, HDGraphics 4400, 4GB Ram 128GB SSD + 64GB Strontium Micro SD card, Win 10Pro 2004, MEP2015 Premium.

peter-duke schrieb am 22.03.2018 um 08:57 Uhr

@johnebaker

"If you re-read my previous post you will see that the test video I used was created from a clip with the frame numbers effect added to a clip and exported to AVCHD video thus the frame numbers were rendered into the exported video."

My objection is that I am trying to smart copy AVCHD as it comes from my camera. By dumb rendering a clip to insert the frame numbers, it changes the GOP structure, and any conclusions may not be valid.

"The good news is I can replicate the issue you are having with incorrect removal of the required number of frames.

The bad(?) news is that I get different results to yours - my video clips are from a Sony Camera, AVCHD format 25fps (50i) with a GOP length of 13.

In the testing I have done with over a dozen clips with slow pans through to fast action changes, I get the following:

For a cut at the start or end - SmartCopy does not remove a full GOP + a few frames, it leaves between 2 - 7 frames before the cut, and removes up to 12 frames at then end of the clip.

The number of extra frames appears to be related to the speed of a pan or action crossing the screen."

My old camera was also a Sony 50i camera, so the difference is strange.

I get consistent results with a handheld static shot and a shot from the side of a moving vehicle. It is also independent of the codec used (default or Mani Concept), and is also consistent with the Panasonic 50p camera, if you allow for the different GOP lengths.

When I said that I would prefer 25i I meant as shorthand for 25 frames per second interlaced. Both 25i and 50i are used, but 50i seems to be the term most people use these days.

peter-duke schrieb am 22.03.2018 um 09:06 Uhr

@Scenestealer

Thanks for the tip about auto trimming. I must look into it.

Your conclusion that VPX does not seem to smart render when it says that it will is interesting, as it confirms my findings in another thread. Perhaps you could re-post your findings in that thread where it is more relevant.

I am still hopeful that somebody will chime in with the right incantations, hand waving and mouse clickings to bring it about.

johnebaker schrieb am 22.03.2018 um 10:15 Uhr

@peter-duke, @Scenestealer

One thing I did find and forgot 😳 to mention in my previous post, if you are using proxy files and get an error message

An error occurred during MPEG export with Smart rendering The source material may not be editable . . . .

if you have the Smartrender info dialog set to be shown after export the error reason is given as

'Open Dp45SmartCopy failed'

then you must restore the original audio on the clip(s) for SmartCopy to work - right click the video clip, Audio functions, Restore original sound

Have also found a new this morning - there is also an additional error message which occurs with a previously rendered video clip, ie exported from VPX then re-imported into VPX:

'AddDP45SmartCopySegemnet failed'

Have not found a how to fix this one yet.

John EB

Zuletzt geändert von johnebaker am 22.03.2018, 10:24, insgesamt 2-mal geändert.

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

Scenestealer schrieb am 22.03.2018 um 10:56 Uhr

Jeepers, creepers......so many messages and what do they all mean!

Then there is the one about Dolby digital needing to be rendered, and I have often wondered how it deals with the fact that it down mixes 5.1 to Stereo on import, so how does it cope with that when Smart Rendering / copying?

Also at times the Smart render info box says nothing is going to SR/SC then at the end it says it has, even though it appears to take as long as a software render.

I think I will give up on this as I never need it anyway as most of my clips are adjusted in some way and Hardware rendering is swift enough.

Peter

System Specs: Intel 6th Gen i7 6700K 4Ghz O.C.4.6GHz, Asus Z170 Pro Gaming MoBo, 16GB DDR4 2133Mhz RAM, Samsung 850 EVO 512GB SSD system disc WD Black 4TB HDD Video Storage, Nvidia GTX1060 OC 6GB, Win10 Pro 2004, MEP2016, 2022 (V21.0.1.92) Premium and prior, VPX7, VPX12 (V18.0.1.85). Microsoft Surface Pro3 i5 4300U 1.9GHz Max 2.6Ghz, HDGraphics 4400, 4GB Ram 128GB SSD + 64GB Strontium Micro SD card, Win 10Pro 2004, MEP2015 Premium.

johnebaker schrieb am 22.03.2018 um 11:48 Uhr

Hi Peter

. . . . at times the Smart render info box says nothing is going to SR/SC then at the end it says it has, even though it appears to take as long as a software render. . . . .

The only time I see this is when I open the Smart render info box before actually starting the render/sc/sr, the dialog then appears showing what is actually going to occur.

. . . . I never need it anyway as most of my clips are adjusted in some way and Hardware rendering is swift enough. . . . .

Same here.

John EB

Zuletzt geändert von johnebaker am 22.03.2018, 11:50, insgesamt 1-mal geändert.

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.