@ -21,12 +21,11 @@ const tests = [
linux : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset slow -c:a copy -c:s copy -max_muxing_queue_size 9999 ',
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset slow -c:a copy -c:s copy -max_muxing_queue_size 9999 -f matroska -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : 'Input file is not MKV so cannot use mkvpropedit to get new file stats. Continuing but file stats will likely be inaccurate...\n'
+ '☑ It looks like the current video bitrate is 1206kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 1206kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 603k \n'
@ -38,12 +37,11 @@ const tests = [
win32 : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=d3d11va -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset slow -c:a copy -c:s copy -max_muxing_queue_size 9999 ',
+ ' -init_hw_device qsv=qsv:MFX_IMPL_hw -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset slow -c:a copy -c:s copy -max_muxing_queue_size 9999 -f matroska -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : 'Input file is not MKV so cannot use mkvpropedit to get new file stats. Continuing but file stats will likely be inaccurate...\n'
+ '☑ It looks like the current video bitrate is 1206kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 1206kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 603k \n'
@ -54,12 +52,11 @@ const tests = [
} ,
darwin : {
processFile : true ,
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset slow -c:a copy -c:s copy -max_muxing_queue_size 9999 ',
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset slow -c:a copy -c:s copy -max_muxing_queue_size 9999 -f matroska ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : 'Input file is not MKV so cannot use mkvpropedit to get new file stats. Continuing but file stats will likely be inaccurate...\n'
+ '☑ It looks like the current video bitrate is 1206kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 1206kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 603k \n'
@ -88,12 +85,11 @@ const tests = [
linux : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ',
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -f mp4 - profile:v main10 -vf scale_qsv=format=p010le -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : 'Input file is not MKV so cannot use mkvpropedit to get new file stats. Continuing but file stats will likely be inaccurate...\n'
+ '☑ It looks like the current video bitrate is 1206kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 1206kbps. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mp4. \n'
+ 'Encode variable bitrate settings: \n'
@ -106,12 +102,11 @@ const tests = [
win32 : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=d3d11va -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le ',
+ ' -init_hw_device qsv=qsv:MFX_IMPL_hw -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -f mp4 - profile:v main10 -vf scale_qsv=format=p010le -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : 'Input file is not MKV so cannot use mkvpropedit to get new file stats. Continuing but file stats will likely be inaccurate...\n'
+ '☑ It looks like the current video bitrate is 1206kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 1206kbps. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mp4. \n'
+ 'Encode variable bitrate settings: \n'
@ -123,7 +118,7 @@ const tests = [
} ,
darwin : {
processFile : true ,
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 - profile:v main10 -vf scale_qsv=format=p010le ',
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox -b:v 603k -minrate 452k -maxrate 754k -bufsize 1206k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 - f mp4 - profile:v main10 -vf scale_qsv=format=p010le ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
@ -148,7 +143,6 @@ const tests = [
file : ( ( ) => {
const file = _ . cloneDeep ( require ( '../sampleData/media/sampleH264_2.json' ) ) ;
file . ffProbeData . streams [ 0 ] . profile = 'High 10' ;
file . mediaInfo . track [ 0 ] . extra . JBDONEDATE = new Date ( ) . toISOString ( ) ;
return file ;
} ) ( ) ,
librarySettings : { } ,
@ -161,17 +155,11 @@ const tests = [
output : {
linux : {
processFile : true ,
preset : '-fflags +genpts <io> -map 0 -c:v hevc_qsv -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 - profile:v main10 -pix_fmt p010le -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
preset : '-fflags +genpts <io> -map 0 -c:v hevc_qsv -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 - f matroska - profile:v main10 -pix_fmt p010le ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Input file is 10bit using High10. Disabling hardware decoding to avoid problems. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mkv. \n'
@ -184,17 +172,11 @@ const tests = [
} ,
win32 : {
processFile : true ,
preset : '-fflags +genpts <io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 - profile:v main10 -pix_fmt p010le -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
preset : '-fflags +genpts <io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 - f matroska - profile:v main10 -pix_fmt p010le ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Input file is 10bit using High10. Disabling hardware decoding to avoid problems. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mkv. \n'
@ -207,17 +189,11 @@ const tests = [
} ,
darwin : {
processFile : true ,
preset : '-fflags +genpts <io> -map 0 -c:v hevc_videotoolbox -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy - profile:v main10 -pix_fmt p010le -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
preset : '-fflags +genpts <io> -map 0 -c:v hevc_videotoolbox -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy - f matroska - profile:v main10 -pix_fmt p010le ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Input file is 10bit using High10. Disabling hardware decoding to avoid problems. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mkv. \n'
@ -237,9 +213,8 @@ const tests = [
input : {
file : ( ( ) => {
const file = _ . cloneDeep ( require ( '../sampleData/media/sampleH265_1.json' ) ) ;
file . mediaInfo . track [ 1 ] . BitRate = 120 5959 0;
file . mediaInfo . track [ 1 ] . BitRate = 120 0000 0;
file . ffProbeData . streams [ 0 ] . profile = 'Main 10' ;
file . mediaInfo . track [ 0 ] . extra . JBDONEDATE = new Date ( ) . toISOString ( ) ;
return file ;
} ) ( ) ,
librarySettings : { } ,
@ -256,73 +231,55 @@ const tests = [
linux : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v hevc_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 6030k -minrate 4523k -maxrate 7538k -bufsize 12060k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v hevc_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 6000k -minrate 4500k -maxrate 7500k -bufsize 12000k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -f matroska -profile:v main10 -vf scale_qsv=format=p010le -vf "hwupload=extra_hw_frames=64,format=qsv" ',
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 12060kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 12000kbps. \n'
+ 'Reconvert_hevc is true & the file is already HEVC, VP9 or AV1. Using HEVC specific cutoff of 6000kbps. \n'
+ '☒ The file is still above this new cutoff! Reconverting. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 60 3 0k \n'
+ 'Minimum = 45 23 k \n'
+ 'Maximum = 75 38 k \n'
+ 'Target = 6000k \n'
+ 'Minimum = 45 00 k \n'
+ 'Maximum = 75 00 k \n'
+ 'File Transcoding... \n' ,
container : '.mkv' ,
} ,
win32 : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=d3d11va -c:v hevc_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 6030k -minrate 4523k -maxrate 7538k -bufsize 12060k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
+ ' -init_hw_device qsv=qsv:MFX_IMPL_hw -c:v hevc_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 6000k -minrate 4500k -maxrate 7500k -bufsize 12000k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -f matroska -profile:v main10 -vf scale_qsv=format=p010le -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 12060kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 12000kbps. \n'
+ 'Reconvert_hevc is true & the file is already HEVC, VP9 or AV1. Using HEVC specific cutoff of 6000kbps. \n'
+ '☒ The file is still above this new cutoff! Reconverting. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 60 3 0k \n'
+ 'Minimum = 45 23 k \n'
+ 'Maximum = 75 38 k \n'
+ 'Target = 6000k \n'
+ 'Minimum = 45 00 k \n'
+ 'Maximum = 75 00 k \n'
+ 'File Transcoding... \n' ,
container : '.mkv' ,
} ,
darwin : {
processFile : true ,
preset : '-fflags +genpts <io> -map 0 -c:v hevc_videotoolbox -b:v 60 30k -minrate 4523k -maxrate 7538k -bufsize 1206 0k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -vf scale_qsv=format=p010le -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
preset : '-fflags +genpts <io> -map 0 -c:v hevc_videotoolbox -b:v 60 00k -minrate 4500k -maxrate 7500k -bufsize 1200 0k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -profile:v main10 -f matroska -profile:v main10 - vf scale_qsv=format=p010le',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 12060kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 12000kbps. \n'
+ 'Reconvert_hevc is true & the file is already HEVC, VP9 or AV1. Using HEVC specific cutoff of 6000kbps. \n'
+ '☒ The file is still above this new cutoff! Reconverting. \n'
+ '10 bit encode enabled. Setting Main10 Profile & 10 bit pixel format \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 60 3 0k \n'
+ 'Minimum = 45 23 k \n'
+ 'Maximum = 75 38 k \n'
+ 'Target = 6000k \n'
+ 'Minimum = 45 00 k \n'
+ 'Maximum = 75 00 k \n'
+ '==ALERT== OS detected as MAC - This will use VIDEOTOOLBOX to encode which is NOT QSV\n'
+ 'cmds set in extra_qsv_options will be IGNORED!\n'
+ 'File Transcoding... \n' ,
@ -356,53 +313,17 @@ const tests = [
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 5000kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 5000kbps. \n'
+ 'Reconvert_hevc is true & the file is already HEVC, VP9 or AV1. Using HEVC specific cutoff of 6000kbps. \n'
+ '☑ The file is NOT above this new cutoff. Exiting plugin. \n' ,
container : '.mkv' ,
} ,
} ,
// Test 5
{
input : {
file : ( ( ) => {
const file = _ . cloneDeep ( require ( '../sampleData/media/sampleH265_1.json' ) ) ;
file . container = 'mp4' ;
return file ;
} ) ( ) ,
librarySettings : { } ,
inputs : {
container : 'mp4' ,
encoder _speedpreset : 'fast' ,
bitrate _cutoff : '3500' ,
} ,
otherArguments : { } ,
} ,
output : {
processFile : false ,
preset : '' ,
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : 'Input file is not MKV so cannot use mkvpropedit to get new file stats. Continuing but file stats will likely be inaccurate...\n'
+ '==WARNING== Failed to get an accurate video bitrate, falling back to old method to get OVERALL file bitrate of 3059kbps. Bitrate calculations for video encode will likely be inaccurate... \n'
+ '☑ Current bitrate is below set cutoff of 3500kbps. \n'
+ 'Cancelling plugin. \n' ,
container : '.mp4' ,
} ,
} ,
// Test 6
{
input : {
file : ( ( ) => {
const file = _ . cloneDeep ( require ( '../sampleData/media/sampleH264_2.json' ) ) ;
file . mediaInfo . track [ 0 ] . extra . JBDONEDATE = new Date ( ) . toISOString ( ) ;
file . ffProbeData . streams [ 3 ] . codec _name = 'hdmv_pgs_subtitle' ;
file . ffProbeData . streams [ 4 ] . codec _name = 'eia_608' ;
file . ffProbeData . streams [ 5 ] . codec _name = 'subrip' ;
@ -421,17 +342,11 @@ const tests = [
linux : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:3 -map -0:4 -map -0:5 -map -0:6 -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:3 -map -0:4 -map -0:5 -map -0:6 -f mp4 -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mp4. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
@ -443,17 +358,11 @@ const tests = [
win32 : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=d3d11va -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:3 -map -0:4 -map -0:5 -map -0:6 -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
+ ' -init_hw_device qsv=qsv:MFX_IMPL_hw -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:3 -map -0:4 -map -0:5 -map -0:6 -f mp4 -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mp4. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
@ -464,17 +373,11 @@ const tests = [
} ,
darwin : {
processFile : true ,
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:3 -map -0:4 -map -0:5 -map -0:6 -ma p_metadata:g -1 -metadata JBDONEDATE=267 4800000 ',
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:3 -map -0:4 -map -0:5 -map -0:6 -f mp4',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mp4. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
@ -485,12 +388,11 @@ const tests = [
} ,
} ,
} ,
// Test 7
// Test 6
{
input : {
file : ( ( ) => {
const file = _ . cloneDeep ( require ( '../sampleData/media/sampleH264_2.json' ) ) ;
file . mediaInfo . track [ 0 ] . extra . JBDONEDATE = new Date ( ) . toISOString ( ) ;
file . ffProbeData . streams [ 3 ] . codec _name = 'mov_text' ;
file . ffProbeData . streams [ 4 ] . codec _name = 'eia_608' ;
file . ffProbeData . streams [ 5 ] . codec _name = 'timed_id3' ;
@ -508,66 +410,48 @@ const tests = [
linux : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -map -0:3 -map -0:4 -map -0:5 -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
+ ' -init_hw_device qsv:hw_any,child_device_type=vaapi -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -map -0:3 -map -0:4 -map -0:5 -f matroska -vf "hwupload=extra_hw_frames=64,format=qsv" ',
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
+ 'Minimum = 2420k \n'
+ 'Maximum = 4034k \n'
+ 'File Transcoding... \n' ,
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
+ 'Minimum = 2420k \n'
+ 'Maximum = 4034k \n'
+ 'File Transcoding... \n' ,
container : '.mkv' ,
} ,
win32 : {
processFile : true ,
preset : '-fflags +genpts -hwaccel qsv -hwaccel_output_format qsv \n'
+ ' -init_hw_device qsv:hw_any,child_device_type=d3d11va -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -map -0:3 -map -0:4 -map -0:5 -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
+ ' -init_hw_device qsv=qsv:MFX_IMPL_hw -c:v h264_qsv<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -map -0:3 -map -0:4 -map -0:5 -f matroska -vf "hwupload=extra_hw_frames=64,format=qsv" ' ,
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
+ 'Minimum = 2420k \n'
+ 'Maximum = 4034k \n'
+ 'File Transcoding... \n' ,
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
+ 'Minimum = 2420k \n'
+ 'Maximum = 4034k \n'
+ 'File Transcoding... \n' ,
container : '.mkv' ,
} ,
darwin : {
processFile : true ,
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -map -0:3 -map -0:4 -map -0:5 -map_metadata:g -1 -metadata JBDONEDATE=2674800000 ',
preset : '-fflags +genpts -hwaccel videotoolbox<io> -map 0 -c:v hevc_videotoolbox<io> -map 0 -c:v hevc_qsv -load_plugin hevc_hw -b:v 3227k -minrate 2420k -maxrate 4034k -bufsize 6454k -preset fast -c:a copy -c:s copy -max_muxing_queue_size 9999 -map -0:d -map -0:3 -map -0:4 -map -0:5 -f matroska ' ,
handBrakeMode : false ,
FFmpegMode : true ,
reQueueAfter : true ,
infoLog : "Checking file stats - If stats are older than 7 days we'll grab new stats.\n"
+ '\n'
+ ` Stats threshold: ${ statsThresString } \n `
+ '\n'
+ ` Current stats date: ${ datStatsString } \n `
+ '☑ File stats are upto date! - Continuing...\n'
+ '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
+ 'Minimum = 2420k \n'
+ 'Maximum = 4034k \n'
+ 'File Transcoding... \n' ,
infoLog : '☑ It looks like the current video bitrate is 6454kbps. \n'
+ 'Container for output selected as mkv. \n'
+ 'Encode variable bitrate settings: \n'
+ 'Target = 3227k \n'
+ 'Minimum = 2420k \n'
+ 'Maximum = 4034k \n'
+ 'File Transcoding... \n' ,
container : '.mkv' ,
} ,
} ,