Page 1 of 1

quick'n'dirty end-to-end test, ffmpeg accepting .vpy

Posted: Sat Jun 13, 2020 9:50 am
by hydra3333
Hello.

Since ffmpeg now directly accepts vapoursynth .vpy as input, I thought I'd have a look at it with DGstuff and broadly compare encode end-to-end start and end times using a small video at the same transcode settings.

1. ffmpeg using .vpy input, DGsource with single-framerate deinterlace, mild sharpen
Start 23:01:05.13
End 23:01:20.18
Circa 15 seconds elapsed time
Notional encoding fps=245

2. ffmpeg with no .vpy, the native yadif filter deinterlacer and unsharp_mask_opencl (for equivalent enough comparison)
Start 23:01:20.18
End 23:01:34.61
Circa 14.5 seconds elapsed time
Notional encoding fps=248

3. native ffmpeg with no .vpy or filtering, i.e. already deinterlaced input file, reading and encoding only
Start 23:01:34.61
End 23:01:49.01
Circa 14.5 seconds elapsed time
Notional encoding fps=248

I didn't try mixing .vpy/DGstuff with (the tiny number of) ffmpeg OpenCL filters.

Perhaps at 70Mb the test video was too small to show any useful difference, yet as an indicator nothing leaps out as a huge speed benefit (other than the fps of nvidia nvenc encoding itself).

I suppose overheads associated with python/vapoursynth and passing around frames may not have been helpful.
By the time I add audio processing, aac transcoding becomes the limiting factor and circa halved the effective encoding fps anyway.

Benefits of using .vpy directly as input to ffmpeg may include a wider available range of filters to process video, eg DG's gpu accelerated deinterlace/resize, HDRtoSDR, DGSharpen, DGDenoise, and the other vapoursynth (vsrepo) filters.

I am aware of the handy NVEncC.

If nothing else, at least there's a way of using the well-maintained ffmpeg transcoding machine which works with vapoursynth and DG stuff without needing externally specified pipes and whatnot.

If I'm missing something, or doing something silly, please feel free to point it out.

Cheers

Log:

Code: Select all

Sat 13/06/2020 23:01:04.41 
"C:\SOFTWARE\Vapoursynth-x64\DGIndex\DGIndexNV.exe" -i "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4" -h -o "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.dgi" -e 
Project
100
Sat 13/06/2020 23:01:04.99 
DEL /F "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.log" 
Sat 13/06/2020 23:01:05.13 
TYPE "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.vpy" 
import vapoursynth as vs		# this allows use of constants eg vs.YUV420P8 
from vapoursynth import core	# actual vapoursynth core 
#import functools 
#import mvsfunc as mvs			# this relies on the .py residing at the VS folder root level - see run_vsrepo.bat 
#import havsfunc as haf		# this relies on the .py residing at the VS folder root level - see run_vsrepo.bat 
core.std.LoadPlugin(r'C:\SOFTWARE\Vapoursynth-x64\DGIndex\DGDecodeNV.dll') # do it like gonca https://forum.doom9.org/showthread.php?p=1877765#post1877765 
core.avs.LoadPlugin(r'C:\SOFTWARE\Vapoursynth-x64\DGIndex\DGDecodeNV.dll') # do it like gonca https://forum.doom9.org/showthread.php?p=1877765#post1877765 
video = core.dgdecodenv.DGSource(r'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.dgi', deinterlace=1, use_top_field=True, use_pf=False) 
#video = core.avs.DGDenoise(video, strength=0.15, chroma=True) 
video = core.avs.DGSharpen(video, strength=0.3) 
video = vs.core.text.ClipInfo(video) 
video.set_output() 

