is there a fastest nooblet way to take advantage of GPU in no time?

Examples and samples for those who develop software with FFmpeg.
Post Reply
ggffmpeg000
Posts: 1
Joined: Tue May 16, 2017 7:20 am

is there a fastest nooblet way to take advantage of GPU in no time?

Post by ggffmpeg000 » Tue May 16, 2017 7:30 am

OK, I am software engineer, but that does not know, i should know everything. I got haystack of responsibility on my back. Now I occasionally have a need to use ffmpeg to use to convert *.avi to *flv format in large numbers.

Recently I converted 4GB of movies into flv and process took more than two day. I have a AMD 8300 with GeForce 750 Ti.
Question arises
- Is there a way to take advantage of using GPU without re-compiling? Any fast way, I just dont know have experience and looking for a fastest and simplest way to get it up and running with GPU. I am not sure current command I am using using CPU only or CPU + GPU. (Please see scripts I am using below). If there is any can someone give me a good example?

- Is there a way to see threads processes that are assigned to CPU-s and/or GPU-s during conversion?

I am willing to pay out 20$ worth of bitcoin for very helpful response that got me get up and running.

Code: Select all

#c:\python27\python.exe
import os
import datetime
import re
import sys
import time

outputFileExtension=".flv"

supportedOutputFormats = ['mpg','flv','mp4']

print str(len(sys.argv))

if len(sys.argv) >= 2:
	if sys.argv[1] in supportedOutputFormats:
		outputFileExtension = "." + sys.argv[1]
		print "outputFileExtension set to : " + outputFileExtension
	else:
		print "outputFileExtension specified is not supported. Will use default: " + outputFileExtension
	
else:
		print "No outputFileExtension specified. Will use default: " + outputFileExtension
time.sleep(3)		
	
print os.getcwd()
files=os.listdir(os.getcwd())	
videoOption = "-s hd1080"
#videoOption = ""

counter = 0
outputList = []
command = ""
outputConcatFile=""
debug = 0

for i in files:
	if i[-3:] == "avi":
		print "converting to: " + i[:-4] + outputFileExtension
		outputName = "movie" + str(counter) + outputFileExtension
		# HD1080 looks very low resolution. Trying higher resolution.	
		#command = "ffmpeg -i \"" + str(i) + "\" -s hd1080 " + outputName
		
		# right speed, output is less ideal whtn uhd4320		
		command = "ffmpeg -i \"" + str(i) + "\" -s 4k " + outputName
		
		# too slow bogs down computer
		#command = "ffmpeg -i \"" + str(i) + "\" -s uhd4320 " + outputName
		
		outputList.append(outputName)		
		print "convert command: " + str(command)
		os.system(command)
		counter += 1
		
		if counter > 1 and debug:
			break
outputListFileName = "outputList.log"		
fp=open(outputListFileName, 'w+')

for i in outputList:
	fp.write('file \'' + i + '\'\n')
fp.close()	

outputConcatFile = re.sub(":", ".", str(datetime.datetime.now().isoformat()))
print "outputConcatFile: " + str(outputConcatFile)

command = "ffmpeg -f concat -i "+ str(outputListFileName) +" -c copy " + outputConcatFile + outputFileExtension
print "concatenation command: " + str(command)
os.system(command)

print "deleting intermediate files: " 

#for i in outputList:
	#os.system("del " + i)
	

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest