VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. I'm trying to convert a file to something I can work with (dealing with a language barrier between tools)

    Code:
    [E:\Downloads\ffmpeg-20131029-git-f86387b-win64-static\bin]ffmpeg -i E:\scratch\Newyear\00000000.avi
    ffmpeg version N-57605-gf86387b Copyright (c) 2000-2013 the FFmpeg developers
      built on Oct 29 2013 18:08:53 with gcc 4.8.2 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzli
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libr
    eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-
    ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
      libavutil      52. 48.100 / 52. 48.100
      libavcodec     55. 39.100 / 55. 39.100
      libavformat    55. 19.104 / 55. 19.104
      libavdevice    55.  5.100 / 55.  5.100
      libavfilter     3. 90.100 /  3. 90.100
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, avi, from 'E:\scratch\Newyear\00000000.avi':
      Metadata:
        TCOD            : 0
      Duration: 00:07:04.26, start: 0.000000, bitrate: 1591842 kb/s
        Stream #0:0: Video: r210 (r210 / 0x30313272), rgb48le(10 bpc), 1920x1080, 23.98 tbr, 23.98 tbn,
    [mpeg @ 00000000024d88e0] VBV buffer size not set, muxing may fail
    Output #0, mpeg, to 'E:\scratch\Newyear\tryit.mpg':
      Metadata:
        TCOD            : 0
        encoder         : Lavf55.19.104
        Stream #0:0: Video: mpeg1video, yuv420p, 1920x1080, q=2-31, 200 kb/s, 90k tbn, 23.98 tbc
    Stream mapping:
      Stream #0:0 -> #0:0 (r210 -> mpeg1video)
    Press [q] to stop, [?] for help
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=233950 size=274621
    [mpeg @ 00000000024d88e0] packet too large, ignoring buffer limits to mux it
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=233950 size=274621
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=235979 size=274621
    [mpeg @ 00000000024d88e0] packet too large, ignoring buffer limits to mux it
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=235979 size=274621
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=238020 size=274621
    [mpeg @ 00000000024d88e0] packet too large, ignoring buffer limits to mux it
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=238020 size=274621
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=240061 size=274621
    [mpeg @ 00000000024d88e0] packet too large, ignoring buffer limits to mux it
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=240061 size=274621
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=242102 size=274621
    [mpeg @ 00000000024d88e0] packet too large, ignoring buffer limits to mux it
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=242102 size=274621
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=244143 size=274621
    [mpeg @ 00000000024d88e0] packet too large, ignoring buffer limits to mux it
    [mpeg @ 00000000024d88e0] buffer underflow st=0 bufi=244143 size=274621
    I can't find anything about 'buffer' in the man page online. But, I think the mpeg details isn't something I'm really caring about—I just used that as a presumably easy test to see if ffmpeg could read and handle the input.

    I want to convert this to something that Avidemux can read, and uncompressed. Their docs don't really say much, but I'm guessing that the 10-bit data is what confuses it. So what options do I use to convert this to a "more ordinary" AVI or whatever?

    The interesting part above is:
    Stream #0:0: Video: r210 (r210 / 0x30313272), rgb48le(10 bpc), 1920x1080, 23.98 tbr, 23.98 tbn,
    Quote Quote  
  2. r210 is uncompressed 10bit RGB

    avidemux cannot handle high bit depth formats

    What do you need to do in avidemux ? Maybe there are better suited programs

    Your options for converting (assuming you want lossless) are 8bit FFV1 YUV 4:2:0 , 8bit x264 YUV 4:2:0 at q=0 . You will degrade the footage (you're going from higher bitdepths to lower bitdepths, and full color to chroma subsampled; but if this was originally your h.264 DSLR footage it's not a problem because it was 8bit 4:2:0 to begin with)

    eg
    Code:
    ffmpeg -i input.avi -vcodec ffv1 -pix_fmt yuv420p -acodec copy output.avi
    Quote Quote  
  3. Originally Posted by poisondeathray View Post
    What do you need to do in avidemux ? Maybe there are better suited programs
    Thanks so much for the reply.
    I've played with the x264 options for encoding (for youtube) and appreciate how it gives full control rather than some dumbed-down one-size-fits-all that nonetheless gives warnings from youtube when uploaded.
    I also found that one of the noise filters does a good job on the scintillation I get on low-light video from my DSLR.
    It's fine for simple trimming and joining when I don't do anything else with editing.

    Your options for converting (assuming you want lossless) are 8bit FFV1 YUV 4:2:0 , 8bit x264 YUV 4:2:0 at q=0 . You will degrade the footage (you're going from higher bitdepths to lower bitdepths, and full color to chroma subsampled; but if this was originally your h.264 DSLR footage it's not a problem because it was 8bit 4:2:0 to begin with)
    eg
    Code:
    ffmpeg -i input.avi -vcodec ffv1 -pix_fmt yuv420p -acodec copy output.avi
    Great! Then I'll be back in business. Of course, if there are better ways for subsequent files, I'd love to hear about it.

    —John
    Quote Quote  
  4. Originally Posted by JDługosz View Post
    Of course, if there are better ways for subsequent files, I'd love to hear about it.
    Are you referring to batch encoding - yes it's easy to do with ffmpeg

    I forgot you should add -vf colormatrix=bt709:bt601 , assuming you want 709 as the previous discussion. The reason is the conversion from RGB to YUV in ffmpeg will use 601 otherwise (if you recall, slight color shifting)

    Try it out first on a single file first. If you're happy with the current workflow and you want to batch encode , say a directory of r210 AVI's to 4:2:0 8bit FFV1 AVI's for input into avidemux

    Code:
    for %%a in ("*.avi") do ffmpeg -i "%%a" -vcodec ffv1 -pix_fmt yuv420p -vf colormatrix=bt709:bt601 -acodec copy "%%~na.ffv1.avi"
    If you know the name of the denoise filter that you are happy with in avidemux, it might have an equivalent in ffmpeg (then you could do everything in ffmpeg, even encode with libx264) . Or if you want better denoise approaches, avisynth is the way to go
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    r210 is uncompressed 10bit RGB

    avidemux cannot handle high bit depth formats
    What do you need to do in avidemux ? Maybe there are better suited programs
    Hmm, ffmpeg can directly do the x264 encoding with the same details I specified to libx264 via avidemux, if I had any clue as to the way to set those options.

    And it does "filters" (http://ffmpeg.org/ffmpeg.html#Filtering) but what filters? Does it have a temporo-spacial noise filter, or does it use filters from some standard plug-in architecture?
    Quote Quote  
  6. yes ffmpeg can use the same encoding options as avidemux using libx264

    ffmpeg filters are here
    http://ffmpeg.org/ffmpeg-filters.html

    hqdn3d is probably a common one used for denoising in ffmpeg (yes it has spatial and temporal components)
    http://ffmpeg.org/ffmpeg-filters.html#hqdn3d-1
    Quote Quote  
  7. Originally Posted by poisondeathray View Post
    If you know the name of the denoise filter that you are happy with in avidemux, it might have an equivalent in ffmpeg (then you could do everything in ffmpeg, even encode with libx264) . Or if you want better denoise approaches, avisynth is the way to go
    I believe it was denoise3dhq.dll with the defaults all doubled.

    I'm attracted to avisynth in general, being a software developer and used to expressing myself with computer languages. But I've not gotten it to work on my win-x64 machine. At least, not the way I tried before for frameserving — maybe I should try it again.

    I'm happy to use whatever denoise option works, for the tools used. For avidemux I just tried them until I eyeballed what did a good job without messing it up otherwise.
    Quote Quote  
  8. Originally Posted by poisondeathray View Post
    yes ffmpeg can use the same encoding options as avidemux using libx264

    ffmpeg filters are here
    http://ffmpeg.org/ffmpeg-filters.html

    hqdn3d is probably a common one used for denoising in ffmpeg (yes it has spatial and temporal components)
    http://ffmpeg.org/ffmpeg-filters.html#hqdn3d-1
    Great! I'll have to look for more docs in the same parent directory that are not linked from the "man page" document. I thought it was a bit light on details!

    So, to replace my task with ffmpeg, how do I specify details to the x264 encoder? (Does it use the x264 library?)
    Here are the json-format settings from avidemux:
    Code:
    {
    	"general" : {
    		"params" : "AQ=26",
    		"threads" : 99,
    		"fast_first_pass" : true
    	},
    	"level" : 31,
    	"vui" : {
    		"sar_height" : 1,
    		"sar_width" : 1
    	},
    	"MaxRefFrames" : 3,
    	"MinIdr" : 12,
    	"MaxIdr" : 120,
    	"i_scenecut_threshold" : 40,
    	"MaxBFrame" : 2,
    	"i_bframe_adaptive" : 2,
    	"i_bframe_bias" : 0,
    	"i_bframe_pyramid" : 2,
    	"b_deblocking_filter" : true,
    	"i_deblocking_filter_alphac0" : 0,
    	"i_deblocking_filter_beta" : 0,
    	"cabac" : true,
    	"interlaced" : false,
    	"analyze" : {
    		"b_8x8" : true,
    		"b_i4x4" : true,
    		"b_i8x8" : true,
    		"b_p8x8" : false,
    		"b_p16x16" : true,
    		"b_b16x16" : true,
    		"weighted_pred" : 0,
    		"weighted_bipred" : false,
    		"direct_mv_pred" : 3,
    		"chroma_offset" : 0,
    		"me_method" : 1,
    		"mv_range" : 16,
    		"subpel_refine" : 7,
    		"chroma_me" : true,
    		"mixed_references" : true,
    		"trellis" : 1,
    		"psy_rd" : 0,
    		"psy_trellis" : 0,
    		"fast_pskip" : true,
    		"dct_decimate" : true,
    		"noise_reduction" : 0,
    		"psy" : true,
    		"intra_luma" : 21,
    		"inter_luma" : 21
    	},
    	"ratecontrol" : {
    		"rc_method" : 0,
    		"qp_constant" : 0,
    		"qp_min" : 0,
    		"qp_max" : 0,
    		"qp_step" : 0,
    		"bitrate" : 0,
    		"vbv_max_bitrate" : 0,
    		"vbv_buffer_size" : 0,
    		"vbv_buffer_init" : 0,
    		"ip_factor" : 0,
    		"pb_factor" : 0,
    		"aq_mode" : 1,
    		"aq_strength" : 1,
    		"mb_tree" : true,
    		"lookahead" : 40
    	}
    }
    Quote Quote  
  9. Originally Posted by poisondeathray View Post
    Code:
    ffmpeg -i input.avi -vcodec ffv1 -pix_fmt yuv420p -acodec copy output.avi
    Uh... I get a good frame followed by confetti for a few seconds, then repeat. The screenshot (from VLC) is just a corner of the 1080p picture. Avidemux shows the first frame but turns solid green if I try to play; also loaded instantly which makes me think it didn't really go through it (or maybe AVI doesn't need to scan like other containers?)

    Code:
    General
    Complete name                            : E:\scratch\Newyear\tryit.avi
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    Format profile                           : OpenDML
    File size                                : 9.61 GiB
    Duration                                 : 7mn 4s
    Overall bit rate                         : 195 Mbps
    Writing application                      : Lavf55.19.104
    
    Video
    ID                                       : 0
    Format                                   : FFV1
    Codec ID                                 : FFV1
    Duration                                 : 7mn 4s
    Bit rate                                 : 195 Mbps
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 23.976 fps
    Compression mode                         : Lossless
    Bits/(Pixel*Frame)                       : 3.915
    Stream size                              : 9.61 GiB (100%)
    Image Attached Thumbnails Click image for larger version

