如何将Adobe Connect录制导出为视频?
我有到录制会议的链接,如何从中导出视频?在Connect Central的录制列表中,有一个“制作脱机”链接。这将在本地计算机上创建录制的FLV。不幸的是,创建此视频所需的时间与播放录制所需的时间相同。遵循应用程序提供的指导以获得最佳质量 然后,您可以将FLV转换为您喜欢的格式 您必须是已录制会议的主持人,或者已将录制内容移动到内容库中如何将Adobe Connect录制导出为视频?,adobe,video-streaming,video-capture,conference,Adobe,Video Streaming,Video Capture,Conference,我有到录制会议的链接,如何从中导出视频?在Connect Central的录制列表中,有一个“制作脱机”链接。这将在本地计算机上创建录制的FLV。不幸的是,创建此视频所需的时间与播放录制所需的时间相同。遵循应用程序提供的指导以获得最佳质量 然后,您可以将FLV转换为您喜欢的格式 您必须是已录制会议的主持人,或者已将录制内容移动到内容库中 登录您的Adobe Connect帐户 单击会议>我的会议 单击录制的链接 单击“录制”链接(屏幕右侧) 单击“名称”列中的链接 复制“用于查看的URL”-例如
output/filename.zip?download=zip
我编写此Python脚本是为了将Adobe Connect录制导出为视频:
'''
Requirements:
- python 2.7 or 3
- wget, unzip, and ffmpeg accessible from command line.
Examples:
python connect2vid_v2.py https://my.adobeconnect.com/pqc06mcawjgn/ --output_filename=" Understanding how the Network impacts your service"
Please email Franck Dernoncourt <franck.dernoncourt@gmail.com> if you improve this code.
'''
import shlex
import subprocess
import os
import glob
import argparse
import sys
import re
def run_command(command):
print('running command: {0}'.format(command))
process = subprocess.Popen(shlex.split(command), stdout=subprocess.PIPE)
while True:
output = process.stdout.readline()
print(output.strip())
if output == b'' and process.poll() is not None:
print('Done running the command.')
break
if output:
print(output.strip())
rc = process.poll()
return rc
def create_folder_if_not_exists(directory):
'''
Create the folder if it doesn't exist already.
'''
if not os.path.exists(directory):
os.makedirs(directory)
def extract_connect_id(parser, args):
'''
Function written by Aaron Hertzmann
'''
# ----- extract the connectID or ZIP file -----
if len(args.URLorIDorZIP) < 1:
# print('Error: No Connect recording URL provided.')
parser.print_help()
sys.exit(0)
if args.URLorIDorZIP[0][-4:].lower() == '.zip':
sourceZIP = args.URLorIDorZIP[0]
connectID = os.path.basename(sourceZIP[:-4])
elif len(args.URLorIDorZIP[0]) == 12:
connectID = args.URLorIDorZIP[0]
else:
s = args.URLorIDorZIP[0].split('/')
connectID = None
for i in range(len(s)-1):
if 'adobeconnect.com' in s[i]:
connectID = s[i+1]
break
if connectID == None:
print("Error: couldn't parse URL")
sys.exit(1)
return connectID
def main():
'''
This is the main function
'''
# ================ parse the arguments (part of the parsing code was written by Aaron Hertzmann) ======================
parser = argparse.ArgumentParser(description='Download an Adobe Connect recording and convert to a video file.')
parser.add_argument('URLorIDorZIP', nargs='*', help='URL, code, or ZIP file for the Connect recording')
parser.add_argument('--output_folder',default='output_videos',help='Folder for output files')
parser.add_argument('--output_filename',default='noname', help='output_filename')
args = parser.parse_args()
#main_output_folder = "all_videos"
main_output_folder = args.output_folder
output_filename = args.output_filename
output_filename = re.sub(r'[^\w\s]','', output_filename)
output_filename = output_filename.replace('@', '').strip()
print('output_filename: {0}'.format(output_filename))
connect_id = 'pul1pgdvpr87'
connect_id = 'p6vwxp2d0c2f'
connect_id = extract_connect_id(parser, args)
video_filename = 'hello'
video_filename = output_filename
# ================ Download video ======================
output_folder = connect_id
output_zip_filename = '{0}.zip'.format(connect_id)
create_folder_if_not_exists(output_folder)
create_folder_if_not_exists(main_output_folder)
# Step 1: retrieve audio and video files
connect_zip_url = 'https://my.adobeconnect.com/{0}/output/{0}.zip?download=zip'.format(connect_id)
wget_command = 'wget -nc -O {1} {0}'.format(connect_zip_url, output_zip_filename) # -nc, --no-clobber: skip downloads that would download to existing files.
run_command(wget_command)
unzip_command = 'unzip -n {0} -d {1}'.format(output_zip_filename, output_folder) # -n: Unzip only newer files.
run_command(unzip_command)
# Step 2: create final video output
cameraVoip_filepaths = []
for filepaths in sorted(glob.glob(os.path.join(output_folder, 'cameraVoip_*.flv'))):
cameraVoip_filepaths.append(filepaths)
print('cameraVoip_filepaths: {0}'.format(cameraVoip_filepaths))
screenshare_filepaths = []
for filepaths in sorted(glob.glob(os.path.join(output_folder, 'screenshare_*.flv'))):
screenshare_filepaths.append(filepaths)
part = 0
output_filepaths = []
for cameraVoip_filepath, screenshare_filepath in zip(cameraVoip_filepaths, screenshare_filepaths):
output_filepath = os.path.join(main_output_folder, '{0}_{1:04d}.flv'.format(video_filename, part))
#output_filepath = '{0}_{1:04d}.flv'.format(video_filename, part)
output_filepaths.append(output_filepath)
# ffmpeg command from Oliver Wang / Yannick Hold-Geoffroy / Aaron Hertzmann
conversion_command = 'ffmpeg -i "%s" -i "%s" -c copy -map 0:a:0 -map 1:v:0 -shortest -y "%s"'%(cameraVoip_filepath, screenshare_filepath, output_filepath)
# -y: override output file if exists
run_command(conversion_command)
part += 1
# Concatenate all videos into one single video
# https://stackoverflow.com/questions/7333232/how-to-concatenate-two-mp4-files-using-ffmpeg
video_list_filename = 'video_list.txt'
video_list_file = open(video_list_filename, 'w')
for output_filepath in output_filepaths:
video_list_file.write("file '{0}'\n".format(output_filepath))
video_list_file.close()
final_output_filepath = '{0}.flv'.format(video_filename)
# ffmpeg command from Oliver Wang / Yannick Hold-Geoffroy / Aaron Hertzmann
conversion_command = 'ffmpeg -safe 0 -y -f concat -i "{1}" -c copy "{0}"'.format(final_output_filepath, video_list_filename)
run_command(conversion_command)
#os.remove(video_list_filename)
if __name__ == "__main__":
main()
#cProfile.run('main()') # if you want to do some profiling
- xml包含音频+网络摄像头(如果有)
- screenshare_u;.xml包含音频+网络摄像头(如果有)
ffmpeg
(我使用了Oliver Wang/Yannick Hold Geoffroy/Aaron Hertzmann提供的ffmpeg
命令):
其中:
:映射仅用于音频的第一个输入文件-映射0:a:0
:映射仅用于视频的第二个输入文件-映射1:v:0
:如果cameraVoip_1_11.flv和screenshare_2_10.flv的长度不相同,请剪切音频或视频-最短的
ffmpeg -i cameraVoip_1_11.flv -i screenshare_2_10.flv \
-filter_complex \
"color=s=1072x480:c=black [base]; [0:v] setpts=PTS-STARTPTS, scale=640x480 [upperleft]; [1:v] setpts=PTS-STARTPTS, scale=432x240 [upperright]; [base][upperleft] overlay=shortest=1 [tmp1]; [tmp1][upperright] overlay=shortest=1:x=640" \
-c:v libx264 -c:a mp2 output.mkv
关于将cameraVoip__;.xml映射到正确的屏幕共享____;.xml,如果存在多个: 可以查看cameraVoip__;.xml/screenshare___;.xml以获取音频/屏幕共享视频开始的时间戳。这允许使用正确的cameraVoip__;.xml映射screenshare__;.xml 例如,在cameraVoip_1_11.xml的第21行:
<String><![CDATA[Thu Feb 07 21:11:23 2019]]></String>
否则,另一种方法可能是对cameraVoip__;.xml/screenshare___;.xml进行排序,然后将第一个cameraVoip___;.xml与第一个screenshare____;.xml映射,第二个cameraVoip______;.xml与第一个screenshare(对于我看过的几段AdobeConnect录音似乎还可以,但可能是因为人们总是共享屏幕)。1.将下载的录音解压缩到目录2.下载并安装“FLV编辑器Lite”3.导入>FLV并选择您提取的“screenshare…FLV”文件。4.导入>FLV并选择“audio…FLV”文件(或您提取的“voip…flv”)。5.将屏幕共享项目拖到时间线的“视频”区域6.将音频或voip项目拖到时间线的“音频”区域7.选择导出>flv并为文件命名。您的链接不可访问,您是否有指向flv编辑器Lite的其他链接?flv编辑器Lite的网站“现在已经不存在了,还有其他应用程序可以这样做吗?
ffmpeg -i cameraVoip_1_11.flv -i screenshare_2_10.flv \
-filter_complex \
"color=s=1072x480:c=black [base]; [0:v] setpts=PTS-STARTPTS, scale=640x480 [upperleft]; [1:v] setpts=PTS-STARTPTS, scale=432x240 [upperright]; [base][upperleft] overlay=shortest=1 [tmp1]; [tmp1][upperright] overlay=shortest=1:x=640" \
-c:v libx264 -c:a mp2 output.mkv
<String><![CDATA[Thu Feb 07 21:11:23 2019]]></String>