python怎么读取流媒体WMV头文件信息

Python016

python怎么读取流媒体WMV头文件信息,第1张

一系列的音频数据的帧,在文件的中间位置,个数由文件大小和帧长决定;

每个帧都以FFF开头,的长度可能不固定,也可能固定,由位率bitrate决定;

每个帧又分为帧头和数据实体两部分;帧头记录了mp3 的位率,采样率,版本等信息,每个帧之间相互独立 。

#!/usr/bin/env pythonfrom flask import Flask, render_template, Responsefrom camera import Camera

app = Flask(__name__)@app.route('/')def index():

    return render_template('index.html')def gen(camera):

    while True:

        frame = camera.get_frame()        yield (b'--frame\r\n'

               b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n')@app.route('/video_feed')def video_feed():

    return Response(gen(Camera()),

                    mimetype='multipart/x-mixed-replace boundary=frame')if __name__ == '__main__':

    app.run(host='0.0.0.0', debug=True)

网页链接

将Scratch文件转化为swf格式的流媒体,具体方法:

1.下载转换工具ScratchFlash,打开解压出来的文件夹,会看到两个文件.双击ScratchFlash.html文件,点击网页上方“Open Scratch File”按钮,选择你要转换的文件。

2.在这里有以下选项其含义分别是

Full Screen 全屏显示

Show Green Flag Bar 显示绿旗标

Start in Turbo Mode 以加速模式显示

Automatically Start 自动播放

Show Scripts 显示脚本

3.根据需求选择好相应的选项后,点击最下面的“Convert to SWF”按钮。

4.在弹出的窗口中选择swf保存的位置,这样swf就转换成功了。