脑壳痛ai视频长篇到底怎么拼接有没有高手
- 内容介绍
- 文章标签
- 相关推荐
怎么拼接两端视频,两段超长的是grok的延长做出了的但是最长只能30秒
imagine-public.x.ai/imagine-public/share-videos/39b9dda3-20e7-4fc9-ab2a-b82c4a1dd831.mp4
imagine-public.x.ai/imagine-public/share-videos/c4196b18-af0d-4133-ae04-3e4bc572b28f.mp4
有没有佬指导一下怎么拼接
网友解答:--【壹】--:
你确定你用的是可灵?发出来看看
--【贰】--:
首先你AI生成的视频片段开头结尾你别卡在说话气口上。
你想象一下你如果是导演在演员还是说台词的时候说“卡”,会是啥样的情景。最好是再抽卡。
如果片段实在觉得很不错的情况下必须要用这段,可灵就是你唯一的选择,首尾帧目前最强,即梦首尾帧会改有修改。
比如你把第一段视频两个人不说话的地方截断,用那个地方为首帧,说出来那句你要的台词,和后面的拼接一下就行了。
grok做点创意类的短片还行,长篇还是只能即梦和可灵。
--【叁】--:
seedance可以.
image476×145 11.9 KB
加果
--【肆】--:
ffmpeg
--【伍】--:
花了300可灵积分帮你看了下
你的第一个视频尾帧
11280×720 113 KB
第二个视频首帧
21280×720 105 KB
你可以看到整体背景的不一致(右侧黑柱子)做首尾帧的时候导致大模型懵逼了。
因为首帧和尾帧的背景顺序在AI看来是倒着的。效果就是俩人会往后倒着走。
https://streamable.com/863in1
背景过渡平滑的话就要在第一个视频的某一帧找到与第二个视频第一帧相同背景的地方,
找到之后就可以“稍显平滑”的过渡了(毕竟不知道你剧情是啥。你当个示例吧)。
V1
https://streamable.com/t2e7a2
V2
https://streamable.com/jj7z6r
啊你想看即梦效果?
还在排队。。。
--【陆】--:
用的可灵吗
--【柒】--:
提取片段一尾帧,片段二首帧去可灵做个首尾帧
剪映分离音频把中间对话补全再缝回去
--【捌】--:
自动拼接?
--【玖】--:
谢谢佬,不过感觉还是有停顿,不流畅,可能剧情也有问题,不过可灵这个确实有点东西,grok,即梦2.0fast,我测试过如果用这个图片会变,就是不是从你这个首帧开始运动,不知道为啥给你各种方面都动了
--【拾】--:
我用的是grok不行,这玩意只能可灵?
--【拾壹】--:
保持不动就告诉他严格不动,omni3想象力会很丰富会自作主张,视频3.0会很严格。即梦出来效果就是画面会变大更烦
--【拾贰】--:
没用试过了,首尾帧出来的视频,首帧人物位置等等什么都发生变化了
--【拾叁】--:
一看就是高手
````import os
import sys
import subprocess
from tkinter import Tk, filedialog
from tkinter.messagebox import showinfo, showerror
def select_video_file():
"""弹出文件选择对话框,选择视频文件"""
root = Tk()
root.withdraw() # 隐藏主窗口
file_path = filedialog.askopenfilename(
title="filename",
filetypes=[
("视频文件", "*.mp4 *.mov *.avi *.mkv *.wmv *.flv *.mpeg *.mpg"),
("所有文件", "*.*")
]
)
root.destroy()
return file_path
def get_ffmpeg_path():
"""获取与脚本同目录的 ffmpeg.exe 路径"""
if getattr(sys, 'frozen', False):
# 如果是打包后的 exe
script_dir = os.path.dirname(sys.executable)
else:
script_dir = os.path.dirname(os.path.abspath(__file__))
ffmpeg_exe = os.path.join(script_dir, "ffmpeg.exe")
if not os.path.exists(ffmpeg_exe):
raise FileNotFoundError(f"在脚本目录未找到 ffmpeg.exe!\n路径: {ffmpeg_exe}")
return ffmpeg_exe
def extract_last_frame(video_path, ffmpeg_exe):
"""fff"""
if not video_path:
return False
# 输出文件路径:原视频同目录,文件名加 _lastframe.jpg
dir_name = os.path.dirname(video_path)
base_name = os.path.splitext(os.path.basename(video_path))[0]
output_path = os.path.join(dir_name, f"{base_name}_lastframe.jpg")
# 格式)
cmd = [
ffmpeg_exe,
"-sseof", "-3", #
"-i", video_path,
"-vsync", "0", # 帧率
"-update", "true", # 帧
"-q:v", "2", # 图片质量(2 为较高质量,范围 2-31)
"-y", # 自动覆盖已存在的输出文件
output_path
]
try:
print("pill last frame...")
result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
if result.returncode == 0 and os.path.exists(output_path):
showinfo("成功", f"ok sace as为:\n{output_path}")
print(f"✅ 成功!文件保存至:{output_path}")
return True
else:
error_msg = result.stderr if result.stderr else result.stdout
showerror("失败", f"提取失败!\n{error_msg}")
print("❌ ffmpeg 输出:", error_msg)
return False
except subprocess.TimeoutExpired:
showerror("超时", "提取操作超时(30秒)")
return False
except Exception as e:
showerror("错误", f"发生异常:{str(e)}")
return False
if __name__ == "__main__":
try:
ffmpeg_path = get_ffmpeg_path()
print(f"找到 ffmpeg.exe:{ffmpeg_path}")
video_file = select_video_file()
if video_file:
print(f"已选择视频:{video_file}")
extract_last_frame(video_file, ffmpeg_path)
else:
print("用户取消了选择")
except FileNotFoundError as e:
showerror("错误", str(e))
except Exception as e:
showerror("未知错误", str(e))
`
--【拾肆】--:
想流畅就重拍。没必要纠结这俩片段啊。我这给你过渡都抽了10个了。
--【拾伍】--:
抽帧啊。
怎么拼接两端视频,两段超长的是grok的延长做出了的但是最长只能30秒
imagine-public.x.ai/imagine-public/share-videos/39b9dda3-20e7-4fc9-ab2a-b82c4a1dd831.mp4
imagine-public.x.ai/imagine-public/share-videos/c4196b18-af0d-4133-ae04-3e4bc572b28f.mp4
有没有佬指导一下怎么拼接
网友解答:--【壹】--:
你确定你用的是可灵?发出来看看
--【贰】--:
首先你AI生成的视频片段开头结尾你别卡在说话气口上。
你想象一下你如果是导演在演员还是说台词的时候说“卡”,会是啥样的情景。最好是再抽卡。
如果片段实在觉得很不错的情况下必须要用这段,可灵就是你唯一的选择,首尾帧目前最强,即梦首尾帧会改有修改。
比如你把第一段视频两个人不说话的地方截断,用那个地方为首帧,说出来那句你要的台词,和后面的拼接一下就行了。
grok做点创意类的短片还行,长篇还是只能即梦和可灵。
--【叁】--:
seedance可以.
image476×145 11.9 KB
加果
--【肆】--:
ffmpeg
--【伍】--:
花了300可灵积分帮你看了下
你的第一个视频尾帧
11280×720 113 KB
第二个视频首帧
21280×720 105 KB
你可以看到整体背景的不一致(右侧黑柱子)做首尾帧的时候导致大模型懵逼了。
因为首帧和尾帧的背景顺序在AI看来是倒着的。效果就是俩人会往后倒着走。
https://streamable.com/863in1
背景过渡平滑的话就要在第一个视频的某一帧找到与第二个视频第一帧相同背景的地方,
找到之后就可以“稍显平滑”的过渡了(毕竟不知道你剧情是啥。你当个示例吧)。
V1
https://streamable.com/t2e7a2
V2
https://streamable.com/jj7z6r
啊你想看即梦效果?
还在排队。。。
--【陆】--:
用的可灵吗
--【柒】--:
提取片段一尾帧,片段二首帧去可灵做个首尾帧
剪映分离音频把中间对话补全再缝回去
--【捌】--:
自动拼接?
--【玖】--:
谢谢佬,不过感觉还是有停顿,不流畅,可能剧情也有问题,不过可灵这个确实有点东西,grok,即梦2.0fast,我测试过如果用这个图片会变,就是不是从你这个首帧开始运动,不知道为啥给你各种方面都动了
--【拾】--:
我用的是grok不行,这玩意只能可灵?
--【拾壹】--:
保持不动就告诉他严格不动,omni3想象力会很丰富会自作主张,视频3.0会很严格。即梦出来效果就是画面会变大更烦
--【拾贰】--:
没用试过了,首尾帧出来的视频,首帧人物位置等等什么都发生变化了
--【拾叁】--:
一看就是高手
````import os
import sys
import subprocess
from tkinter import Tk, filedialog
from tkinter.messagebox import showinfo, showerror
def select_video_file():
"""弹出文件选择对话框,选择视频文件"""
root = Tk()
root.withdraw() # 隐藏主窗口
file_path = filedialog.askopenfilename(
title="filename",
filetypes=[
("视频文件", "*.mp4 *.mov *.avi *.mkv *.wmv *.flv *.mpeg *.mpg"),
("所有文件", "*.*")
]
)
root.destroy()
return file_path
def get_ffmpeg_path():
"""获取与脚本同目录的 ffmpeg.exe 路径"""
if getattr(sys, 'frozen', False):
# 如果是打包后的 exe
script_dir = os.path.dirname(sys.executable)
else:
script_dir = os.path.dirname(os.path.abspath(__file__))
ffmpeg_exe = os.path.join(script_dir, "ffmpeg.exe")
if not os.path.exists(ffmpeg_exe):
raise FileNotFoundError(f"在脚本目录未找到 ffmpeg.exe!\n路径: {ffmpeg_exe}")
return ffmpeg_exe
def extract_last_frame(video_path, ffmpeg_exe):
"""fff"""
if not video_path:
return False
# 输出文件路径:原视频同目录,文件名加 _lastframe.jpg
dir_name = os.path.dirname(video_path)
base_name = os.path.splitext(os.path.basename(video_path))[0]
output_path = os.path.join(dir_name, f"{base_name}_lastframe.jpg")
# 格式)
cmd = [
ffmpeg_exe,
"-sseof", "-3", #
"-i", video_path,
"-vsync", "0", # 帧率
"-update", "true", # 帧
"-q:v", "2", # 图片质量(2 为较高质量,范围 2-31)
"-y", # 自动覆盖已存在的输出文件
output_path
]
try:
print("pill last frame...")
result = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
if result.returncode == 0 and os.path.exists(output_path):
showinfo("成功", f"ok sace as为:\n{output_path}")
print(f"✅ 成功!文件保存至:{output_path}")
return True
else:
error_msg = result.stderr if result.stderr else result.stdout
showerror("失败", f"提取失败!\n{error_msg}")
print("❌ ffmpeg 输出:", error_msg)
return False
except subprocess.TimeoutExpired:
showerror("超时", "提取操作超时(30秒)")
return False
except Exception as e:
showerror("错误", f"发生异常:{str(e)}")
return False
if __name__ == "__main__":
try:
ffmpeg_path = get_ffmpeg_path()
print(f"找到 ffmpeg.exe:{ffmpeg_path}")
video_file = select_video_file()
if video_file:
print(f"已选择视频:{video_file}")
extract_last_frame(video_file, ffmpeg_path)
else:
print("用户取消了选择")
except FileNotFoundError as e:
showerror("错误", str(e))
except Exception as e:
showerror("未知错误", str(e))
`
--【拾肆】--:
想流畅就重拍。没必要纠结这俩片段啊。我这给你过渡都抽了10个了。
--【拾伍】--:
抽帧啊。

