加载视频文件并选择单个帧

发布于 2024-09-26 08:39:17 字数 516 浏览 0 评论 0原文

我们正在开发一个应用程序来获取各种格式的视频文件,对文件进行一些简单的编辑,并将它们输出为特定的格式。

我可以通过 FFMPEG 处理除编辑部分之外的所有内容,因为编辑需要用户指定某些内容。我需要用户指定需要修剪的任何帧范围(仅从开始或结束,而不是中间)、淡入或淡出的开始/结束帧编号以及覆盖文本。

我已经见过 Splicer 和 Directshow.NET 包装器,但我不确定是否值得花时间将所有编辑引入我们的应用程序中,而不仅仅是使用 avisynth/ffmpeg/mencoder 在用户之后执行实际编辑设置上述所有内容。

我真正需要的是一个控件或包装器,这样我就可以创建一个控件来播放/暂停视频、在帧之间移动,并让我抓取视频的特定帧号。我可以从中生成 AVS 文件来完成剩下的工作。如果它能在某种程度上使用 DirectShow,这样机器上安装的任何编解码器都可用,那就太好了,因为视频可能是 WMV、FLV、Divx、MP4 等格式,而且我们需要支持所有格式那些。

任何想法或建议都会被考虑,但我们将寻求最快的实现(代码编写,而不是执行)。

We are developing an app to take video files in various formats, perform some simple editing to the files, and output them to a specific format.

I can handle everything except for the editing part through FFMPEG, as the editing requires a user to specify certain things. I need a user to specific any frame ranges that need to be trimmed (only from the beginning or end, never the middle), start/end frame numbers for fading in or out, and overlay text.

I've seen both Splicer and the Directshow.NET wrappers, but I'm not sure it's worth the time to bring all of the editing into our app, and not just use avisynth/ffmpeg/mencoder to perform the actual editing after the user sets all of the above things.

All I really need is a control or wrapper so I can create a control that will play/pause a video, move between frames, and let me grab that specific frame number of the video. I can generate AVS files from that to do the rest. It'd be nice if it would use DirectShow at some level so that any codecs installed on the machine will be available, as the videos could be in WMV, FLV, Divx, MP4, etc. to begin with and we need to support all of those.

Any ideas or suggestions will be considered, but we are going for the fastest (code writing, not execution) implementation.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

绮烟 2024-10-03 08:39:17

我们最终做了什么:

我们使用 Windows Media Player ActiveX 控件让用户选择视频中的点来设置淡入淡出和修剪。然后,我们从中生成 Avisynth 脚本,并通过 mencoder 运行它以获得最终视频。

我们决定使用 WMP 控件中的 double 属性来指定剪辑播放中的 currentPosition。这对于我们需要从剪辑的每秒帧数和 currentPosition 生成帧数以在 AviSynth 脚本中使用来说足够精确。

What we ended up doing:

We used the Windows Media Player ActiveX control to let the user select points in the video to set for the fades and trimming. We then generate an Avisynth script from that and run it through mencoder to get the final video.

We settled on using the double property from the WMP control that specifies the currentPosition in the clip playing. This was precise enough for our needs to generate a frame number from the clip's frames per seconds and currentPosition to use in the AviSynth script.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文