diff options
author | Christian Pointner <equinox@spreadspace.org> | 2012-09-30 13:19:05 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2012-09-30 13:19:05 +0200 |
commit | 6e266e7628a45b0085da6517d534f4566d7a5c72 (patch) | |
tree | aecc464b35890e00364beed52f952355c84b424b | |
parent | added h264 encode template, what about video bitrate (diff) |
video encoder generation works
-rwxr-xr-x | src/flufigut.py | 21 | ||||
-rw-r--r-- | src/test.json | 10 | ||||
-rw-r--r-- | templates/example/vp8-encode.xml | 14 |
3 files changed, 38 insertions, 7 deletions
diff --git a/src/flufigut.py b/src/flufigut.py index 95a0a59..7ed1e43 100755 --- a/src/flufigut.py +++ b/src/flufigut.py @@ -118,7 +118,7 @@ for property in config['input'].keys(): resolutions = [ ] for encoder in config['encoder']['video'].keys(): - for resolution in config['encoder']['video'][encoder]: + for resolution in config['encoder']['video'][encoder].keys(): if resolution not in resolutions: if config['input']['resolution'] != resolution: if config['globals']['resolutions'][resolution]['rate'] != config['globals']['resolutions'][config['input']['resolution']]['rate']: @@ -163,7 +163,24 @@ for samplerate in samplerates: ### generate encoder components ################################# flow['encoder'] = {} -# TODO +for encoder in config['encoder']['video'].keys(): + for resolution in config['encoder']['video'][encoder].keys(): + if resolution == config['input']['resolution']: + feeder = 'raw-input:video' + else: + feeder = 'resize-%s' % resolution + + flow['encoder']['encode-%s-%s' % (encoder, resolution)] = { + 'type': '%s-encode' % encoder, + 'desc': "%s encoder for %sx%s" % (encoder, config['globals']['resolutions'][resolution]['width'], config['globals']['resolutions'][resolution]['height']), + 'worker': 'encoder-%s' % encoder, + 'feeder': feeder, + 'properties': { + 'bitrate': config['encoder']['video'][encoder][resolution], + }, + } + + ### generate muxer components ################################### flow['muxer'] = {} diff --git a/src/test.json b/src/test.json index a3d71a3..f684e85 100644 --- a/src/test.json +++ b/src/test.json @@ -21,9 +21,9 @@ "ogg-audio": { "muxer": "ogg", "audio": "vorbis" } }, "profiles": { - "high": { "resolution": "720p25", "video": 2048, "audio": 160 }, - "medium": { "resolution": "480p25", "video": 1024, "audio": 160 }, - "low": { "resolution": "360p25", "video": 600, "audio": 96 } + "high": { "video": "720p25", "audio": 160 }, + "medium": { "video": "480p25", "audio": 160 }, + "low": { "video": "360p25", "audio": 96 } }, "machines": { "titan": [ "input", "encoder-vorbis", "encoder-aac", "muxer", "streamer0" ], @@ -41,8 +41,8 @@ }, "encoder": { "video": { - "h264": [ "720p25", "480p25", "360p25" ], - "vp8": [ "720p25", "480p25", "360p25" ] + "h264": { "720p25": 2048, "480p25": 1024, "360p25": 600 }, + "vp8": { "720p25": 2048, "480p25": 1024, "360p25": 600 } }, "audio": { "aac": [ "160@44", "96@44" ], diff --git a/templates/example/vp8-encode.xml b/templates/example/vp8-encode.xml new file mode 100644 index 0000000..8c3fc1c --- /dev/null +++ b/templates/example/vp8-encode.xml @@ -0,0 +1,14 @@ + <component name="{{ name }}" + type="vp8-encoder" + label="{{ component.desc }}" + worker="{{ component.worker }}" + project="flumotion" + version="{{ globals.version }}"> + <eater name="default"> + <feed alias="default">{{ component.feeder }}</feed> + </eater> + <property name="keyframe-maxdistance">50</property> + <property name="bitrate">{{ component.properties['bitrate'] * 1000 }}</property> + <property name="threads">6</property> + <clock-master>false</clock-master> + </component> |