Importing mp4 (x264 avc) with YUV 4:2:2 fails with green video stream

KevinR wrote on 4/8/2019, 10:26 PM

Hi, I am trying to figure out the best way to import footage from a trail camera into VMS 16 Platinum. The camera generates a .MOV that MediaInfo identifies as QuickTime, and when I try to import that, VMS complains about QuickTime not being installed. I'm comfortable using the ffmpeg command-line and my usual solution to this type of problem is to transcode to AVC/AAC with very high quality. However, the trail cam output is YUV 4:2:2, and I'm unable to import any transcoded clips from ffmpeg into VMS unless I also change the pixel format to YUV 4:2:0. From searching the forum it seems that YUV 4:2:2 is common and generally works in VMS 15 and 16 with so4compoundplug.dll? So I'm wondering if there is something else about my transcoded files that VMS doesn't like.

Computer is an Intel i5-3360M with 16GB RAM, Windows 10 Home build 1809, VMS 16.0 build 109, also VMS 11 previously installed.

MediaInfo for original file, from a Stealth Cam G45NGX:

General
Complete name                            : test.MOV
Format                                   : MPEG-4
Format profile                           : QuickTime
Codec ID                                 : qt   0000.00 (qt  )
File size                                : 494 MiB
Duration                                 : 2 min 0 s
Overall bit rate                         : 34.5 Mb/s
Encoded date                             : UTC 2019-03-16 13:24:20
Tagged date                              : UTC 2019-03-16 13:24:20
Writing library                          : icat

Video
ID                                       : 1
Format                                   : JPEG
Codec ID                                 : jpeg
Duration                                 : 2 min 0 s
Bit rate                                 : 34.3 Mb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 1.242
Stream size                              : 492 MiB (100%)
Language                                 : English
Encoded date                             : UTC 2019-03-16 13:24:20
Tagged date                              : UTC 2019-03-16 13:24:20

Audio
ID                                       : 2
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : sowt
Duration                                 : 2 min 0 s
Bit rate mode                            : Constant
Bit rate                                 : 128 kb/s
Channel(s)                               : 1 channel
Sampling rate                            : 8 000 Hz
Bit depth                                : 16 bits
Stream size                              : 1.83 MiB (0%)
Language                                 : English
Encoded date                             : UTC 2019-03-16 13:24:20
Tagged date                              : UTC 2019-03-16 13:24:20

I first tried rewrapping this as an mp4 using "ffmpeg -i test.MOV -vcodec copy -acodec copy test_rewrap.mp4" but VMS still behaved as if it was QuickTime.

General
Complete name                            : test_rewrap.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/mp41)
File size                                : 494 MiB
Duration                                 : 2 min 0 s
Overall bit rate mode                    : Constant
Overall bit rate                         : 34.5 Mb/s
Writing application                      : Lavf58.9.100

Video
ID                                       : 1
Format                                   : JPEG
Codec ID                                 : mp4v-6C
Duration                                 : 2 min 0 s
Bit rate mode                            : Constant
Bit rate                                 : 34.3 Mb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 1.242
Stream size                              : 492 MiB (100%)
Language                                 : English

Audio
ID                                       : 2
Format                                   : PCM
Format settings                          : Little / Signed
Codec ID                                 : sowt
Duration                                 : 2 min 0 s
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 8 000 Hz
Bit depth                                : 16 bits
Stream size                              : 1.83 MiB (0%)
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

After transcoding with "ffmpeg -i test.MOV -movflags faststart -vcodec libx264 -preset veryslow -crf 18 -acodec libfdk_aac -b:a 192k test_recode.mp4", VMS imports it but the video shows every frame as green:

General
Complete name                            : test_recode.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 80.6 MiB
Duration                                 : 2 min 0 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 612 kb/s
Writing application                      : Lavf58.9.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High 4:2:2@L5
Format settings                          : CABAC / 16 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 16 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2 min 0 s
Bit rate                                 : 5 573 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.202
Stream size                              : 79.9 MiB (99%)
Writing library                          : x264 core 155 r2901 7d0ff22
Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Color range                              : Full
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 2 min 0 s
Duration_LastFrame                       : -120 ms
Bit rate mode                            : Variable
Bit rate                                 : 48.0 kb/s
Maximum bit rate                         : 192 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 8 000 Hz
Frame rate                               : 7.813 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 707 KiB (1%)
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

