Problems rendering interlace H264 files.

mark-h wrote on 10/24/2016, 8:18 PM

Our source is 25fps interlace and we are finding problems using Vegas Edit pro when rendering h264 files. The resulting files claim to be 50fps, they seem to play ok in VLC (and by manually counting frames they are 25fps) but are confusing the transcoders in our workflow and end up producing corrupted output.  Even programs such as Mediainfo says the resulting file is 50fps.   This is clearly wrong.  I've looked at all the renderers available in Vegas which produce h264 files and they all have the same problem.  Is there a solution to this?

Thanks Mark

Comments

Musicvid wrote on 10/24/2016, 8:48 PM

25 frames interlaced = 50i reported.

Same thing. What do you mean by "corrupt"? Do they play badly? Why don't you post the MediaInfo and Render properties so we can help you rule out if what you are seeing is normal behavior?

mark-h wrote on 10/24/2016, 10:23 PM

I'm trying to work out why our production transcoder is corrupting h264 interlace files out of vegas while similar files from other sources do not.

Files from vegas are being reported differently to other 25fps interlace files from different encoders.   This is all I can see is the main difference between the files.

This is an interlace file encoded with MBAFF (file transcodes correctly)

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1mn 7s
Bit rate mode                            : Variable
Bit rate                                 : 10.5 Mbps
Maximum bit rate                         : 22.0 Mbps
Width                                    : 1 440 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : MBAFF
Bits/(Pixel*Frame)                       : 0.270
Stream size                              : 84.0 MiB (99%)
Language                                 : English
Encoded date                             : UTC 2016-07-14 22:17:50
Tagged date                              : UTC 2016-07-14 22:17:50

This is an interlace file encoded from AME using PAFF (file transcodes correctly)

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Format settings, GOP                     : M=3, N=25
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 50s 560ms
Bit rate mode                            : Variable
Bit rate                                 : 9 150 Kbps
Maximum bit rate                         : 32.0 Mbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 1.85:1
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.883
Stream size                              : 55.2 MiB (98%)
Language                                 : English
Encoded date                             : UTC 2016-10-24 23:39:09
Tagged date                              : UTC 2016-10-24 23:39:09
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.470 System B, BT.470 System G
Matrix coefficients                      : BT.601

This is a file from Vegas using PAFF (file does not transcode correctly)

Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 52s 920ms
Bit rate mode                            : Variable
Bit rate                                 : 3 575 Kbps
Maximum bit rate                         : 4 000 Kbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 50.000 fps
Original frame rate                      : 25.000 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.172
Stream size                              : 22.6 MiB (93%)
Language                                 : English
Encoded date                             : UTC 2016-10-24 06:31:46
Tagged date                              : UTC 2016-10-24 06:31:46

I've had different transcoders behave differently.  Some take the source as 50p and then vertically interpolate the result and introduce excessive flicker.  Some take the source as 25p and perform progressive scaling on the interlaced frames.  Our main transcoder doesn't like these files at all and is introducing strange artifacts (looks like macroblocks being lost).  I thought that this transcoder couldn't handle PAFF interlace but it did not exhibit the same problem with files from Adobe Media encoder.

I've tried both the MainConcept AVC/AAC and the Sony AVC/MVC profiles.

Sony:

video format: avc
Frame Size: Pal 720x576
Profile: Main
Entropy coding: CABAC
Frame rate: 25
Field Order: Upper Field First
Pixel aspect ratio: 1.4545
Bit rate: 4,000,000
Number of Slices: 1

Main Concept

Frame Size: Custom
Width: 720 Height: 576
Profile: main
Frame rate: 25
Field Order: Upper field first
Pixel aspect ratio: 1.45
Number of reference frames: 2
Constant bit rate: 4,000,000
Number of slices: 1

 

set wrote on 10/25/2016, 2:44 AM

Never tried h264 for interlace format since I assume it is for media / internet delivery... so I always make it progressive, whether it is 25p or 50p (just recently try experiment exporting output to 1080-50p)

Setiawan Kartawidjaja
Bandung, West Java, Indonesia (UTC+7 Time Area)

Personal FB | Personal IG | Personal YT Channel
Chungs Video FB | Chungs Video IG | Chungs Video YT Channel
Personal Portfolios YouTube Playlist
Pond5 page: My Stock Footage of Bandung city

 

System 5-2021:
Processor: Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz   2.90 GHz
Video Card1: Intel UHD Graphics 630 (Driver 31.0.101.2127 (Feb 1 2024 Release date))
Video Card2: NVIDIA GeForce RTX 3060 Ti 8GB GDDR6 (Driver Version 551.23 Studio Driver (Jan 24 2024 Release Date))
RAM: 32.0 GB
OS: Windows 10 Pro Version 22H2 OS Build 19045.3693
Drive OS: SSD 240GB
Drive Working: NVMe 1TB
Drive Storage: 4TB+2TB

 

