Adobe 连接视频:FLV 到 MP4(导出、转换)
Adobe connect video: FLV to MP4 (export, convert)
我想将下载的 zip 中 .flv
中的 adobe connect 视频转换为 .mp4
。我已经完成了 this question and answer 中解释的步骤,但是我在 .zip 中得到了 .flv
个这样组织的文件:
此外,我知道 ffmpeg 可以将视频和声音文件合并在一起,也可以直接从命令行连接生成的剪辑,这可能非常有用:https://www.labnol.org/internet/useful-ffmpeg-commands/28490/
我无法要求视频的所有者在 adobe connect 管理界面中将其作为 .mp4
提供。简而言之,我想在 VLC 中以 x2 速度收听这些视频(就像我在 YouTube 上收听随机数学 类 时所做的那样 - 我打开了 x2 速度)。以 x2 速度观看 adobe connect 视频所获得的时间是巨大的。
我想我不是唯一想这样做的人。论坛上有很多关于下载 adobe connect 视频的问题,但是 .flv
格式与一些 .xml
的混合通常是一个杀手,当主机没有使视频在 .mp4
中正确可用时.
处理 .flv
文件的顺序是一个难题。至少,我不会介意将聊天内容冲掉并留下一些类似的细节,这将有助于重建视频。任何使该过程自动化的脚本都会很有用。
在我这边,ffmpeg 可以很好地处理 cameraVoip__.xml 文件。
我写了这个 Python 脚本来将 Adobe Connect 记录导出为视频(代码库:https://github.com/Franck-Dernoncourt/adobe-connect-video-downloader):
'''
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"
The script assumes that the .zip files contains screenshare__.flv files, which contain the screen share.
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
#
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
你好
您应该只使用 flv 文件,而不是 xml 文件。
cameraVoip.xml 文件用于麦克风、摄像头视频和 screenshare.flv 用于共享屏幕(来自桌面)。
您还可以在indexstream.xml文件中获取这些文件的开始时间,这些文件嵌入在标签中,以毫秒为单位。
此外,如果您知道如何使用 ffmpeg 或其他软件,您可以下载这些文件,获取时间表,然后按顺序组合文件。
但是如果你不能而且只有声音和视频对你来说很重要,而不是文字,你可以使用我写的程序,最好看看我的github地址以获得更完整的解释程序。
不用说,Adobe Connect 文件可能因任何原因损坏,因此请确保它们安全,然后再使用 Adobe 文件。
我想将下载的 zip 中 .flv
中的 adobe connect 视频转换为 .mp4
。我已经完成了 this question and answer 中解释的步骤,但是我在 .zip 中得到了 .flv
个这样组织的文件:
此外,我知道 ffmpeg 可以将视频和声音文件合并在一起,也可以直接从命令行连接生成的剪辑,这可能非常有用:https://www.labnol.org/internet/useful-ffmpeg-commands/28490/
我无法要求视频的所有者在 adobe connect 管理界面中将其作为 .mp4
提供。简而言之,我想在 VLC 中以 x2 速度收听这些视频(就像我在 YouTube 上收听随机数学 类 时所做的那样 - 我打开了 x2 速度)。以 x2 速度观看 adobe connect 视频所获得的时间是巨大的。
我想我不是唯一想这样做的人。论坛上有很多关于下载 adobe connect 视频的问题,但是 .flv
格式与一些 .xml
的混合通常是一个杀手,当主机没有使视频在 .mp4
中正确可用时.
处理 .flv
文件的顺序是一个难题。至少,我不会介意将聊天内容冲掉并留下一些类似的细节,这将有助于重建视频。任何使该过程自动化的脚本都会很有用。
在我这边,ffmpeg 可以很好地处理 cameraVoip__.xml 文件。
我写了这个 Python 脚本来将 Adobe Connect 记录导出为视频(代码库:https://github.com/Franck-Dernoncourt/adobe-connect-video-downloader):
'''
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"
The script assumes that the .zip files contains screenshare__.flv files, which contain the screen share.
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
#
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
你好
您应该只使用 flv 文件,而不是 xml 文件。
cameraVoip.xml 文件用于麦克风、摄像头视频和 screenshare.flv 用于共享屏幕(来自桌面)。
您还可以在indexstream.xml文件中获取这些文件的开始时间,这些文件嵌入在标签中,以毫秒为单位。
此外,如果您知道如何使用 ffmpeg 或其他软件,您可以下载这些文件,获取时间表,然后按顺序组合文件。
但是如果你不能而且只有声音和视频对你来说很重要,而不是文字,你可以使用我写的程序,最好看看我的github地址以获得更完整的解释程序。
不用说,Adobe Connect 文件可能因任何原因损坏,因此请确保它们安全,然后再使用 Adobe 文件。