Sat 13/06/2020 23:01:05.13 Started 'single' 'SINGLE_FRAMERATE' 
"C:\SOFTWARE\Vapoursynth-x64\ffmpeg.exe" -hide_banner -v verbose -nostats -init_hw_device opencl=ocl:0.0 -filter_hw_device ocl  -f vapoursynth -i "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.vpy"   -i "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4"  -map 0:v:0 -map 1:a:0  -vsync 0 -sws_flags lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -strict experimental -c:v h264_nvenc -pix_fmt nv12 -preset slow -2pass 1 -spatial-aq 1 -temporal-aq 1 -refs 3 -bf 2 -g 50 -rc:v vbr_hq -rc-lookahead:v 32 -cq:v 0 -b:v 5000000 -minrate:v 2500000 -maxrate:v 7500000 -bufsize 11250000 -coder 1 -profile:v high -level 5.1 -movflags +faststart+write_colr -an -y "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4" 
Routing option strict to both codec and muxer layer
[AVHWDeviceContext @ 000001d585e71ac0] 0.0: NVIDIA CUDA / GeForce RTX 2060 SUPER
[AVHWDeviceContext @ 000001d585e71ac0] DXVA2 to OpenCL mapping function found (clCreateFromDX9MediaSurfaceKHR).
[AVHWDeviceContext @ 000001d585e71ac0] DXVA2 in OpenCL acquire function found (clEnqueueAcquireDX9MediaSurfacesKHR).
[AVHWDeviceContext @ 000001d585e71ac0] DXVA2 in OpenCL release function found (clEnqueueReleaseDX9MediaSurfacesKHR).
[AVHWDeviceContext @ 000001d585e71ac0] The cl_khr_d3d11_sharing extension is required for D3D11 to OpenCL mapping.
[AVHWDeviceContext @ 000001d585e71ac0] D3D11 to OpenCL mapping not usable.
[vapoursynth @ 000001d585e74a80] VS format YUV420P8 -> pixfmt yuv420p
Input #0, vapoursynth, from 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.vpy':
  Duration: 00:02:18.56, start: 0.000000, bitrate: 0 kb/s
    Stream #0:0: Video: wrapped_avframe, 1 reference frame, yuv420p, 1920x1080, 25.01 tbr, 25.01 tbn, 25.01 tbc
[h264 @ 000001d585ead100] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : VideoReDo (Lavf58.29.100)
  Duration: 00:02:18.62, start: 0.200000, bitrate: 4161 kb/s
    Stream #1:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 3768 kb/s, 25.01 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Side data:
      audio service type: main
Stream mapping:
  Stream #0:0 -> #0:0 (wrapped_avframe (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[graph 0 input from stream 0:0 @ 000001d585eaee40] w:1920 h:1080 pixfmt:yuv420p tb:1000/25007 fr:25007/1000 sar:1/1