System 2-2018:
ASUS ROG Strix Hero II GL504GM Gaming Laptop
Processor: Intel(R) Core(TM) i7 8750H CPU @2.20GHz 2.21 GHz
Video Card 1: Intel(R) UHD Graphics 630 (Driver 31.0.101.2111)
Video Card 2: NVIDIA GeForce GTX 1060 6GB GDDR5 VRAM (Driver Version 537.58)
RAM: 16GB
OS: Win11 Home 64-bit Version 22H2 OS Build 22621.2428
Storage: M.2 NVMe PCIe 256GB SSD & 2.5" 5400rpm 1TB SSHD

 

* I don't work for VEGAS Creative Software Team. I'm just Voluntary Moderator in this forum.

NormanPCN wrote on 10/25/2016, 10:40 AM

You might be using an older version of MediaInfo. Can you use a current one. It details interlaced a little more completely. e.g.

Frame rate mode                     : Constant
Frame rate                               : 59.940 (60000/1001) FPS
Original frame rate                  : 29.970 (30000/1001) FPS
Scan type                                : Interlaced
Scan type, store method         : Separated fields
Scan order                               : Top Field First

The additional information listed is the "store method".

I think there are a couple of ways to store interlaced. Separated or combined/interleaved. The file has a block structure of "frames",  for lack of a better word. Those file frames can be entire video frames or in the case of interlaced separate fields each file frame is just a field.

So an interlaced file, which is stored as interleaved, is already de-interlaced of sorts since the two fields are stored in individual video frames. In a separated field store file, apps need to combine the fields to construct a frame.

The double frame rate listed by MediaInfo on a separated fields store file may be the "frame" rate of the file block structure and since the video file is interlaced, the video frame rate is half that value.

VEGASNeal1 wrote on 10/26/2016, 10:32 AM

I notice that the maximum bit rate of the Vegas file is only 4,000 Kbps; that is a much lower quality file than the others. Some of the macroblocking might be due to this lower quality render.

Also, I notice that the two files that work are both using the "High" profile, while the Vegas file is reported as "Main" profile. Maybe the transcoder does not work so well with "Main" profile source files?

You might check your Vegas custom render template to ensure the profile is set to "High" and the bitrate range is more comparable to the files that work properly.

mark-h wrote on 10/26/2016, 7:47 PM

In order to avoid any confusion with other variables, I've tried to match the settings coming out of AME as close as possible to those of vegas.

Same result as before the Vegas clip doesn't transcode properly, the AME clip does.

AME file:

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2 min 39 s
Bit rate                                 : 4 152 kb/s
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 1.85:1
Frame rate mode                          : Constant
Frame rate                               : 25.000 FPS
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan type, store method                  : Separated fields
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.400
Stream size                              : 79.0 MiB (96%)
Language                                 : English
Encoded date                             : UTC 2016-10-25 23:06:47
Tagged date                              : UTC 2016-10-25 23:06:47
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.470 System B, BT.470 System G
Matrix coefficients                      : BT.601

Vegas Clip

Video
ID                                       : 2
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Format settings, GOP                     : M=4, N=15
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2 min 39 s
Bit rate mode                            : Constant
Bit rate                                 : 4 000 kb/s
Width                                    : 720 pixels
Height                                   : 576 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 50.000 FPS
Original frame rate                      : 25.000 FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan type, store method                  : Separated fields
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 0.193
Stream size                              : 76.1 MiB (97%)
Language                                 : English
Encoded date                             : UTC 2016-10-24 03:37:17
Tagged date                              : UTC 2016-10-24 03:37:17
Color range                              : Limited

I've spoken to our transcoder vendor and because vegas is the only program we're having issues with they are saying it's a vegas fault and won't help us.

I've looked at the files with a h264 bitstream analyser, the vegas file is a mixture of NAL AUD packets and NON-IDR NAL SLICES where as the AME file is purely NON-IDR NAL SLICES.  I don't know how these differences are impacting our transcoder.

I've tried a program called GrayMeta Iris to look at the clips, the timecode display of the vegas clips looks odd, it's followed by a *1 or *2 (I assume meaning top field or bottom field).  Where as other interlaced clips show just the timecode (no *1 following it)

I've come to the conclusion that although these clips may be compliant they are using an obscure feature that many other tools don't know how to interpret. 

PeterDuke wrote on 10/27/2016, 3:01 AM

I notice with the vegas clip that Mediainfo thinks that it is NTSC although the frame rate is now 50.

mark-h wrote on 10/27/2016, 7:12 PM

Yes I've looked in the h264 bitstream and it is flagged as NTSC, I know that this is just a flag and only used to aid decoding but I'm not sure if this is indicative of other configuration items that may have been set incorrectly in the renderer.