Reecoding compliant mpeg2 files in VS11.5+
Moderator: Ken Berry
Reecoding compliant mpeg2 files in VS11.5+
I have a 45min HDV project that includes a 30min HDV mpeg2 file converted from an HDV m2t file both at 25Kbs data rate, an SD mpeg2 file, some 2M pixel stills, various transitions, titles, and audio. My project settings are set similar to my 30min HDV file. Now, if I render to a file with the same project settings (share->create file->same as project), I would expect that at least 30min of the video would not have to be reencoded. But when I look at the optimizer, the 30min HDV file is always reencoded resulting in some artifacts being generated even at 25Kbs data rate. I realize that adding background music to my video requires some reencoding but I would expect only the audio stream to be reencoded. Is there a way that I can avoid reencoding my compliant video and thus maintain the quality of the original source video?
- Ken Berry
- Site Admin
- Posts: 22481
- Joined: Fri Dec 10, 2004 9:36 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Gigabyte B550M DS3H AC
- processor: AMD Ryzen 9 5900X
- ram: 32 GB DDR4
- Video Card: AMD RX 6600 XT
- Hard_Drive_Capacity: 1 TB SSD + 2 TB HDD
- Monitor/Display Make & Model: Kogan 32" 4K 3840 x 2160
- Corel programs: VS2022; PSP2023; DRAW2021; Painter 2022
- Location: Levin, New Zealand
I am presuming that you are wanting to produce a new HDV file from your project, and not an SD mpeg-2...
However, if so, then I am curious as to how you got project properties which are 'similar' to the HDV properties. I have never found a way. You cannot go into File > Project Properties and simply change/edit the default properties as those are fixed at SD settings. Not can you get 'Show message when inserting first video clip' to work with HDV (or AVCHD). Nor can you use Make Movie Template Manager in the straightforward way to produce a different template (though it is possible with a bit of fiddling). And in any case, that template only is usable in a later stage and not at the stage you are talking about as far as I can see. These are in fact all shortcomings which some of us here have been complaining about since VS11. So if you have found a way to do it, I would be very interested indeed.
Second, you say the project properties are 'similar' to the original HDV. Do you mean they are exactly the same, or that they differ in some way? If the latter, then any difference will mean that the original will be fully re-encoded to match the 'similar' but different properties.
And if, in fact, you are using the default Project Properties, which as I say are SD, then the default is usually Lower Field First (at least on my installation, it is), while HDV, as you will be aware, is Upper Field First. And re-encoding, using the wrong field order, will usually produce the sort of artifacts you describe. (In that regard, is the SD mpeg-2 in your project UFF, as it should be?)
However, if so, then I am curious as to how you got project properties which are 'similar' to the HDV properties. I have never found a way. You cannot go into File > Project Properties and simply change/edit the default properties as those are fixed at SD settings. Not can you get 'Show message when inserting first video clip' to work with HDV (or AVCHD). Nor can you use Make Movie Template Manager in the straightforward way to produce a different template (though it is possible with a bit of fiddling). And in any case, that template only is usable in a later stage and not at the stage you are talking about as far as I can see. These are in fact all shortcomings which some of us here have been complaining about since VS11. So if you have found a way to do it, I would be very interested indeed.
Second, you say the project properties are 'similar' to the original HDV. Do you mean they are exactly the same, or that they differ in some way? If the latter, then any difference will mean that the original will be fully re-encoded to match the 'similar' but different properties.
And if, in fact, you are using the default Project Properties, which as I say are SD, then the default is usually Lower Field First (at least on my installation, it is), while HDV, as you will be aware, is Upper Field First. And re-encoding, using the wrong field order, will usually produce the sort of artifacts you describe. (In that regard, is the SD mpeg-2 in your project UFF, as it should be?)
Ken Berry
Ken Berry wrote:I am presuming that you are wanting to produce a new HDV file from your project, and not an SD mpeg-2...
However, if so, then I am curious as to how you got project properties which are 'similar' to the HDV properties. I have never found a way. You cannot go into File > Project Properties and simply change/edit the default properties as those are fixed at SD settings.
I had no problem editing the project properties to match my HDV mpeg2 file. Here are a couple screen prints of the dialog box with my HDV project property settings:
http://viewmorepics.myspace.com/index.c ... &albumId=0
Here are my HDV mpeg2 file properties that I tried to match ( obtained with "mediainfo.exe" ) :
General #0
Complete name : D:\My Videos\HD_Videos\StLucia071201\StLucia071201.mpg
Format : MPEG-2 Program
Format/Family : MPEG-2
File size : 8.23 GiB
PlayTime : 46mn 57s
Bit rate : 25.1 Mbps
Video #0
Codec : MPEG-2 Video
Codec/Family : MPEG-V
Codec profile : Main@High-1440
Codec settings, Matrix : Standard
PlayTime : 46mn 57s
Bit rate mode : CBR
Bit rate : 23.0 Mbps
Nominal bit rate : 8000 Kbps
Width : 1440 pixels
Height : 1080 pixels
Display Aspect ratio : 16/9
Frame rate : 29.970 fps
Chroma : 4:2:0
Interlacement : Top Field First
Bits/(Pixel*Frame) : 0.172
Audio #0
Codec : MPEG-1 Audio layer 2
PlayTime : 46mn 57s
Bit rate mode : CBR
Bit rate : 384 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Resolution : 16 bits
Video0 delay : 5ms
As you can see, there are 3 bit rates: General #0 = 25.1Mbps, Video #0 = 23 Mbps, and Video #0 Nominal = 8000 Kbps. I tried to match General #0 but maybe I should have matched Video #0. In any case, no matter what I set my project properties video data rate to be, the optimizer always showed that my HDV mpeg2 file was going to be reencoded.
- Ken Berry
- Site Admin
- Posts: 22481
- Joined: Fri Dec 10, 2004 9:36 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Gigabyte B550M DS3H AC
- processor: AMD Ryzen 9 5900X
- ram: 32 GB DDR4
- Video Card: AMD RX 6600 XT
- Hard_Drive_Capacity: 1 TB SSD + 2 TB HDD
- Monitor/Display Make & Model: Kogan 32" 4K 3840 x 2160
- Corel programs: VS2022; PSP2023; DRAW2021; Painter 2022
- Location: Levin, New Zealand
Part of your problem could be associated with the fact that you converted the HDV from the original transport stream .m2t format. Why - or possibly more importantly how - did you do that?
As far as I was aware, the .m2t is CBR at 25 Mbps. But you appear to have converted to mpeg-2 using a VBR. I don't really know anything about MediaInfo, but have now installed it and tested it on one of my original TS HDV clips from my Canon HV20. It definitely shows the bitrate as being CBR by indicating it is 25 Mbps throughout.
The properties your read-out gives suggests a variable bitrate, with 25.1 Mbps being (probably) the maximum, and 23 Mbps being (probably) the average. I have no idea what the 'nominal' bitrate is apart from (possibly) being the usual maximum bitrate used by the SD mpeg-2 family. If it were the minimum bitrate, then the average bitrate would be much lower -- at around 16.5 Mbps.
Anyway, since you do appear to be using a VBR, the project properties you use are only similar, not the same as you would get if you rendered 'Same as first clip' instead of Same as Project Properties. If your first clip were indeed one of your HDV mpeg-2 clips, then the HDV segment of your project should be SmartRendered.
As it is, I use HDV in its original TS format with no problems and re-render my projects in that format. I have both used SmartRender and not used it. And with the latter, given that it is only the first render, and using exactly the same properties, I cannot detect any artifacts at all, and the quality seems unchanged -- at least to my naked eye, and I tend to be a bit of a perfectionist about these things.
Since you, on the other hand, have already re-rendered once (from TS .m2t to HDV mpeg-2 and in doing so apparently changed from CBR to VBR, you would already have changed the quality level downwards. So the second full render is thus leading to perceptible fall-off in quality.
Do you still have your original TS .m2t which you could use and edit instead?
As far as I was aware, the .m2t is CBR at 25 Mbps. But you appear to have converted to mpeg-2 using a VBR. I don't really know anything about MediaInfo, but have now installed it and tested it on one of my original TS HDV clips from my Canon HV20. It definitely shows the bitrate as being CBR by indicating it is 25 Mbps throughout.
The properties your read-out gives suggests a variable bitrate, with 25.1 Mbps being (probably) the maximum, and 23 Mbps being (probably) the average. I have no idea what the 'nominal' bitrate is apart from (possibly) being the usual maximum bitrate used by the SD mpeg-2 family. If it were the minimum bitrate, then the average bitrate would be much lower -- at around 16.5 Mbps.
Anyway, since you do appear to be using a VBR, the project properties you use are only similar, not the same as you would get if you rendered 'Same as first clip' instead of Same as Project Properties. If your first clip were indeed one of your HDV mpeg-2 clips, then the HDV segment of your project should be SmartRendered.
As it is, I use HDV in its original TS format with no problems and re-render my projects in that format. I have both used SmartRender and not used it. And with the latter, given that it is only the first render, and using exactly the same properties, I cannot detect any artifacts at all, and the quality seems unchanged -- at least to my naked eye, and I tend to be a bit of a perfectionist about these things.
Since you, on the other hand, have already re-rendered once (from TS .m2t to HDV mpeg-2 and in doing so apparently changed from CBR to VBR, you would already have changed the quality level downwards. So the second full render is thus leading to perceptible fall-off in quality.
Do you still have your original TS .m2t which you could use and edit instead?
Ken Berry
The m2t file was converted to mpg program stream file with a program called mpeg_streamclip.exe. The conversion was recommended by others in this forum since some people have experienced difficulty editing m2t files. I was experiencing a lot of crashes during editing also which seemed to go away once I did the conversion. This may have something to do with the way VS11.5+ generates proxy files since that was what I used for editing.
I am glad you suggested going back to the original m2t file. All I did was rename my m2t file to what my mpg2 file had been and restarted vs11.5+ and then relinked the m2t file. I did a test render on a troublesome section and it looks slightly better with the m2t file. Again, the optimizer indicated that all of the m2t video has to be reencoded. I am not too optimistic about the reencoding, though. I do not think there is much difference, if any, in the compression of an m2t file and an mpg2 file. I think the main difference is in the file format not the compression. It is unfortunate that vs11.5+ does not recognize this.
I am glad you suggested going back to the original m2t file. All I did was rename my m2t file to what my mpg2 file had been and restarted vs11.5+ and then relinked the m2t file. I did a test render on a troublesome section and it looks slightly better with the m2t file. Again, the optimizer indicated that all of the m2t video has to be reencoded. I am not too optimistic about the reencoding, though. I do not think there is much difference, if any, in the compression of an m2t file and an mpg2 file. I think the main difference is in the file format not the compression. It is unfortunate that vs11.5+ does not recognize this.
- Ken Berry
- Site Admin
- Posts: 22481
- Joined: Fri Dec 10, 2004 9:36 pm
- System_Drive: C
- 32bit or 64bit: 64 Bit
- motherboard: Gigabyte B550M DS3H AC
- processor: AMD Ryzen 9 5900X
- ram: 32 GB DDR4
- Video Card: AMD RX 6600 XT
- Hard_Drive_Capacity: 1 TB SSD + 2 TB HDD
- Monitor/Display Make & Model: Kogan 32" 4K 3840 x 2160
- Corel programs: VS2022; PSP2023; DRAW2021; Painter 2022
- Location: Levin, New Zealand
My point was that the compression is really the factor that is causing the re-encoding. Your video started out as TS with a constant bitrate of 25 Mbps. The conversion appears to have not only converted to program stream, but applied a variable bitrate. And a variable bit rate, well, varies. If you use Share > Create Video File > Same as First Clip, it will apply the same variable bitrate, not your approximation of it from MediaInfo...
The other way would be to use mpeg_streamclip to convert using a constant bitrate, if it allows that...
The other way would be to use mpeg_streamclip to convert using a constant bitrate, if it allows that...
Ken Berry
