diff --git a/ffmpegService.py b/ffmpegService.py index c9158b8..3be5dd4 100644 --- a/ffmpegService.py +++ b/ffmpegService.py @@ -231,7 +231,7 @@ def mp4x264Encoder(inputsList, outputPathName,filenamePrefix, filtercommand, opt with fileExistanceLock: while 1: fileN+=1 - finalOutName = '{}_WmG_{}.webm'.format(filenamePrefix,fileN) + finalOutName = '{}_WmG_{}.mp4'.format(filenamePrefix,fileN) finalOutName = os.path.join(outputPathName,finalOutName) outLogFilename = os.path.join('tempVideoFiles','encoder_{}.log'.format(fileN)) if not os.path.exists(finalOutName) and finalOutName not in filesPlannedForCreation: @@ -246,6 +246,7 @@ def encoderFunction(br,passNumber,passReason,passPhase=0): ffmpegcommand=[] ffmpegcommand+=['ffmpeg' ,'-y'] + ffmpegcommand+=["-max_muxing_queue_size", "9999"] ffmpegcommand+=inputsList if options.get('audioChannels') == 'No audio' or passPhase==1: @@ -265,18 +266,22 @@ def encoderFunction(br,passNumber,passReason,passPhase=0): ,"-start_at_zero" ,"-c:v","libx264" ,"-stats" + ,"-max_muxing_queue_size", "9999" ,"-pix_fmt","yuv420p" ,"-bufsize", "3000k" ,"-threads", str(4) ,"-crf" ,'17' - ,"-preset", "slow" + ,"-preset", "slower" ,"-tune", "film" ,"-movflags","+faststart"] if sizeLimitMax == 0.0: ffmpegcommand+=["-b:v","0","-qmin","0","-qmax","10"] else: - ffmpegcommand+=["-b:v",str(br)] + ffmpegcommand+= ["-b:v", str(br), "-maxrate", str(br)] + """ + + """ if options.get('audioChannels') == 'No audio' or passPhase==1: ffmpegcommand+=["-an"] @@ -328,7 +333,7 @@ def gifEncoder(inputsList, outputPathName,filenamePrefix, filtercommand, options with fileExistanceLock: while 1: fileN+=1 - finalOutName = '{}_WmG_{}.webm'.format(filenamePrefix,fileN) + finalOutName = '{}_WmG_{}.gif'.format(filenamePrefix,fileN) finalOutName = os.path.join(outputPathName,finalOutName) outLogFilename = os.path.join('tempVideoFiles','encoder_{}.log'.format(fileN)) if not os.path.exists(finalOutName) and finalOutName not in filesPlannedForCreation: @@ -524,6 +529,7 @@ def encodeWorker(): while 1: c = proc.stderr.read(1) if len(c)==0: + print(ln) break if c == b'\r': print(ln) @@ -539,6 +545,7 @@ def encodeWorker(): print(e) ln=b'' ln+=c + proc.communicate() totalEncodedSeconds+=etime statusCallback('Cutting clip {}'.format(i+1),(totalEncodedSeconds)/totalExpectedEncodedSeconds) self.globalStatusCallback('Cutting clip {}'.format(i+1),(totalEncodedSeconds)/totalExpectedEncodedSeconds) @@ -751,6 +758,7 @@ def statsWorker(): while 1: c=proc.stderr.read(1) if len(c)==0: + print(ln) break if c in b'\r\n': if b'pts_time' in ln: @@ -762,6 +770,7 @@ def statsWorker(): ln=b'' else: ln+=c + proc.communicate() except Exception as e: print(e) diff --git a/webmGeneratorController.py b/webmGeneratorController.py index 3fcb65f..d39a8a3 100644 --- a/webmGeneratorController.py +++ b/webmGeneratorController.py @@ -108,7 +108,8 @@ def openProject(self,filename): def getSaveData(self): saveData = {} saveData.update(self.cutselectionController.getStateForSave()) - saveData.update(self.videoManager.getStateForSave()) + saveData.update(self.videoManager.getStateForSave()) + return saveData def saveProject(self,filename): if filename is not None: diff --git a/youtubeDLService.py b/youtubeDLService.py index e5e5071..52d1827 100644 --- a/youtubeDLService.py +++ b/youtubeDLService.py @@ -33,7 +33,7 @@ def downloadFunc(): tempPathname='tempDownloadedVideoFiles' os.path.exists(tempPathname) or os.mkdir(tempPathname) - outfolder = os.path.join(tempPathname,'%(id)s-%(title)s.%(ext)s') + outfolder = os.path.join(tempPathname,'%(title)s-%(id)s.%(ext)s') proc = sp.Popen(['youtube-dl','--ignore-errors','--restrict-filenames','-f','best',url,'-o',outfolder,'--merge-output-format','mp4'],stdout=sp.PIPE) l = b'' self.globalStatusCallback('Downloading {}'.format(url),0)