Name:	000319.png
Views:	2966
Size:	1.26 MB
ID:	23536  

    Quote Quote  
  10. It's working ok here, r210 is decoded and converted to ffv1 ok, and 8bit 420 ffv1 decodes correctly in avidemux 2.6

    Test to see if your r210.avi is being decoded correctly - use ffplay

    ffplay -i r210.avi

    Otherwise try updating your ffmpeg binary, it's a few months old

    ffmpeg-20131029-git-f86387b-win64-static
    Quote Quote  
  11. Originally Posted by JDługosz View Post

    So, to replace my task with ffmpeg, how do I specify details to the x264 encoder? (Does it use the x264 library)
    Did you want to pipe ffmpeg to x264.exe, or use ffmpeg libx264 to encode directly ?

    It uses almost the same syntax as x264 with presets and tunings, but there are a few differences

    The switches are listed in the ffmpeg help under the libx264 section (ffmpeg -h full) , and any non specified switches can be accessed through -x264-params , or -x264opts

    Code:
    libx264 AVOptions:
      -preset            <string>     E..V.. Set the encoding preset (cf. x264 --fullhelp) (default "medium")
      -tune              <string>     E..V.. Tune the encoding params (cf. x264 --fullhelp)
      -profile           <string>     E..V.. Set profile restrictions (cf. x264 --fullhelp) 
      -fastfirstpass     <int>        E..V.. Use fast settings when encoding first pass (from 0 to 1) (default 1)
      -level             <string>     E..V.. Specify level (as defined by Annex A)
      -passlogfile       <string>     E..V.. Filename for 2 pass stats
      -wpredp            <string>     E..V.. Weighted prediction for P-frames
      -x264opts          <string>     E..V.. x264 options
      -crf               <float>      E..V.. Select the quality for constant quality mode (from -1 to FLT_MAX) (default -1)
      -crf_max           <float>      E..V.. In CRF mode, prevents VBV from lowering quality beyond this point. (from -1 to FLT_MAX) (default -1)
      -qp                <int>        E..V.. Constant quantization parameter rate control method (from -1 to INT_MAX) (default -1)
      -aq-mode           <int>        E..V.. AQ method (from -1 to INT_MAX) (default -1)
         none                         E..V..
         variance                     E..V.. Variance AQ (complexity mask)
         autovariance                 E..V.. Auto-variance AQ (experimental)
      -aq-strength       <float>      E..V.. AQ strength. Reduces blocking and blurring in flat and textured areas. (from -1 to FLT_MAX) (default -1)
      -psy               <int>        E..V.. Use psychovisual optimizations. (from -1 to 1) (default -1)
      -psy-rd            <string>     E..V.. Strength of psychovisual optimization, in <psy-rd>:<psy-trellis> format.
      -rc-lookahead      <int>        E..V.. Number of frames to look ahead for frametype and ratecontrol (from -1 to INT_MAX) (default -1)
      -weightb           <int>        E..V.. Weighted prediction for B-frames. (from -1 to 1) (default -1)
      -weightp           <int>        E..V.. Weighted prediction analysis method. (from -1 to INT_MAX) (default -1)
         none                         E..V..
         simple                       E..V..
         smart                        E..V..
      -ssim              <int>        E..V.. Calculate and print SSIM stats. (from -1 to 1) (default -1)
      -intra-refresh     <int>        E..V.. Use Periodic Intra Refresh instead of IDR frames. (from -1 to 1) (default -1)
      -bluray-compat     <int>        E..V.. Bluray compatibility workarounds. (from -1 to 1) (default -1)
      -b-bias            <int>        E..V.. Influences how often B-frames are used (from INT_MIN to INT_MAX) (default INT_MIN)
      -b-pyramid         <int>        E..V.. Keep some B-frames as references. (from -1 to INT_MAX) (default -1)
         none                         E..V..
         strict                       E..V.. Strictly hierarchical pyramid
         normal                       E..V.. Non-strict (not Blu-ray compatible)
      -mixed-refs        <int>        E..V.. One reference per partition, as opposed to one reference per macroblock (from -1 to 1) (default -1)
      -8x8dct            <int>        E..V.. High profile 8x8 transform. (from -1 to 1) (default -1)
      -fast-pskip        <int>        E..V.. (from -1 to 1) (default -1)
      -aud               <int>        E..V.. Use access unit delimiters. (from -1 to 1) (default -1)
      -mbtree            <int>        E..V.. Use macroblock tree ratecontrol. (from -1 to 1) (default -1)
      -deblock           <string>     E..V.. Loop filter parameters, in <alpha:beta> form.
      -cplxblur          <float>      E..V.. Reduce fluctuations in QP (before curve compression) (from -1 to FLT_MAX) (default -1)
      -partitions        <string>     E..V.. A comma-separated list of partitions to consider. Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all
      -direct-pred       <int>        E..V.. Direct MV prediction mode (from -1 to INT_MAX) (default -1)
         none                         E..V..
         spatial                      E..V..
         temporal                     E..V..
         auto                         E..V..
      -slice-max-size    <int>        E..V.. Limit the size of each slice in bytes (from -1 to INT_MAX) (default -1)
      -stats             <string>     E..V.. Filename for 2 pass stats
      -nal-hrd           <int>        E..V.. Signal HRD information (requires vbv-bufsize; cbr not allowed in .mp4) (from -1 to INT_MAX) (default -1)
         none                         E..V..
         vbr                          E..V..
         cbr                          E..V..
      -x264-params       <string>     E..V.. Override the x264 configuration using a :-separated list of key=value parameters
    Quote Quote  
  12. Originally Posted by poisondeathray View Post

    Test to see if your r210.avi is being decoded correctly -
    My earlier test before understanding the output parameters just used the default mpeg output, and that plays. So ffmpeg did read the input and convert to a highly-compressed MPEG file.

    Using ffplay on the output files, it freezes after a few seconds while the text keeps showing it's doing something, and clicking does a seek which shows a picture (frozen) when I click in several places. ffplay handled the mpg file, so I know it works in general on my system.

    Did you want to pipe ffmpeg to x264.exe, or use ffmpeg libx264 to encode directly ?
    I didn't know the former was available. Doing it directly is simpler, but ffmpeg seems to be single threaded (?) so maybe using two processes would be faster. Maybe not, if the input doesn't need any effort but saturates the I/O.

    Thanks for your patient help.
    Quote Quote  
  13. mpeg1 is terrible - I'm sure you saw that

    1st thing I would try is updating your binary

    Using ffplay on the output files, it freezes after a few seconds while the text keeps showing it's doing something, and clicking does a seek which shows a picture (frozen) when I click in several places. ffplay handled the mpg file, so I know it works in general on my system.
    Which output files ? From resolve ? Be specific - did you mean the r210 AVI's ? or converted ffv1 AVI's ?


    Doing it directly is simpler, but ffmpeg seems to be single threaded (?) so maybe using two processes would be faster.
    No, piping adds overhead, and ffmpeg is multithreaded


    But if you want to skip avidemux and do everything in batch with ffmpeg (you still have to test -vf filter options for denoising)

    I'm not that familiar with avidemux' json interpretation of x264. I'll try to translate it to ffmpeg libx264 syntax but a few Q's:

    1) "params" : "AQ=26" - is that AQ strength 2.6 ??!!! It can't be - because later on it says "aq_strength" : 1, Or is that CRF ? AQ means "average quality" ?

    2) are you sure you want threads 99? The more threads , the lower the quality. The optimum is logical cores * 1.5

    3) it says first pass fast = true, but no bitrate is specified ? Are you doing 2 pass VBR then ? or 1pass CRF, or 2pass CRF ? I'll assume it means 1pass CRF 26

    Your avidemux commands would look something like this (no audio in this example -an), assuming you're decoding r210 correctly with that binary
    Code:
    ffmpeg -i input_r210.avi -pix_fmt yuv420p -vf colormatrix=bt709:bt601 -c:v libx264 -profile:v high -level 3.1 -crf 26 -g 120 -bf 2 -b-pyramid 2 -x264-params ref=3:b-adapt=2:sar=1/1 -an x264.mkv
    So you would still add -vf some denoise filter
    Last edited by poisondeathray; 11th Feb 2014 at 23:30.
    Quote Quote  
  14. Originally Posted by poisondeathray View Post
    Which output files ? From resolve ? Be specific - did you mean the r210 AVI's ? or converted ffv1 AVI's ?
    The result of the commands you posted.
    Code:
    General
    Complete name                            : E:\scratch\Newyear\tryit.avi
    Format                                   : AVI
    Format/Info                              : Audio Video Interleave
    Format profile                           : OpenDML
    File size                                : 9.61 GiB
    Duration                                 : 7mn 4s
    Overall bit rate                         : 195 Mbps
    Writing application                      : Lavf55.19.104
    
    Video
    ID                                       : 0
    Format                                   : FFV1
    Codec ID                                 : FFV1
    Duration                                 : 7mn 4s
    Bit rate                                 : 195 Mbps
    Width                                    : 1 920 pixels
    Height                                   : 1 080 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 23.976 fps
    Compression mode                         : Lossless
    Bits/(Pixel*Frame)                       : 3.915
    Stream size                              : 9.61 GiB (100%)
    Interestingly, the "vf" version (the ammended command you posted) gives a larger file.

    1) "params" : "AQ=26" - is that AQ strength 2.6 ??!!! It can't be - because later on it says "aq_strength" : 1, Or is that CRF ? AQ means "average quality" ?
    This is the options page I worked from.
    “ H.264 uses a quantizer scale between 0 and 52. The default quantizer value is 26.”

    2) are you sure you want threads 99? The more threads , the lower the quality. The optimum is logical cores * 1.5
    That must be a special flag meaning "auto-detect". I have six cores, so 9 would be a good setting.

    3) it says first pass fast = true, but no bitrate is specified ? Are you doing 2 pass VBR then ? or 1pass CRF, or 2pass CRF ? I'll assume it means 1pass CRF 26
    The UI says "Constant Rate Factor (Single Pass)". I suppose "fast first pass" is ignored if the mode is single pass.
    Quote Quote  
  15. Code:
    ffmpeg -i input_r210.avi -pix_fmt yuv420p -vf colormatrix=bt709:bt601 -c:v libx264 -profile:v high -level 3.1 -crf 26 -g 120 -bf 2 -b-pyramid 2 -x264-params ref=3:b-adapt=2:sar=1/1 -an x264.mkv
    So you would still add -vf some denoise filter[/QUOTE]

    I gave it a quick spin (I've not upgraded the version yet) and got these warnings:
    Code:
    [libx264 @ 00000000028db4a0] using SAR=1/1
    [libx264 @ 00000000028db4a0] frame MB size (120x68) > level limit (3600)
    [libx264 @ 00000000028db4a0] DPB size (4 frames, 32640 mbs) > level limit (2 frames, 18000 mbs)
    [libx264 @ 00000000028db4a0] MB rate (195644) > level limit (108000)
    Quote Quote  
  16. For the FFV1 export, it can be normal for jerky playback depending on your computer specs - because it's so heavily compressed even more than lagarith . But that earlier screenshot is a decoding error. What version of avidemux are you using ?

    Open it in vdub and go frame by frame to see if the frames are all there (you might need ffdshow installed with ffv1 enabled in the vfw configuration)

    The ffmpeg -vf colormatrix isn't as high quality conversion as doing it through avisynth directly with ConvertToYV12(matrix="rec709") . Or if you don't care about the colors being precise, you can leave it out
    Quote Quote  
  17. Originally Posted by JDługosz View Post
    Code:
    ffmpeg -i input_r210.avi -pix_fmt yuv420p -vf colormatrix=bt709:bt601 -c:v libx264 -profile:v high -level 3.1 -crf 26 -g 120 -bf 2 -b-pyramid 2 -x264-params ref=3:b-adapt=2:sar=1/1 -an x264.mkv
    I gave it a quick spin (I've not upgraded the version yet) and got these warnings:
    Code:
    [libx264 @ 00000000028db4a0] using SAR=1/1
    [libx264 @ 00000000028db4a0] frame MB size (120x68) > level limit (3600)
    [libx264 @ 00000000028db4a0] DPB size (4 frames, 32640 mbs) > level limit (2 frames, 18000 mbs)
    [libx264 @ 00000000028db4a0] MB rate (195644) > level limit (108000)

    Leave out the -level 3.1 setting in ffmpeg ; it's probably set to "auto" in avidemux, but your sheet said L3.1
    Quote Quote  
  18. Originally Posted by poisondeathray View Post
    For the FFV1 export, it can be normal for jerky playback depending on your computer specs - because it's so heavily compressed even more than lagarith . But that earlier screenshot is a decoding error. What version of avidemux are you using ?
    It's uncompressed, not heavily compressed. I don't follow.
    It's the latest version of avidemux, 2.6.7.

    re colormatrix:
    The whole reason I have this format mismatch is because I used Davinci Resolve Light to fix the color. I'll try rendering it again in a YUV format if ffmpeg can take it, and that will save the RGB round-trip.

    The final mkv from the command you posted does play.
    I had previously rendered Resolve to x264 within the program, and I compared the files on the same screen using two instances of VLC. Yours is a little more orange. So maybe the colormatrix was as it wanted it, originally.
    Quote Quote  
  19. Originally Posted by poisondeathray View Post
    For the FFV1 export, it can be normal for jerky playback depending on your computer specs
    Mercury is a AMD 1100T (six cores) overclocked to 4000Mhz and water cooled. 16GB RAM, OS on SSD and these files on a fast data drive. Readubg 198Mbits/sec should be no problem if the drive isn't doing anything else. I recall it gets something like 150 MBytes/sec.
    Quote Quote  
  20. Originally Posted by JDługosz View Post

    It's uncompressed, not heavily compressed. I don't follow.
    FFV1 is lossless compression, not uncompressed (it's like flac vs. uncompressed pcm wav for audio)

    If you wanted uncompressed it would be about 2x the size. You would use -c:v rawvideo instead of -c:v ffv1



    re colormatrix:
    The whole reason I have this format mismatch is because I used Davinci Resolve Light to fix the color. I'll try rendering it again in a YUV format if ffmpeg can take it, and that will save the RGB round-trip.
    There will be a RGB trip if your using things like RGB curves


    The final mkv from the command you posted does play.
    I had previously rendered Resolve to x264 within the program, and I compared the files on the same screen using two instances of VLC. Yours is a little more orange. So maybe the colormatrix was as it wanted it, originally.
    It depends what matrix was used before resolve and what manipulations were done in your workflow. eg. if you used 601 for converting to RGB, then 601 is what you would use to convert back to YUV
    Quote Quote  
  21. Originally Posted by poisondeathray View Post
    FFV1 is lossless compression, not uncompressed (it's like flac vs. uncompressed pcm wav for audio)
    OK, I see. The rendering from Resolve was uncompressed (though subsampled chroma in some of the trys) but the conversion to "something avidemux can read" was ffv1 which is not just an arrangement of bits and planes that is supported but an actual codec. Maybe I'd have had better luck with lossless H.264 for the same purpose.

    Both of the trials to encode using x264 via ffmpeg yesterday gave color shifts. Leaving out the matrix option gave less of a change, but still a bit orange.

    Today I re-rendered the file using the AVI/YUV-10bit choice. That is reported as Codec ID v210, YUV 4:2:2 10-bit. (The other choice is 8 bit, otherwise the same.)

    When I fed that to ffmpeg, the resulting file matches the color of the H.264 file "rendered" directly from Resolve. (Checking those using the same player, against each other means I leave out any color profile settings in the player and Windows, that may make the result look different than the display in Resolve.)

    I don't know if 8b would have been sufficient, but why not? Especially if the denoise filter can work with that, more color resolution when manipulating things around is better.

    I'll try adding the noise filter into the mix next. Here is what I did:

    Code:
    [C:\Program Files\@AV\ffmpeg\bin]ffmpeg -i E:\scratch\Newyear\00000000.avi -pix_fmt yuv420p -c:v libx264 -profile:v high -crf 26 -g 120 -bf 2 -b-pyramid 2 -x264
    -params ref=3:b-adapt=2:sar=1/1 -an E:\scratch\Newyear\yuv10-encode.mkv
    ffmpeg version N-60572-gccc48b3 Copyright (c) 2000-2014 the FFmpeg developers
      built on Feb 12 2014 22:09:24 with gcc 4.8.2 (GCC)
      configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --ena
    ble-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-lib
    modplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinge
    r --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis
     --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
      libavutil      52. 63.101 / 52. 63.101
      libavcodec     55. 52.101 / 55. 52.101
      libavformat    55. 32.100 / 55. 32.100
      libavdevice    55.  9.100 / 55.  9.100
      libavfilter     4.  1.102 /  4.  1.102
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Input #0, avi, from 'E:\scratch\Newyear\00000000.avi':
      Metadata:
        TCOD            : 0
      Duration: 00:07:04.26, start: 0.000000, bitrate: 1061492 kb/s
        Stream #0:0: Video: v210 (v210 / 0x30313276), yuv422p10le, 1920x1080, 23.98 tbr, 23.98 tbn, 23.98 tbc
    File 'E:\scratch\Newyear\yuv10-encode.mkv' already exists. Overwrite ? [y/N] y
    [libx264 @ 00000000002de920] using SAR=1/1
    [libx264 @ 00000000002de920] using cpu capabilities: MMX2 SSE2Fast LZCNT
    [libx264 @ 00000000002de920] profile High, level 4.0
    [libx264 @ 00000000002de920] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 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=9 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=2 b_pyramid=2 b_adapt=2 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=120 keyint_min=12 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=26.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, matroska, to 'E:\scratch\Newyear\yuv10-encode.mkv':
      Metadata:
        TCOD            : 0
        encoder         : Lavf55.32.100
        Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv420p, 1920x1080, q=-1--1, 1k tbn, 23.98 tbc
    Stream mapping:
      Stream #0:0 -> #0:0 (v210 -> libx264)
    Press [q] to stop, [?] for help
    frame=10172 fps= 20 q=-1.0 Lsize=  191009kB time=00:07:04.17 bitrate=3688.9kbits/s
    video:190932kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead 0.040214%
    [libx264 @ 00000000002de920] frame I:86    Avg QP:25.00  size:130775
    [libx264 @ 00000000002de920] frame P:3516  Avg QP:27.63  size: 35624
    [libx264 @ 00000000002de920] frame B:6570  Avg QP:29.64  size:  8982
    [libx264 @ 00000000002de920] consecutive B-frames:  2.0%  4.6% 93.4%
    [libx264 @ 00000000002de920] mb I  I16..4: 14.5% 75.7%  9.8%
    [libx264 @ 00000000002de920] mb P  I16..4:  1.1%  3.0%  0.2%  P16..4: 64.2%  9.8%  7.0%  0.0%  0.0%    skip:14.6%
    [libx264 @ 00000000002de920] mb B  I16..4:  0.1%  0.2%  0.0%  B16..8: 33.9%  1.4%  0.2%  direct: 3.5%  skip:60.7%  L0:43.5% L1:53.2% BI: 3.3%
    [libx264 @ 00000000002de920] 8x8 transform intra:72.1% inter:86.5%
    [libx264 @ 00000000002de920] coded y,uvDC,uvAC intra: 58.6% 89.7% 60.4% inter: 12.5% 36.4% 2.0%
    [libx264 @ 00000000002de920] i16 v,h,dc,p: 23% 22%  9% 46%
    [libx264 @ 00000000002de920] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 20% 14%  6%  6%  7%  8%  9% 10%
    [libx264 @ 00000000002de920] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 25% 10%  6%  7%  7%  9%  6%  6%
    [libx264 @ 00000000002de920] i8c dc,h,v,p: 49% 22% 17% 11%
    [libx264 @ 00000000002de920] Weighted P-Frames: Y:1.5% UV:0.5%
    [libx264 @ 00000000002de920] ref P L0: 47.2% 13.4% 27.7% 11.7%  0.1%
    [libx264 @ 00000000002de920] ref B L0: 63.3% 26.4% 10.3%
    [libx264 @ 00000000002de920] ref B L1: 88.1% 11.9%
    [libx264 @ 00000000002de920] kb/s:3686.70
    Oh, is there an easy way to add the sound in at the same time? I have a 00000000.wav file of the same length (exported from Audacity) that still needs the AAC compression, and then mux into the same mkv.

    —John
    Quote Quote  



Similar Threads