예제 #1
0
def _edit_encode_stream(server, method: str, stream: EncodeStream):
    form = EncodeStreamForm(obj=stream)

    if method == 'POST' and form.validate_on_submit():
        stream = form.update_entry(stream)
        server.update_stream(stream)
        return jsonify(status='ok'), 200

    return render_template('stream/encode/edit.html',
                           form=form,
                           feedback_dir=stream.generate_feedback_dir())
예제 #2
0
 def update_entry(self, entry: EncodeStream):
     entry.deinterlace = self.deinterlace.data
     entry.frame_rate = self.frame_rate.data
     entry.volume = self.volume.data
     entry.video_codec = self.video_codec.data
     entry.audio_codec = self.audio_codec.data
     entry.audio_channels_count = self.audio_channels_count.data
     entry.size = self.size.get_data()
     entry.video_bit_rate = self.video_bit_rate.data
     entry.audio_bit_rate = self.audio_bit_rate.data
     entry.logo = self.logo.get_data()
     entry.aspect_ratio = self.aspect_ratio.get_data()
     return super(EncodeStreamForm, self).update_entry(entry)
예제 #3
0
 def make_entry(self):
     return self.update_entry(EncodeStream())