← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 612: Force the correct codecs when exporting to WebM format. WebM only allows libvpx and libvorbis, if...

 

------------------------------------------------------------
revno: 612
fixes bug: https://launchpad.net/bugs/830811
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Thu 2012-01-05 21:25:13 +0000
message:
  Force the correct codecs when exporting to WebM format. WebM only allows libvpx and libvorbis, if the user changes one of the codecs to something unsupported, ffmpeg crashes, which in turn crashes OpenShot.
modified:
  openshot/windows/ExportVideo.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/windows/ExportVideo.py'
--- openshot/windows/ExportVideo.py	2011-10-18 20:41:33 +0000
+++ openshot/windows/ExportVideo.py	2012-01-05 21:25:13 +0000
@@ -723,6 +723,15 @@
 			self.render_options["ar"] = localtxtSampleRate
 			self.render_options["ac"] = localtxtChannels
 			self.render_options["ab"] = AudioBitRateBytes
+			
+			#check the webm render options are correct - webm can only handle
+			#libvorbis and libvpx.
+			if localtxtVideoFormat == 'webm' and (localtxtAudioCodec != 'libvorbis' or localtxtVideoCodec != 'libvpx'):
+				#override the codecs for webm to prevent a libavformat crash.
+				print "Invalid WebM codec detected, forcing WebM defaults"
+				self.render_options["acodec"] = 'libvorbis'
+				self.render_options["vcodec"] = 'libvpx'
+				
 
 			# get the complete path to the new file
 			folder1 = self.render_options["folder"]
@@ -736,7 +745,6 @@
 				# no existing file, so export now
 				self.do_export()
 
-			 
 	def do_export(self):
 		
 		#gray out the export window