# 工程文件图片路径替换

工程文件合成的时候不支持网络路径的图片,只支持网络路径的视频和音频,所以在合成带网络图片的工程的时候应该先把网络路径下载到本地,然后使用本地路径替换工程文件中的图片的网络路径。(注:只需替换工程文件的resource标签中的path属性)

替换前xml

<?xml version="1.0" encoding="UTF-8"?>
<timeline>
	<resources>
        <resource id="1" path="http://***.mp4" />
				<resource id="2" path="http://***.png" />
    		...
   </resources>
  ...
</timeline>

替换后xml

<?xml version="1.0" encoding="UTF-8"?>
<timeline>
	<resources>
        <resource id="1" path="http://***.mp4" />
				<resource id="2" path="/opt/***.png" />
    		...
   </resources>
  ...
</timeline>

#

# 直播云剪工程文件m3u8路径替换

对于合成直播云剪的工程,需要把xml中的直播资源m3u8先下载到本地路径,然后替换直播云剪工程成本地路径。(注:只需替换工程文件的resource标签中的path属性)

# 语音转写

如果需要语音识别,前端会通过接口传入需要识别的资源的裁剪入点和裁剪出点,应该先调用合成器生成音频,然后根据生成的音频进行语音识别,如果时候后的文本长度过长,还应该用分词器进行分词后返回给前端。

对于视频的语音识别的合成,合成的工程文件为:

<?xml version="1.0" encoding="UTF-8"?> 
<timeline resWidth="960" resHeight="540" duration="%s" videoSize="16:9" controlSpeed="1" trackCount="1" noCaptions="false" sizeLevel="0">
    <videoTracks> 
        <videoTrack index="0" volume="1" show="true">
            <videos>
                <video id="%s" index="0" type="1" path="%s" alphaM3u8Path="" alphaM3u8Url="" alphaPath="" inPoint="%s" outPoint="%s" trimIn="%s" trimOut="%s" orgDuration="%s" volume="1" speed="1" bgBlur="false" fadeInDuration="0" fadeOutDuration="0" extraRotation="0" reverse="false" noAudio="false" uuid="%s" title="%s" leftChannelUrl="" rightChannelUrl=""/>
            </videos>
        </videoTrack>
    </videoTracks>
</timeline>

对于音频的语音视频的合成,合成的工程文件为:

<?xml version="1.0" encoding="UTF-8"?>
<timeline resWidth="960" resHeight="540" duration="%s" videoSize="16:9" controlSpeed="1" trackCount="1" noCaptions="false" sizeLevel="0">
    <audioTracks>
        <audioTrack index="0" volume="1" show="true">
            <audios>
                <audio id="%s" index="0" type="1" path="%s" alphaM3u8Path="" alphaM3u8Url="" alphaPath="" inPoint="%s" outPoint="%s" trimIn="%s" trimOut="%s" orgDuration="%s" volume="1" speed="1" bgBlur="false" fadeInDuration="0" fadeOutDuration="0" extraRotation="0" reverse="false" noAudio="false" uuid="%s" title="%s" leftChannelUrl="" rightChannelUrl=""/>
            </audios>
        </audioTrack>
    </audioTracks>
</timeline>