Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Z-2697 authored Nov 24, 2022
1 parent c20d3c1 commit eaff9a5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions ddfi2.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class args:
parser.add_argument('-threads',required=False,type=int,help='how many threads to use in VS (core.num_threads), default auto detect\n ',default=None)
parser.add_argument('-maxmem',required=False,type=int,help='max memory to use for cache in VS (core.max_cache_size) in MB, default 4096\n ',default=4096)
parser.add_argument('-model',required=False,type=float,help='model version, default 4.0\n ',default=4.0)
parser.add_argument('--slower-model',required=False,action=argparse.BooleanOptionalAction,default=False)
parser.add_argument('-mf',required=False,type=str,help='medium fps.\n ',default="192000,1001")
parser.parse_args(sys.argv[1:],args)

Expand Down Expand Up @@ -58,11 +59,25 @@ class args:
raise ValueError('scd must be misc, mv or none.')
thscd1,thscd2=args.thscd.split(',')

model_ver_nkv={2:4,2.3:5,2.4:6,3.0:7,3.1:8,4:9}
model_ver_nkv={2: 4,
2.3: 5,
2.4: 6,
3.0: 7,
3.1: 8,
4: 9,
4.1: 11,
4.2: 13,
4.3: 15,
4.4: 17,
4.5: 19,
4.6: 21}
if args.model in model_ver_nkv:
args.model = model_ver_nkv[args.model]
else:
args.model=9

if args.model>=9:
args.model+=args.slower_model

tmpV=os.path.abspath(tmpFolder+'_tmp.mkv') if args.start_time!=None or args.end_time!=None else inFile
tmpTSV2O=os.path.abspath(f'{tmpFolder}tsv2o.txt')
Expand Down Expand Up @@ -183,7 +198,7 @@ def vpyGen():
os.mkdir(tmpFolder)

if not os.path.exists(tmpV):
ff_intermedia=f'\"{ffpath}ffmpeg.exe\" -i \"{inFile}\" {ffss} {ffto} -map 0:v:0 {ffau} {clo} -c:a flac -c:v copy -y \"{tmpFolder}cut.mkv\"'
ff_intermedia=f'\"{ffpath}ffmpeg.exe\" {ffss} {ffto} -i \"{inFile}\" -map 0:v:0 {ffau} {clo} -c:a flac -c:v copy -y \"{tmpFolder}cut.mkv\"'
print(ff_intermedia)
subprocess.run(ff_intermedia,shell=True)
os.rename(f'{tmpFolder}cut.mkv',tmpV)
Expand Down

0 comments on commit eaff9a5

Please sign in to comment.