General
  Name: test_recode.mp4
  Folder: C:\video
  Type: AVC
  Size: 82.53 MB (84,506,485 bytes)
  Created: Thursday, April 4, 2019, 9:26:49 PM
  Modified: Saturday, March 16, 2019, 1:26:20 PM
  Accessed: Thursday, April 4, 2019, 9:20:06 PM
  Attributes: Archive

Streams
  Video: 00:02:00.200, 30.000 fps progressive, 1280x720x16, AVC
  Audio: 00:02:00.200, 8,000 Hz, Mono, AAC

ACID information
  ACID chunk: no
  Stretch chunk: no
  Stretch list: no
  Stretch info2: no
  Beat markers: no
  Detected beats: no

Other metadata
  Regions/markers: no
  Command markers: no

Media manager
  Media tags: no

Plug-In
  Name: compoundplug.dll
  Folder: C:\Program Files\VEGAS\Movie Studio Platinum 16.0\FileIO Plug-Ins\compoundplug
  Format: AVC
  Version: Version 16.0 (Build 109)
  Company: MAGIX Computer Products Intl. Co.

Other presets (medium, slow, slower) behave the same. Only when I force a conversion to yuv420p does the clip import correctly into VMS 16.

ffmpeg -i test.MOV -movflags faststart -vcodec libx264 -preset veryslow -crf 18 -pix_fmt yuv420p -acodec libfdk_aac -b:a 192k test_recode_yuv420p.mp4

General
Complete name                            : test_recode_yuv420p.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 71.9 MiB
Duration                                 : 2 min 0 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 004 kb/s
Writing application                      : Lavf58.9.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L5
Format settings                          : CABAC / 16 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 16 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2 min 0 s
Bit rate                                 : 4 964 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.180
Stream size                              : 71.1 MiB (99%)
Writing library                          : x264 core 155 r2901 7d0ff22
Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 2 min 0 s
Duration_LastFrame                       : -120 ms
Bit rate mode                            : Variable
Bit rate                                 : 48.0 kb/s
Maximum bit rate                         : 192 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 8 000 Hz
Frame rate                               : 7.813 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 707 KiB (1%)
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

General
  Name: test_recode_yuv420p.mp4
  Folder: C:\video
  Type: AVC
  Size: 73.58 MB (75,345,086 bytes)
  Created: Sunday, April 7, 2019, 7:51:33 PM
  Modified: Saturday, March 16, 2019, 1:26:20 PM
  Accessed: Thursday, April 4, 2019, 9:20:06 PM
  Attributes: Archive

Streams
  Video: 00:02:00.200, 30.000 fps progressive, 1280x720x32, AVC
  Audio: 00:02:00.056, 8,000 Hz, Mono, AAC

Summary
  [TCFM]: 7

ACID information
  ACID chunk: no
  Stretch chunk: no
  Stretch list: no
  Stretch info2: no
  Beat markers: no
  Detected beats: no

Other metadata
  Regions/markers: no
  Command markers: no

Media manager
  Media tags: no

Plug-In
  Name: so4compoundplug.dll
  Folder: C:\Program Files\VEGAS\Movie Studio Platinum 16.0\FileIO Plug-Ins\so4compoundplug
  Format: AVC
  Version: Version 1.0 (Build 8532)
  Company: MAGIX Computer Products Intl. Co.

I noticed that the yuv420p transcoded files are imported with "so4compoundplug.dll" while the yuv422p files are imported with "compoundplug.dll", although it's not obvious why that is.

Any ideas why VMS won't import these unless I convert to yuv420?

Comments

Marco. wrote on 4/9/2019, 3:02 AM

Maybe I'm wrong but I'm not aware of a standardized 8 bit 4:2:2 AVC video format. The only 4:2:2 versions of AVC I know are 10 bit (X-AVC).

KevinR wrote on 4/9/2019, 10:30 AM

Thanks for the reply. I changed the transcode to a 10-bit output and VMS still brings in the 4:2:2 version as green frames. If there is any technical documentation on the specific video formats VMS supports, I can't find it.

ffmpeg -i test.MOV -movflags faststart -vcodec libx264 -preset veryslow -crf 18 -pix_fmt yuv422p10le -acodec libfdk_aac -b:a 192K test_recode_10bit.mp4

