【问题标题】:image to video conversion with transition effect具有过渡效果的图像到视频转换
【发布时间】:2012-10-30 11:34:27
【问题描述】:

我成功地将一系列图像转换为引用链接https://github.com/guardianproject/SSCVideoProto的视频。

但现在我的要求是随着每张图像的变化,在视频中添加一些淡入/淡出等过渡效果。

是否可以使用 FFMPEG 或者我应该使用其他东西?

参考 ffmpeg convert a series of images to video - with crossfade or any other transition between every two frames

了解更多详情。

请指导我。

【问题讨论】:

  • 我也在搜索图像到视频的转换。我已经查看并尝试了您在上面提供的示例。但它显示了相机的视频捕获过程。但无法将图像列表转换为视频..所以你能建议我转换它吗? .

标签: android video android-ndk ffmpeg transition


【解决方案1】:

res 文件夹中创建一个 anim 文件夹。在那里生成2个xml文件,分别命名为fadein和fadeout,内容如下。

fadein.xml

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/accelerate_interpolator"
    android:fromAlpha="0.0"
    android:toAlpha="1.0"
    android:duration="1000" />

fadeout.xml

<?xml version="1.0" encoding="utf-8"?>
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
    android:interpolator="@android:anim/decelerate_interpolator"
    android:zAdjustment="top"
    android:fromAlpha="1.0"
    android:toAlpha="0.0"
    android:duration="1000" />

然后打开你要在其中使用动画淡入和淡出的java文件,并将以下代码放入run方法中

public void run() {
                /* Create an intent that will start the main activity. */
                        Intent mainIntent = new Intent(javafile.this,
                        etcetc.class);
                        javafile.this.startActivity(mainIntent);


                /* Apply our splash exit (fade out) and main
                   entry (fade in) animation transitions. */
                overridePendingTransition(R.anim.fadein,
                        R.anim.fadeout);
        }

【讨论】:

  • 但是,我的要求不仅仅是播放带有过渡效果的图像文件。
  • 我还需要使用该过渡效果从给定的图像文件制作视频文件。
  • 我想,我们需要使用 NDK,不是吗?因此,我的要求与您的建议完全不同,因为我想将图像序列转换为视频文件,以后再使用该视频。希望,你现在明白了。
  • 好的@Varun,我仍然没有回答:(
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-18
  • 1970-01-01
  • 1970-01-01
  • 2014-03-18
  • 2018-02-23
  • 1970-01-01
相关资源
最近更新 更多