VideoHelp Forum
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. I need some advice on transcoding to/from the CineForm intermediate codec.

    I have clips from various sources; h264, MPEG2, VC-1, etc. that I need to convert to CineForm for editing in Vegas Pro but I'm not sure what the correct path would be.

    If I use the CineForm software for transcoding h264, I'll have to demux the mkv clips and remux as mp4 for them to be recognized by the CineForm software. Just an extra step, but I don't have to worry about color spaces.

    On the other hand, I transcode from h264 to CineForm using AviSynth I can use a script similar to this without the demux/remux step:
    Code:
    LoadPlugin("...\tools\ffms\ffms2.dll")
    FFVideoSource("...\Source.mkv", fpsnum=24000, fpsden=1001, cache=false)
    However, I'm not sure about the color spaces used for each of the codecs and how to properly convert between them. Are the color spaces something I should worry about?

    The only thing I really know about the clips, at this point, is that they're all 8-bit; no HDR or 10-bit clips.

    After applying filters in Vegas Pro I'll be encoding to h264/h265 as the final product either by frameserving or rendering another CineForm file, again, some color space change (at least that's what MeGUI says when it adds "ConvertToYV12()" at the end of the script)

    Need some advice on a proper work flow.

    Thanks in advance
    Quote Quote  
  2. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Are your files YV12 (4:2:0) to start with or are they a 4:2:2 source?

    Megui will add that ConvertToYV12() when the decoded source is not YV12. I've come across this problem with certain Directshow decoders, which will take YV12 footage and output YUY2 for whatever reason. If you know your source is not YV12 then this is proper, otherwise this might be a bug that is adding some degradation to your encodings.
    Quote Quote  
  3. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    why use cineform? it's only visually lossless unlike lagarith, huffyuv or utvideo.

    if vegas can use it and it's installed on your computer it will show up in vegas "video for windows" render as codecs. you can encode to it from within vegas.


    Image
    [Attachment 47929 - Click to enlarge]
    Last edited by aedipuss; 29th Jan 2019 at 15:18.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  4. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    oops sorry the slider had moved

    Image
    [Attachment 47930 - Click to enlarge]
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  5. Just by looking at the two image posted above by aedipuss anyone can see all the different items for UtVideo. Need I say more about the confusion?

    All the files I've checked so far show the following:
    MPEG2
    Code:
    ID                                       : 224 (0xE0)
    Format                                   : MPEG Video
    Format version                           : Version 2
    Format profile                           : Main@Main
    Format settings                          : BVOP
    Format settings, BVOP                    : Yes
    Format settings, Matrix                  : Default
    Format settings, GOP                     : Variable
    Format settings, picture structure       : Frame
    Duration                                 : 4 min 8 s
    Bit rate mode                            : Variable
    Bit rate                                 : 4 405 kb/s
    Maximum bit rate                         : 6 125 kb/s
    Width                                    : 720 pixels
    Height                                   : 480 pixels
    Display aspect ratio                     : 4:3
    Frame rate                               : 29.970 (30000/1001) FPS
    Standard                                 : NTSC
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Interlaced
    Scan order                               : Top Field First
    Compression mode                         : Lossy
    Bits/(Pixel*Frame)                       : 0.425
    Time code of first frame                 : 00:00:00:00
    Time code source                         : Group of pictures header
    Stream size                              : 131 MiB (89%)
    Writing library                          : TMPGEnc MPEG Editor 2.1.1.152
    Color primaries                          : BT.601 NTSC
    Transfer characteristics                 : BT.601
    Matrix coefficients                      : BT.601
    As you can see, some deinterlacing needed above.

    h264
    Code:
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L3.1
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, RefFrames               : 4 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 44 min 0 s
    Bit rate mode                            : Variable
    Bit rate                                 : 3 385 kb/s
    Maximum bit rate                         : 5 100 kb/s
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 29.970 (30000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.123
    Stream size                              : 1.04 GiB (95%)
    Language                                 : English
    Default                                  : Yes
    Forced                                   : No
    h264 also, but with some changes like BT.709
    Code:
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 5 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, RefFrames               : 5 frames
    Codec ID                                 : V_MPEG4/ISO/AVC
    Duration                                 : 53 min 8 s
    Bit rate                                 : 2 633 kb/s
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Constant
    Frame rate                               : 23.976 (24000/1001) FPS
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.119
    Stream size                              : 1 001 MiB (86%)
    Writing library                          : x264 core 133 r2334 a3ac64b
    Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 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=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / 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
    Default                                  : Yes
    Forced                                   : No
    Color range                              : Limited
    Matrix coefficients                      : BT.709
    Opening up the clips in VirtualDub2 (x64) the Pixel format (colorspace) shows as yuv420p most of the time with one exception so far which was yuv420p (709). Don't know if that makes any difference.

    All the clips are 4:2:0 8-bit. I guess that would be about the only thing they have in common.

    Also, the only time I've seen the ConvertToYV12() added is when transcoding from CineForm to h264. I don't see it when I use MeGUI to transcode movies directly to h264.
    Quote Quote  
  6. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Anything 1280x720 to 1920x1080 is going to be assumed to be BT.709, which is important when converting between YUV to RGB. Simply looking at a video requires YUV to RGB conversions as we all mostly use RGB monitors but work with YUV video. BT.609 is for SD content, like 480p and 576p resolutions.

    Also, the only time I've seen the ConvertToYV12() added is when transcoding from CineForm to h264. I don't see it when I use MeGUI to transcode movies directly to h264.
    Well then maybe that file was not YV12 and so it was appropriate.
    Quote Quote  
  7. Originally Posted by KarMa View Post
    Well then maybe that file was not YV12 and so it was appropriate.
    Well, that may be, not to mention obvious.

    Not really what I was hoping for. Doesn't clear anything up as to color space conversion.
    Quote Quote  
  8. Originally Posted by aedipuss View Post
    why use cineform? it's only visually lossless unlike lagarith, huffyuv or utvideo.

    if vegas can use it and it's installed on your computer it will show up in vegas "video for windows" render as codecs. you can encode to it from within vegas.


    Image
    [Attachment 47929 - Click to enlarge]
    Regardless of the codec selected as an intermediate, if you don't know what to use, color space wise, all are equally good and equally useless.

    You could open a clip like this in VirtualDub2 (x64):
    Code:
    LoadPlugin("...\tools\ffms\ffms2.dll")
    FFVideoSource("J:\001.mkv")
    Then select Lagarith Lossless codec. But what about the rest of the settings?

    Unless, of course, the color space settings used really don't matter all that much.
    Quote Quote  
  9. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    you have 2 color space choices with some codecs. use 601 for sd material and 709 for hd. some codecs don't give you a choice at all. you can always color correct in post anyway
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  10. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Also, I would say, "If you don't know what they are/mean, don't use them!"
    And if you are ready to use AVISynth, you should be ready to learn about color spaces, color sampling, etc.

    Scott
    Quote Quote  
  11. Originally Posted by Cornucopia View Post
    Also, I would say, "If you don't know what they are/mean, don't use them!"
    And if you are ready to use AVISynth, you should be ready to learn about color spaces, color sampling, etc.

    Scott
    ???

    I thought that was what I was asking in the first place... trying to understand them and how to convert between them appropriately...

    Or, am I missing something here?
    Quote Quote  
  12. Originally Posted by aedipuss View Post
    you have 2 color space choices with some codecs. use 601 for sd material and 709 for hd. some codecs don't give you a choice at all. you can always color correct in post anyway
    If those are the only color space choices, what exactly does 4:2:0, 4:2:2, and so on mean?

    Also, what's YUY2, YV12, RGB24, RGB32, etc.?
    Quote Quote  
  13. It's not clear from your original post that you "need" to convert to cineform at all. Why not just use a proxy workflow and relink your timeline to your original sources for final output. In other words, what's your real goal here? (Obviously I'm willing to concede I may have missed something.)
    Quote Quote  
  14. Member
    Join Date
    Aug 2010
    Location
    San Francisco, California
    Search PM
    Originally Posted by fa1c0n View Post
    Originally Posted by aedipuss View Post
    you have 2 color space choices with some codecs. use 601 for sd material and 709 for hd. some codecs don't give you a choice at all. you can always color correct in post anyway
    If those are the only color space choices, what exactly does 4:2:0, 4:2:2, and so on mean?

    Also, what's YUY2, YV12, RGB24, RGB32, etc.?
    https://en.wikipedia.org/wiki/Chroma_subsampling
    https://en.wikipedia.org/wiki/RGB_color_model
    https://en.wikipedia.org/wiki/YUV
    Quote Quote  
  15. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    YUY2 is 4:2:2, YV24 is 4:4:4, YV16 is 4:2:2, YV12 is 4:2:0, Y8 is 4:. RGB is effectively 4:4:4, but it does not really apply as the luma and chroma are not separated like the different YUV types. RGB24 is a 3 channel image (RedGreenBlue) with 8-bits per channel, taking 24 bits for one pixel. RGB32 is the same as RGB24 but with the addition of a transparent channel (Alpha), aka RGBA. http://avisynth.nl/index.php/YUV
    Quote Quote  
  16. Some interesting reading...

    No mention of lagarith, huffyuv or utvideo as intermediates.
    https://blog.frame.io/2017/02/13/50-intermediate-codecs-compared/
    https://blog.frame.io/2017/02/15/choose-the-right-codec/

    https://trixter.oldskool.org/2017/04/02/an-informal-comparison-of-intermediate-editing-codecs/

    http://www.glennchan.info/articles/vegas/v8color/vegas-9-levels.htm

    Some good explanations.
    http://blogs.adobe.com/VideoRoad/2010/06/color_subsampling_or_what_is_4.html
    http://blogs.adobe.com/VideoRoad/2010/06/understanding_color_processing.html
    http://blogs.adobe.com/VideoRoad/2010/06/what_is_yuv.html

    And, you gotta love YouTube:
    https://www.youtube.com/watch?v=7JYZDnenaGc

    I also came across another codec I hadn't heard of before, MagicYUV. I've run various tests using several different codecs, HuffYUV, Lagarith, CineForm, MagicYUV, Grass Valley, etc. so far to measure encoding speed, file size, compare to original file for quality loss, Vegas compatibility and so on. So far, it seems, that Lagarith and MagicYUV are the quicker lossless formats, though the free version of MagicYUV is limited to 8 bit.

    Has anyone else used MagicYUV for their work? Any thoughts, opinions or something I should look out for when using this codec?
    Last edited by fa1c0n; 3rd Feb 2019 at 14:19.
    Quote Quote  
  17. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    If you want fast, go with Ut Video Codec. Never done Magicyuv.
    Quote Quote  
  18. Originally Posted by KarMa View Post
    If you want fast, go with Ut Video Codec. Never done Magicyuv.
    I've been trying Ut Video Codec using the following:
    AviSynth script:
    Code:
    LoadPlugin("C:\MeGUI-2896-64 - 2018-12-08\tools\ffms\ffms2.dll")
    FFVideoSource("J:\Season 01\S01-E01 - Temp.mkv", fpsnum=24000, fpsden=1001, colorspace="YUV420P8")
    - Open the script in VirtualDub2 (x64)
    - Select Video -> Fast recompress
    - Select Video -> Compression -> UtVideo YUV420 BT.709 VCM
    - File -> Save As...

    I average about 65-75 fps with 1080p. However, when rendering out of Vegas Pro it seems to have smart rendering and doesn't re-compress clips without any changes.

    Using the same script with FFmpeg
    Code:
    ffmpeg -i "J:\AVS Source\S01-E01 - Temp.avs" -vcodec utvideo -colorspace bt709 -an "I:\My Videos - Working On\S01-E01 - Temp.avi"
    I average about 160-180 fps with the same 1080p material. However, when rendering out of Vegas Pro it renders everything.

    I've been looking a the different clips and cannot figure out what the difference is between them that would cause Vegas Pro to re-compress one, but not the other.
    Opened both clips in VirtualDub2 (x64) to check File info, both the same. Media Info reports same results. The only difference is a small change in bitrate used between the two files.

    Is there any way I can speed up the VirtualDub2 (x64) encoding?
    Quote Quote  
  19. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    never mind
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  
  20. Originally Posted by aedipuss View Post
    never mind
    ???
    Quote Quote  
  21. aBigMeanie aedipuss's Avatar
    Join Date
    Oct 2005
    Location
    666th portal
    Search Comp PM
    Originally Posted by fa1c0n View Post
    Originally Posted by aedipuss View Post
    never mind
    ???
    bad info on my part. mixup of magic and magix.
    --
    "a lot of people are better dead" - prisoner KSC2-303
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!