[auto_scaler_0 @ 000001d585eaf940] w:iw h:ih flags:'bicubic' interl:0
[format @ 000001d585eaef40] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_null_0' and the filter 'format'
[auto_scaler_0 @ 000001d585eaf940] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1920 h:1080 fmt:nv12 sar:1/1 flags:0x4
[h264_nvenc @ 000001d5bcf9eb00] Loaded Nvenc version 10.0
[h264_nvenc @ 000001d5bcf9eb00] Nvenc initialized successfully
[h264_nvenc @ 000001d5bcf9eb00] 1 CUDA capable devices found
[h264_nvenc @ 000001d5bcf9eb00] [ GPU #0 - < GeForce RTX 2060 SUPER > has Compute SM 7.5 ]
[h264_nvenc @ 000001d5bcf9eb00] supports NVENC
[h264_nvenc @ 000001d5bcf9eb00] AQ enabled.
[h264_nvenc @ 000001d5bcf9eb00] Temporal AQ enabled.
[h264_nvenc @ 000001d5bcf9eb00] Lookahead enabled: depth 32, scenecut enabled, B-adapt enabled.
Output #0, mp4, to 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4':
  Metadata:
    encoder         : Lavf58.46.101
    Stream #0:0: Video: h264 (h264_nvenc) (High), 1 reference frame (avc1 / 0x31637661), nv12, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5000 kb/s, 25.01 fps, 25007 tbn, 25.01 tbc
    Metadata:
      encoder         : Lavc58.92.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 7500000/0/5000000 buffer size: 11250000 vbv_delay: N/A
No more output streams to write to, finishing.
[mp4 @ 000001d585eb0c80] Starting second pass: moving the moov atom to the beginning of the file
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
[AVIOContext @ 000001d585f2ee80] Statistics: 87213620 bytes read, 0 seeks
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
frame= 3465 fps=245 q=35.0 Lsize=   85202kB time=00:02:18.44 bitrate=5041.7kbits/s speed=9.81x    
video:85170kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.038370%
Input file #0 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.vpy):
  Input stream #0:0 (video): 3465 packets read (1857240 bytes); 3465 frames decoded; 
  Total: 3465 packets (1857240 bytes) demuxed
Input file #1 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4):
  Input stream #1:0 (video): 0 packets read (0 bytes); 
  Input stream #1:1 (audio): 0 packets read (0 bytes); 
  Total: 0 packets (0 bytes) demuxed
Output file #0 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4):
  Output stream #0:0 (video): 3465 frames encoded; 3465 packets muxed (87213572 bytes); 
  Total: 3465 packets (87213572 bytes) muxed
[AVIOContext @ 000001d585eb3040] Statistics: 4 seeks, 669 writeouts
[h264_nvenc @ 000001d5bcf9eb00] Nvenc unloaded
[AVIOContext @ 000001d585e7e3c0] Statistics: 993 bytes read, 0 seeks
[AVIOContext @ 000001d585eb3580] Statistics: 728986 bytes read, 1 seeks
Sat 13/06/2020 23:01:20.18 Finished 'single' 'SINGLE_FRAMERATE' - see log file 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.ff.log' 

Sat 13/06/2020 23:01:20.18 Started vanilla ffmpeg comparison with yadif and opencl sharpening COMPARISON 'single' 'SINGLE_FRAMERATE' 
"C:\SOFTWARE\Vapoursynth-x64\ffmpeg.exe" -hide_banner -v verbose -nostats -init_hw_device opencl=ocl:0.0 -filter_hw_device ocl  -i "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4"  -i "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4" -map 0:v:0 -map 1:a:0 -filter_complex "[0:v]yadif=0:0:0,hwupload,unsharp_opencl=lx=3:ly=3:la=0.5:cx=3:cy=3:ca=0.5,hwdownload,format=pix_fmts=yuv420p" -vsync 0 -sws_flags lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -strict experimental -c:v h264_nvenc -pix_fmt nv12 -preset slow -2pass 1 -spatial-aq 1 -temporal-aq 1 -refs 3 -bf 2 -g 50 -rc:v vbr_hq -rc-lookahead:v 32 -cq:v 0 -b:v 5000000 -minrate:v 2500000 -maxrate:v 7500000 -bufsize 11250000 -coder 1 -profile:v high -level 5.1 -movflags +faststart+write_colr -an -y "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-comparison.mp4" 
Routing option strict to both codec and muxer layer
[AVHWDeviceContext @ 0000018b68e61d40] 0.0: NVIDIA CUDA / GeForce RTX 2060 SUPER
[AVHWDeviceContext @ 0000018b68e61d40] DXVA2 to OpenCL mapping function found (clCreateFromDX9MediaSurfaceKHR).
[AVHWDeviceContext @ 0000018b68e61d40] DXVA2 in OpenCL acquire function found (clEnqueueAcquireDX9MediaSurfacesKHR).
[AVHWDeviceContext @ 0000018b68e61d40] DXVA2 in OpenCL release function found (clEnqueueReleaseDX9MediaSurfacesKHR).
[AVHWDeviceContext @ 0000018b68e61d40] The cl_khr_d3d11_sharing extension is required for D3D11 to OpenCL mapping.
[AVHWDeviceContext @ 0000018b68e61d40] D3D11 to OpenCL mapping not usable.
[h264 @ 0000018b68e67300] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : VideoReDo (Lavf58.29.100)
  Duration: 00:02:18.62, start: 0.200000, bitrate: 4161 kb/s
    Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 3768 kb/s, 25.01 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Side data:
      audio service type: main
[h264 @ 0000018b7acc0540] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : VideoReDo (Lavf58.29.100)
  Duration: 00:02:18.62, start: 0.200000, bitrate: 4161 kb/s
    Stream #1:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 3768 kb/s, 25.01 fps, 25 tbr, 90k tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #1:1(eng): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 384 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Side data:
      audio service type: main
Stream mapping:
  Stream #0:0 (h264) -> yadif
  format -> Stream #0:0 (h264_nvenc)
Press [q] to stop, [?] for help
[h264 @ 0000018b68eafb40] Reinit context to 1920x1088, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 0000018b7b097fc0] w:1920 h:1080 pixfmt:yuv420p tb:1/90000 fr:25/1 sar:1/1
[auto_scaler_0 @ 0000018b7b097cc0] w:iw h:ih flags:'bilinear' interl:0
[format @ 0000018b7b0994c0] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_format_4' and the filter 'format'
[auto_scaler_0 @ 0000018b7b097cc0] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1920 h:1080 fmt:nv12 sar:1/1 flags:0x2
[h264_nvenc @ 0000018b7aa75940] Loaded Nvenc version 10.0
[h264_nvenc @ 0000018b7aa75940] Nvenc initialized successfully
[h264_nvenc @ 0000018b7aa75940] 1 CUDA capable devices found
[h264_nvenc @ 0000018b7aa75940] [ GPU #0 - < GeForce RTX 2060 SUPER > has Compute SM 7.5 ]
[h264_nvenc @ 0000018b7aa75940] supports NVENC
[h264_nvenc @ 0000018b7aa75940] AQ enabled.
[h264_nvenc @ 0000018b7aa75940] Temporal AQ enabled.
[h264_nvenc @ 0000018b7aa75940] Lookahead enabled: depth 32, scenecut enabled, B-adapt enabled.
Output #0, mp4, to 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-comparison.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.46.101
    Stream #0:0: Video: h264 (h264_nvenc) (High), 1 reference frame (avc1 / 0x31637661), nv12(left), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5000 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      encoder         : Lavc58.92.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 7500000/0/5000000 buffer size: 11250000 vbv_delay: N/A
No more output streams to write to, finishing.
[mp4 @ 0000018b68eb1840] Starting second pass: moving the moov atom to the beginning of the file
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
[AVIOContext @ 0000018b7aaa43c0] Statistics: 87515029 bytes read, 0 seeks
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
frame= 3464 fps=248 q=31.0 Lsize=   85495kB time=00:02:18.44 bitrate=5059.0kbits/s speed= 9.9x    
video:85464kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.036177%
Input file #0 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4):
  Input stream #0:0 (video): 3465 packets read (65275904 bytes); 3464 frames decoded; 
  Input stream #0:1 (audio): 2 packets read (3072 bytes); 
  Total: 3467 packets (65278976 bytes) demuxed
Input file #1 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.mp4):
  Input stream #1:0 (video): 0 packets read (0 bytes); 
  Input stream #1:1 (audio): 0 packets read (0 bytes); 
  Total: 0 packets (0 bytes) demuxed
Output file #0 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-comparison.mp4):
  Output stream #0:0 (video): 3464 frames encoded; 3464 packets muxed (87514981 bytes); 
  Total: 3464 packets (87514981 bytes) muxed
[AVIOContext @ 0000018b7aa75ec0] Statistics: 4 seeks, 671 writeouts
[h264_nvenc @ 0000018b7aa75940] Nvenc unloaded
[AVIOContext @ 0000018b68e6e780] Statistics: 72028176 bytes read, 1 seeks
[AVIOContext @ 0000018b7b085040] Statistics: 728986 bytes read, 1 seeks
Sat 13/06/2020 23:01:34.61 Finished vanilla ffmpeg comparison with yadif and opencl sharpening COMPARISON 'single' 'SINGLE_FRAMERATE' - see log file 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.ff.log' 

Sat 13/06/2020 23:01:34.61 Started vanilla ffmpeg comparison with nodeint nosharpen COMPARISON 'single' 'SINGLE_FRAMERATE' 
"C:\SOFTWARE\Vapoursynth-x64\ffmpeg.exe" -hide_banner -v verbose -nostats -init_hw_device opencl=ocl:0.0 -filter_hw_device ocl  -i "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-comparison.mp4"  -map 0:v:0  -vsync 0 -sws_flags lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -strict experimental -c:v h264_nvenc -pix_fmt nv12 -preset slow -2pass 1 -spatial-aq 1 -temporal-aq 1 -refs 3 -bf 2 -g 50 -rc:v vbr_hq -rc-lookahead:v 32 -cq:v 0 -b:v 5000000 -minrate:v 2500000 -maxrate:v 7500000 -bufsize 11250000 -coder 1 -profile:v high -level 5.1 -movflags +faststart+write_colr -an -y "G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-nodeint-nosharpen-encode-speed.mp4" 
Routing option strict to both codec and muxer layer
[AVHWDeviceContext @ 000002360b3c1800] 0.0: NVIDIA CUDA / GeForce RTX 2060 SUPER
[AVHWDeviceContext @ 000002360b3c1800] DXVA2 to OpenCL mapping function found (clCreateFromDX9MediaSurfaceKHR).
[AVHWDeviceContext @ 000002360b3c1800] DXVA2 in OpenCL acquire function found (clEnqueueAcquireDX9MediaSurfacesKHR).
[AVHWDeviceContext @ 000002360b3c1800] DXVA2 in OpenCL release function found (clEnqueueReleaseDX9MediaSurfacesKHR).
[AVHWDeviceContext @ 000002360b3c1800] The cl_khr_d3d11_sharing extension is required for D3D11 to OpenCL mapping.
[AVHWDeviceContext @ 000002360b3c1800] D3D11 to OpenCL mapping not usable.
[h264 @ 000002360b3c5dc0] Reinit context to 1920x1088, pix_fmt: yuv420p
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-comparison.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.46.101
  Duration: 00:02:18.56, start: 0.000000, bitrate: 5054 kb/s
    Stream #0:0(und): Video: h264 (High), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 5052 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_nvenc))
Press [q] to stop, [?] for help
[h264 @ 000002361cfbe700] Reinit context to 1920x1088, pix_fmt: yuv420p
[graph 0 input from stream 0:0 @ 000002362235d740] w:1920 h:1080 pixfmt:yuv420p tb:1/12800 fr:25/1 sar:1/1
[auto_scaler_0 @ 000002362235c740] w:iw h:ih flags:'bicubic' interl:0
[format @ 000002362235c640] auto-inserting filter 'auto_scaler_0' between the filter 'Parsed_null_0' and the filter 'format'
[auto_scaler_0 @ 000002362235c740] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1920 h:1080 fmt:nv12 sar:1/1 flags:0x4
[h264_nvenc @ 000002360b3ca440] Loaded Nvenc version 10.0
[h264_nvenc @ 000002360b3ca440] Nvenc initialized successfully
[h264_nvenc @ 000002360b3ca440] 1 CUDA capable devices found
[h264_nvenc @ 000002360b3ca440] [ GPU #0 - < GeForce RTX 2060 SUPER > has Compute SM 7.5 ]
[h264_nvenc @ 000002360b3ca440] supports NVENC
[h264_nvenc @ 000002360b3ca440] AQ enabled.
[h264_nvenc @ 000002360b3ca440] Temporal AQ enabled.
[h264_nvenc @ 000002360b3ca440] Lookahead enabled: depth 32, scenecut enabled, B-adapt enabled.
Output #0, mp4, to 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-nodeint-nosharpen-encode-speed.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.46.101
    Stream #0:0(und): Video: h264 (h264_nvenc) (High), 1 reference frame (avc1 / 0x31637661), nv12(left), 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 5000 kb/s, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.92.100 h264_nvenc
    Side data:
      cpb: bitrate max/min/avg: 7500000/0/5000000 buffer size: 11250000 vbv_delay: N/A
No more output streams to write to, finishing.
[mp4 @ 000002361cdee400] Starting second pass: moving the moov atom to the beginning of the file
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
[AVIOContext @ 000002360b40c200] Statistics: 87426875 bytes read, 0 seeks
Not writing 'clli' atom. No content light level info.
Not writing 'mdcv' atom. Missing mastering metadata.
frame= 3464 fps=248 q=34.0 Lsize=   85409kB time=00:02:18.44 bitrate=5054.0kbits/s speed= 9.9x    
video:85378kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.036799%
Input file #0 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-comparison.mp4):
  Input stream #0:0 (video): 3464 packets read (87514981 bytes); 3464 frames decoded; 
  Total: 3464 packets (87514981 bytes) demuxed
Output file #0 (G:\HDTV\TEST\is_it_blocky_or_just_cruddy.SINGLE_FRAMERATE.mp4.ffmpeg-nodeint-nosharpen-encode-speed.mp4):
  Output stream #0:0 (video): 3464 frames encoded; 3464 packets muxed (87426827 bytes); 
  Total: 3464 packets (87426827 bytes) muxed
[AVIOContext @ 000002360b3cbb80] Statistics: 4 seeks, 671 writeouts
[h264_nvenc @ 000002360b3ca440] Nvenc unloaded
[AVIOContext @ 000002360b3cd240] Statistics: 87546641 bytes read, 0 seeks
Sat 13/06/2020 23:01:49.01 Finished vanilla ffmpeg comparison with nodeint nosharpen COMPARISON 'single' 'SINGLE_FRAMERATE' - see log file 'G:\HDTV\TEST\is_it_blocky_or_just_cruddy.ff.log' 

Re: quick'n'dirty end-to-end test, ffmpeg accepting .vpy

Posted: Sat Jun 13, 2020 10:36 am
by Rocky
Looks like your input is a 1080 MP4 file. I don't know how good my MP4 stuff is as I used a very old MP4V2 codebase. Can you test a longer 4K transport or elementary stream?

Also, is FFMPEG using HW acceleration in your tests? Didn't read all your fine print. ;)

Re: quick'n'dirty end-to-end test, ffmpeg accepting .vpy

Posted: Sat Jun 13, 2020 5:40 pm
by Guest
Thanks for the credit in your script

Re: quick'n'dirty end-to-end test, ffmpeg accepting .vpy

Posted: Sun Jun 14, 2020 2:56 am
by hydra3333
Rocky wrote:
Sat Jun 13, 2020 10:36 am
Looks like your input is a 1080 MP4 file. I don't know how good my MP4 stuff is as I used a very old MP4V2 codebase. Can you test a longer 4K transport or elementary stream?
In my workflow, I always use VideoRedo "QuickStreamFix" cli to cleanup any captured .TS stream into a .mp4 effectively copying the source stream, before I process it with ffmpeg. It incidentally removes (almost) the video/audio delay.

So, yes I'll look, at a longer 4k one, good idea :)
Rocky wrote:
Sat Jun 13, 2020 10:36 am
Also, is FFMPEG using HW acceleration in your tests? Didn't read all your fine print. ;)
:) understood.
No for reading the input file, yes to OpenCL unsharp_mask for equivalence to DGSharpen, yes to encoding.

Re: quick'n'dirty end-to-end test, ffmpeg accepting .vpy

Posted: Sun Jun 14, 2020 8:34 pm
by hydra3333
OK, a 1.8Gb 4K .TS input did as expected.

End-to-end run time was still dominated by the encoding.
Speeds with encoding were close enough to ~66 fps / 61s elapsed.

Except when we add say a denoise filter, eg DGDenoise vs ffmpeg's nlmeans, where

Code: Select all

.vpy DG result was	~52 fps  / 77.095s 
to ffmpeg nlmeans	~0.2 fps / 26128.659s
That may be a reflection on the testing (non equivalent filters/settings), but more likely an indicator that (as expected) doing more intensive filtering vastly changes the performance ratio and that using .vpy directly into ffmpeg isn't an issue and does appear to work.

Of course DGSource is definitely the best means of inputting "modern" video formats into tools such as avisynth/vapoursynth, being robust and frame accurate etc ... and gpu accelerated filtering shines.

I must read the other threads here to see what else is in the works !