Permalink
Browse files

Support gxf muxing in ffmpeg worker

  • Loading branch information...
1 parent dbcdd25 commit 3affecb14529cce80cc85caeaa3424b9b4c177da @mbouron mbouron committed Apr 18, 2012
Showing with 23 additions and 0 deletions.
  1. +1 −0 ChangeLog
  2. +22 −0 toolbox2/worker/ffmpeg.py
View
@@ -22,6 +22,7 @@ Version 0.6.0~dev
* Add mpeg2 transcode action, closes: #5763.
* Do not execute _finalize method if worker exited abnormally.
* Remove sleep based loop in Action._execute_worker, closes: #5759.
+ * Support gxf muxing in ffmpeg worker.
Version 0.5.0 Released on 2012/03/29
View
@@ -396,6 +396,28 @@ def mux_mov(self, basedir, options=None):
path = '%s%s' % (os.path.join(basedir, basename), '.mov')
self.add_output_file(path)
+ def mux_gxf(self, basedir, options=None):
+ if not self.input_files:
+ raise FFmpegWorkerException('no input file specified')
+
+ basename = os.path.splitext(os.path.basename(self.input_files[0].path))[0]
+ avinfo = self.input_files[0].avinfo
+ if not avinfo:
+ raise FFmpegWorkerException('no avinfo specified for input fi1e: %s' % self.input_files[0].path)
+
+ self.format_opts += [('-f', 'gxf')]
+ self.video_opts += [('-map', '0:v')]
+
+ for stream in avinfo.audio_streams:
+ index = len(avinfo.video_streams)
+ for channel_index in range(stream['channels']):
+ self.audio_opts += [('-map', '0:%s' % stream['index'])]
+ self.audio_opts += [('-map_channel', '%s.%s.%s:0.%s' % (0, stream['index'], channel_index, index))]
+ index += 1
+
+ path = '%s%s' % (os.path.join(basedir, basename), '.gxf')
+ self.add_output_file(path)
+
def mux(self, basedir, container, options):
method = getattr(self, 'mux_%s' % container)
return method(basedir, options)

0 comments on commit 3affecb

Please sign in to comment.