General
Complete name                            : test_recode_10bit.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 74.9 MiB
Duration                                 : 2 min 0 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 216 kb/s
Writing application                      : Lavf58.27.100

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High 4:2:2@L5
Format settings                          : CABAC / 16 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 16 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 2 min 0 s
Bit rate                                 : 5 176 kb/s
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 10 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.187
Stream size                              : 74.2 MiB (99%)
Writing library                          : x264 core 157 r2969 d4099dd
Encoding settings                        : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=18.0 / qcomp=0.60 / qpmin=0 / qpmax=81 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 2 min 0 s
Duration_LastFrame                       : -120 ms
Bit rate mode                            : Variable
Bit rate                                 : 48.0 kb/s
Maximum bit rate                         : 192 kb/s
Channel(s)                               : 1 channel
Channel layout                           : C
Sampling rate                            : 8 000 Hz
Frame rate                               : 7.813 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 707 KiB (1%)
Language                                 : English
Default                                  : Yes
Alternate group                          : 1

General
  Name: test_recode_10bit.mp4
  Folder: C:\video
  Type: AVC
  Size: 76.69 MB (78,530,600 bytes)
  Created: Tuesday, April 9, 2019, 9:20:03 AM
  Modified: Tuesday, April 9, 2019, 10:04:02 AM
  Accessed: Tuesday, April 9, 2019, 10:04:02 AM
  Attributes: Archive

Streams
  Video: 00:02:00.200, 30.000 fps progressive, 1280x720x16, AVC
  Audio: 00:02:00.200, 8,000 Hz, Mono, AAC

ACID information
  ACID chunk: no
  Stretch chunk: no
  Stretch list: no
  Stretch info2: no
  Beat markers: no
  Detected beats: no

Other metadata
  Regions/markers: no
  Command markers: no

Media manager
  Media tags: no

Plug-In
  Name: compoundplug.dll
  Folder: C:\Program Files\VEGAS\Movie Studio Platinum 16.0\FileIO Plug-Ins\compoundplug
  Format: AVC
  Version: Version 16.0 (Build 109)
  Company: MAGIX Computer Products Intl. Co.

 

Marco. wrote on 4/9/2019, 10:40 AM

It should conform to standard X-AVC-S. I don't know how to script FFmpeg to fullfill this but it is likely not enough to set the bit depth to 10 and the color sampling to 4:2:2.

Why not just use 4:2:0 instead if this FFmpeg encode works fine?

KevinR wrote on 4/9/2019, 12:01 PM

Since the source is 4:2:2 I thought it would be best to stay with that format. I can use 4:2:0 as a workaround, but I'd like to understand why I can't import the 8-bit 4:2:2 into VMS (it plays fine in VLC and other players). I'll look into the X-AVC-S standard, thanks.

Eagle Six wrote on 4/9/2019, 12:26 PM

Why not install Quicktime 7.6 and load the source without modification?

 

System Specs......
Corsair Obsidian Series 450D ATX Mid Tower
Asus X99-A II LGA 2011-v3, Intel X99 SATA 6 Gb/s USB 3.1/3.0 ATX Intel Motherboard
Intel Core i7-6800K 15M Broadwell-E, 6 core 3.4 GHz LGA 2011-v3 (overclocked 20%)
64GB Corsair Vengeance LPX DDR4 3200
Corsair Hydro Series H110i GTX 280mm Extreme Performance Liquid CPU Cooler
MSI Radeon R9 390 DirectX 12 8GB Video Card
Corsair RMx Series RM750X 740W 80 Plus Gold power pack
Samsung 970 EVO NVMe M.2 boot drive
Corsair Neutron XT 2.5 480GB SATA III SSD - video work drive
Western Digitial 1TB 7200 RPM SATA - video work drive
Western Digital Black 6TB 7200 RPM SATA 6Bb/s 128MB Cache 3.5 data drive

Bluray Disc burner drive
2x 1080p monitors
Microsoft Window 10 Pro
DaVinci Resolve Studio 16 pb2
SVP13, MVP15, MVP16, SMSP13, MVMS15, MVMSP15, MVMSP16

Musicvid wrote on 4/9/2019, 12:50 PM

None of the common h264/MP4 profiles support 4:2:2. At least not those supported in Vegas. Hi422P profile h264 support anywhere is as scarce as hens' teeth.

JPEG won't rewrap to MP4 afaik. At least not for Vegas.

XAVC-S only supports 4:2:0, correct(?)

However, converting to h265/HEVC instead "should" work at full 4:2:2.

Or maybe just an intermediate to Magic YUV in ffmpeg.

Marco. wrote on 4/9/2019, 2:17 PM

"None of the common h264/MP4 profiles support 4:2:2."

Good hint. The standardized X-AVC with 10 bit 4:2:2 is MXF not wrapped in MP4.

"XAVC-S only supports 4:2:0, correct(?)"

Correct, again. I mistakenly wrote "XAVC-S" (which would be MP4) but actually it is XAVC (wrapped in MXF).

Musicvid wrote on 4/9/2019, 3:37 PM

And the Hi422P and Hi444PP profiles in h264 are pretty much orphans anyway, since we got x265 / HEVC which does the job straightaway and is deliverable.

KevinR wrote on 4/9/2019, 10:28 PM

Thanks for the info. There are so many video formats! QuickTime 7.6 allows VMS to read the source. I'm looking into MagicYUV, XAVC/MXF, and libx265 now for future 4:2:2 or 4:4:4 transcoding needs with ffmpeg. I'll update when I figure out what works and what doesn't.

Eagle Six wrote on 4/10/2019, 9:44 AM

@KevinR there are 2 hiccups using Quicktime, either of which may or may not effect you. Quicktime is a 32 bit program and Apple has discontinued support. There may be a system security risk of using the Quicktime Player, not actually from the player, but from a source that could carry a virus and Quicktime cannot block it. If you never use the player, no risk.

There is a maximum clip amount that Movie Studio and Vegas Pro can load of files requiring the qt7plug, that is about 40 or so. It doesn't make any difference how large the files are, just how many you load into the timeline. If you are never going to lead 40 or more into the timeline, you shouldn't have a problem. If your projects grow and require more than 40 or so, you may need to transcode/convert your source to something like an intermediate visually lossless like Cineform or MagicYUV. Just some thoughts as you go forward.

System Specs......
Corsair Obsidian Series 450D ATX Mid Tower
Asus X99-A II LGA 2011-v3, Intel X99 SATA 6 Gb/s USB 3.1/3.0 ATX Intel Motherboard
Intel Core i7-6800K 15M Broadwell-E, 6 core 3.4 GHz LGA 2011-v3 (overclocked 20%)
64GB Corsair Vengeance LPX DDR4 3200
Corsair Hydro Series H110i GTX 280mm Extreme Performance Liquid CPU Cooler
MSI Radeon R9 390 DirectX 12 8GB Video Card
Corsair RMx Series RM750X 740W 80 Plus Gold power pack
Samsung 970 EVO NVMe M.2 boot drive
Corsair Neutron XT 2.5 480GB SATA III SSD - video work drive
Western Digitial 1TB 7200 RPM SATA - video work drive
Western Digital Black 6TB 7200 RPM SATA 6Bb/s 128MB Cache 3.5 data drive

Bluray Disc burner drive
2x 1080p monitors
Microsoft Window 10 Pro
DaVinci Resolve Studio 16 pb2
SVP13, MVP15, MVP16, SMSP13, MVMS15, MVMSP15, MVMSP16

KevinR wrote on 4/15/2019, 10:12 PM

Thanks, I think the QT 7.6 codec is going to work for this use case. For anyone else who prefers to use the command-line ffmpeg for transcoding, the lossless open-source UT Video format appears to be a good intermediate choice. There's an encoder in ffmpeg, the format supports 4:2:0, 4:2:2, and 4:4:4, and the free codec allows the files to be read by VMS.

So far I've failed to find any way to use ffmpeg to transcode to any h264 or h265 in 4:2:2 that VMS will accept. I'm still working on that though, mostly out of curiosity at this point, since now I have a way to bring any format readable by ffmpeg into VMS through an lossless intermediate.

Musicvid wrote on 4/16/2019, 2:29 PM

. For anyone else who prefers to use the command-line ffmpeg for transcoding, the lossless open-source UT Video format appears to be a good intermediate choice. 

Agreed. Did you see this?