当前位置: 首页>>代码示例>>Python>>正文


Python Log.i方法代码示例

本文整理汇总了Python中util.Log.i方法的典型用法代码示例。如果您正苦于以下问题:Python Log.i方法的具体用法?Python Log.i怎么用?Python Log.i使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在util.Log的用法示例。


在下文中一共展示了Log.i方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: isinstance

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import i [as 别名]

if profile not in allprofiles:
	Log.e(TAG, "Profile " + profile+" does not exist!")
	sys.exit()

discoveredprofile = allprofiles[profile]
#TODO: use argparse here


thistask = transformer.ffmpeg_tasks_create(fileparsed,discoveredprofile)
if thistask != None:
	thistask.infile = startfilename
	thistask.outfile = endfilename
	thistask.forcefdk = discoveredprofile["audio"]["stereo"]["force_libfdk"]
	Log.i(TAG, "Enqueing " + os.path.basename(startfilename) + " for " + thistask.tasktype)
	if arguments.showcommand == True:
		Log.v(TAG, "ffmpeg command: " + " ".join(thistask.arguments))
	if arguments.dryrun == False and useredis == True:
		redaddr = arguments.redis
		if isinstance(redaddr, list):
			redaddr = arguments.redis[0]
		q = Queue(thistask.tasktype, connection=Redis(redaddr))
		q.enqueue_call("worker.ffmpeg", args=(str(thistask),),timeout=360000)
	else:
		if arguments.dryrun == True:
			Log.e(TAG, "Did not enqueue as per command line options")
		else:
			Log.e(TAG, "Running ffmpeg locally.")
			import worker
			worker.ffmpeg(str(thistask))
开发者ID:olipayne,项目名称:ffproc,代码行数:32,代码来源:ffproc.py

示例2: media_transform

# 需要导入模块: from util import Log [as 别名]
# 或者: from util.Log import i [as 别名]
def media_transform(parser, options):

	#keep track if we do anything other than copying
	tcodeVideo=False
	tcodeAudio=False
	# Start with the video.
	# We're going to check the parser video_stream and compare it to our target.
	cstream = parser.video_stream
	voptions = options["video"]

	codec = "copy"
	if cstream["codec"] != voptions["codec"] or voptions["force"] == True:
		if voptions["allowhevc"] == True and cstream["codec"] == "hevc":
			Log.i(TAG, "Skipping transcode for HVEC as per override.")
		else:
			tcodeVideo = True
			Log.i(TAG, "Transcoding video track")
			codec = voptions["codec"]
	else:
		Log.i(TAG, "Copying video track")

	deinterlace = False
	if (parser.is_interlaced and voptions["deinterlace"] == "yes") or voptions["deinterlace"] == "forced":
		Log.i(TAG, "Deinterlacing video track (will cause transcode!)")
		tcodeVideo=True
		codec = voptions["codec"]
		deinterlace = True

	scaleopts = False

	if voptions["res"] != "keep":
		dres = 0
		if voptions["res"] == "1080p":
			dres = 1080
		elif voptions["res"] == "720p":
			dres = 720
		elif voptions["res"] == "480p":
			dres = 480

		if(cstream["height"] < dres):
			scaleopts = False
		elif(abs(cstream["height"] - dres) < 30):
			scaleopts = False
		else:
			Log.i(TAG, "Scaling video (will cause transcode!)")
			codec = voptions["codec"]
			scaleopts = dres

	video_build = {"type":"video", "index":cstream["index"], "codec": codec, "quality": voptions["quality"], "deinterlacing": deinterlace, "scaleopts": scaleopts}
	if options["video"]["ignore"] == True:
		Log.w(TAG, "Ignoring incorrect video codec")
		video_build = {"type":"video", "index":cstream["index"], "codec": "copy", "quality": "10", "deinterlacing": False, "scaleopts": False}

	aoptions = options["audio"]

	audio_building=[]

	surround_exists = False
	stereo_exists = False
	#Now the hard part. Figuring out the mess of audio streams
	#Find the master track. This is the highest bitrate, highest number of channels stream, which is also in the right language.
	audio_master = {"channels": 0, 'language':'und'}
	audio_stereo = None

	#this feels naieve. Take a closer look at this!
	for track in parser.audio_streams:

		if ( track["language"] == "eng" or track["language"] == "und" or track["language"] == None):
			if track["channels"] > audio_master["channels"]:
				audio_master = track
			if track["channels"] < 6:
				audio_stereo = track
				stereo_exists = True
	if audio_master["channels"] > 2:
		surround_exists = True

	#Add our audio channels.
	#Use the existing surround track
	if surround_exists and aoptions["surround"]["keep"] == True:
		audio_building.append({"type":"audio","index":audio_master["index"], "codec": "copy","ffprocdown":False,"downconvert":False})
		Log.i(TAG, "Copying surround audio")

	#Use our existing stereo track.
	if stereo_exists and aoptions["stereo"]["keep"] == True:
		if "aac" == audio_stereo["codec"]:
			Log.i(TAG, "Copying stereo audio")
			audio_building.append({"type":"audio","index":audio_stereo["index"], "codec": "copy","ffprocdown":False,"downconvert":False})
		else:
			tcodeAudio = True
			Log.i(TAG, "Transcoding existing stereo audio")
			audio_building.append({"type":"audio","index":audio_master["index"], "codec": "aac", "bitrate": aoptions["stereo"]["bitrate"],"downconvert":False, "forcefdk":aoptions["stereo"]["force_libfdk"],"ffprocdown":False})

	#Create from surround.
	if surround_exists and (not stereo_exists or aoptions["stereo"]["keep"] == False) and aoptions["stereo"]["create"] == True:
		Log.i(TAG, "Downmixing surround to stereo")
		tcodeAudio = True
		audio_building.append({"type":"audio","index":audio_master["index"], "codec": "aac", "bitrate": aoptions["stereo"]["bitrate"],"downconvert":True, "forcefdk":aoptions["stereo"]["force_libfdk"],"ffprocdown":aoptions["stereo"]["ffproc_filtering"]})
	
	#Are we doing any transcoding?
	tcode = tcodeVideo or tcodeAudio
#.........这里部分代码省略.........
开发者ID:olipayne,项目名称:ffproc,代码行数:103,代码来源:transformer.py


注:本文中的util.Log.i方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。