我有一系列具有透明度的PNG文件 - 我想在屏幕上混合它们在视频之上
ffmpeg -i video.mp4 -i "Images/%03d.png" -filter_complex "blend=all_mode='screen':all_opacity=0.7" output.mp4
Run Code Online (Sandbox Code Playgroud)
图像确实合并在视频的顶部,但带有粉红色的叠加层?
我还尝试添加"-vcodec png"和"-vcodec libx264"并尝试.mov视频,但得到了相同的结果.
ffmpeg version N-58061-g5231eec Copyright (c) 2000-2013 the FFmpeg developers
built on Nov 14 2013 05:35:15 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-
static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static'
--extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-
ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-
cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-
libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --
enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --
enable-libvpx
libavutil 52. 52.100 / 52. 52.100
libavcodec 55. …Run Code Online (Sandbox Code Playgroud) 在PHP中我有以下功能:
base64_encode(hash_hmac('sha256', $data, $secret, false));
Run Code Online (Sandbox Code Playgroud)
我正在尝试在Java中创建一个函数,它将为相同的"数据"和"秘密"参数提供相同的结果.
我试着使用这个功能:
public static String base64sha256(String data, String secret) {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(secret.getBytes(), "HmacSHA256");
sha256_HMAC.init(secret_key);
byte[] res = sha256_HMAC.doFinal(data.getBytes());
return Base64.encodeToString(res, Base64.NO_WRAP);
}
Run Code Online (Sandbox Code Playgroud)
但是我得到了相同输入的不同结果
更新:此功能有效.请享用.
public static String base64sha256(String data, String secret) {
String hash = null;
try {
Mac sha256_HMAC = Mac.getInstance("HmacSHA256");
SecretKeySpec secret_key = new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256");
sha256_HMAC.init(secret_key);
byte[] res = sha256_HMAC.doFinal(data.getBytes("UTF-8"));
hash = getHex(res);
hash = Base64.encodeToString(hash.getBytes("UTF-8"), Base64.NO_WRAP);
} catch (Exception e){}
return hash;
}
static …Run Code Online (Sandbox Code Playgroud) 在相机模式(AVCaptureVideoPreviewLayer)下,我成功捕获了照片。我想向用户表明这一事实 - 意思是向他展示突然的黑色闪光和咔哒声 - 类似于他自己拍照时的体验。
我怎么做?是否有一些内置功能可以做到这一点?
谢谢