VideoHelp Forum
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. I need to transcode M2TS footage to ProRes (my NLE does not natively support M2TS). But I am a little worried I am clipping the super-whites. Anyone see anything wrong with this workflow?

    Avisynth script:
    Code:
    LWLibavVideoSource( "E:\00000.m2ts", stream_index=-1, threads=0, cache=true, dominance=1 )
    QTGMC( Preset="slow", EdiThreads=7 )
    SelectEven
    ConvertToYUY2( interlaced=false, matrix="PC.709", ChromaInPlacement="MPEG2", chromaresample="spline36" )
    Spline36Resize(1920,1080)
    ffmpeg cmd:
    Code:
    ffmpeg -r 30000/1001 -i in.avs -vf scale=w=-1:h=-1:out_color_matrix=bt709 -profile:v 4444 -pix_fmt yuva444p10le -c:v prores_ks -an -f mov -vendor apl0 out.mov
    Sample footage is attached.
    Image Attached Files
    Quote Quote  
  2. Haven't looked ad the clips at all, but here's what I would say just by looking at the avisynth script and the ffmpeg command;
    You got a yuv420p8 source which you first convert to yuv422p8 in Avisynth and then use ffmpeg convert to convert from yuv422p8 to yuva444p10 (why yuva444p10le and not yuv444p10le) wouldn't it be easier and more reliable convert from yuv420p8 to yuv444p10 inside Avisynth?
    Also in case your input is 4k you might want to read: http://www.personal-view.com/talks/discussion/10637/4k-downscaling-progress-topic which is about using ffmpeg to downscale 4k 4:2:0 content to 4:4:4 1920x1080 and keep the chroma information of the original).
    There's also a similar thread over at doom9: http://forum.doom9.org/showthread.php?t=170029
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Quote Quote  
  4. Thanks. I changed my workflow to the following:

    Code:
    LWLibavVideoSource("E:\00002.m2ts", stream_index=-1, threads=0, cache=true, dominance=1)
    QTGMC( Preset="slow", EdiThreads=7 )
    SelectEven
    ConvertToYV16( interlaced=false, matrix="PC.709", ChromaInPlacement="MPEG2", ChromaResample="spline36")
    Spline36Resize(1920,1080)
    Code:
    ffmpeg -r 30000/1001 -i in.avs -vf scale=w=-1:h=-1:out_color_matrix=bt709 -profile:v 3 -quant_mat 3 -pix_fmt yuv422p10le -c:v prores_ks -an -f mov -vendor apl0 out.mov
    I am no longer clipping the superwhites.

    Here, is my last question. Should I switch the order of Convert and Resize for more optimal results?
    Quote Quote  
  5. Sorry but perhaps you can just change container and avoid lossy transcoding...
    Quote Quote  
  6. I hear ya. This is a B camera roll. If the video was in the same format as my A cam, then yes, I would just change the container. But I need to de-interlace, and I want full control over the uprez. So I figure I may as well do all these things at once before ingesting rather than leave it to the NLE. And yes, while it is lossy, the lossiness is somewhat pleasing as QTGMC gets rid of some of the noise.
    Quote Quote  
  7. Then IMHO ffmpeg can be pain in rear... i would recommend something like:

    Code:
    scale=iw:ih:sws_flags=neighbor:sws_dither=0:in_range=1:out_range=1
    at -vf part and overall
    Code:
    -color_range 2
    before and after -i

    I use something like script bellow to verify video before and after applying vf in ffmpeg to avoid any problems (as ffmpeg invoke automatically and silently many conversions in background)

    Code:
    @setlocal
    @set vpproc='copy'
    @set vgain='copy'
    @set vproc='copy'
    
    @ffplay -hide_banner -loglevel 24 -stats -color_range 2 -loop 0 -i "%1" -an -sn -color_range 2 -vf "%vpproc%,scale=-2:256:eval=0:sws_flags=bilinear:sws_dither=0:in_range=1:out_range=1,split=3[a0][b0][c0];[a0]waveform=filter=lowpass:scale=digital:graticule=green:flags=numbers+dots:components=7:display=stack:envelope=peak+instant[a0o];[a0o][b0]vstack[wy0];[c0]%vgain%,%vproc%,split=2[a1][b1];[a1]waveform=filter=lowpass:scale=digital:graticule=green:flags=numbers+dots:components=7:display=stack:envelope=peak+instant[a1o];[a1o][b1]vstack[wy1];[wy0][wy1]hstack"
    @endlocal
    Quote Quote  
  8. Wow, that is one complex cmd line there. From what I can see, ffmpeg isn't doing anything funny. I only add the -vf to force Rec.709, just in case. A lot of the filters run home to Rec.601. I use that cmd in my lossless transcodes all the time, and it works fine.

    What does -color_range 2 do? I can't find any documentation for it.
    Quote Quote  
  9. Originally Posted by SameSelf View Post
    Wow, that is one complex cmd line there. From what I can see, ffmpeg isn't doing anything funny. I only add the -vf to force Rec.709, just in case. A lot of the filters run home to Rec.601. I use that cmd in my lossless transcodes all the time, and it works fine.

    What does -color_range 2 do? I can't find any documentation for it.

    Full level quantization (JPEG), this is quite "new" in ffmpeg - they add lot of switches to deal with colorspaces and levels but they are quite poorly documented (IMHO).

    Mostly i use it in way to say to ffmpeg - don't touch anything .

    Code:
      -color_primaries   <int>        ED.V.... color primaries (from 1 to 10) (default unspecified)
         bt709                        ED.V.... BT.709
         unspecified                  ED.V.... Unspecified
         bt470m                       ED.V.... BT.470 M
         bt470bg                      ED.V.... BT.470 BG
         smpte170m                    ED.V.... SMPTE 170 M
         smpte240m                    ED.V.... SMPTE 240 M
         film                         ED.V.... Film
         bt2020                       ED.V.... BT.2020
         smpte428_1                   ED.V.... SMPTE ST 428-1
      -color_trc         <int>        ED.V.... color transfer characteristics (from 1 to 18) (default unspecified)
         bt709                        ED.V.... BT.709
         unspecified                  ED.V.... Unspecified
         gamma22                      ED.V.... BT.470 M
         gamma28                      ED.V.... BT.470 BG
         smpte170m                    ED.V.... SMPTE 170 M
         smpte240m                    ED.V.... SMPTE 240 M
         linear                       ED.V.... Linear
         log                          ED.V.... Log
         log_sqrt                     ED.V.... Log square root
         iec61966_2_4                 ED.V.... IEC 61966-2-4
         bt1361                       ED.V.... BT.1361
         iec61966_2_1                 ED.V.... IEC 61966-2-1
         bt2020_10bit                 ED.V.... BT.2020 - 10 bit
         bt2020_12bit                 ED.V.... BT.2020 - 12 bit
         smpte2084                    ED.V.... SMPTE ST 2084
         smpte428_1                   ED.V.... SMPTE ST 428-1
      -colorspace        <int>        ED.V.... color space (from 0 to 10) (default unspecified)
         rgb                          ED.V.... RGB
         bt709                        ED.V.... BT.709
         unspecified                  ED.V.... Unspecified
         fcc                          ED.V.... FCC
         bt470bg                      ED.V.... BT.470 BG
         smpte170m                    ED.V.... SMPTE 170 M
         smpte240m                    ED.V.... SMPTE 240 M
         ycocg                        ED.V.... YCOCG
         bt2020_ncl                   ED.V.... BT.2020 NCL
         bt2020_cl                    ED.V.... BT.2020 CL
      -color_range       <int>        ED.V.... color range (from 0 to 2) (default unspecified)
         unspecified                  ED.V.... Unspecified
         mpeg                         ED.V.... MPEG (219*2^(n-8))
         jpeg                         ED.V.... JPEG (2^n-1)
      -chroma_sample_location <int>        ED.V.... chroma sample location (from 0 to 6) (default unspecified)
         unspecified                  ED.V.... Unspecified
         left                         ED.V.... Left
         center                       ED.V.... Center
         topleft                      ED.V.... Top-left
         top                          ED.V.... Top
         bottomleft                   ED.V.... Bottom-left
         bottom                       ED.V.... Bottom
    Quote Quote  
  10. Thanks for that. Much appreciated.
    Quote Quote  



Similar Threads

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