无差别视频提取工具

KuaiKan 2024-4-4 378

无差别视频提取工具

特别说明

  • 在代码操作过程中,页面白屏是正常的,按照步骤继续执行即可。
  • 如果不行,安装使用说明,多试几遍就可以了。可能是视频广告导致。
  • 注意 Chrome 的多文件下载询问,如果拒绝过,需要重新打开。
  • 视频捕获,分为「视频」文件与「音频」文件,「视频」文件是纯视频,没声音的。需要搭配「音频」文件播放。点击这里,使用专属播放器。

合并音频与视频文件

下载完成之后,会得到两个文件,需要使用 ffmpeg(官网下载页面) 来合并::

ffmpeg -i video.mp4 -i audio.mp4 -c:v copy -c:a aac -strict experimental output.mp4

$ ffmpeg -i input.m4a -i input.webm -c copy output.mp4

关于合并两条流,OP 的命令似乎有不可预知的问题。chatGPT 给出了方案,流直接复制,无需再编码:

ffmpeg -i videoA.mp4 -i videoB.mp4 -map 0:v -map 1:a -c:v copy -c:a copy videoC.mp4

-i videoA.mp4 和 -i videoB.mp4 表示读取视频 A 和视频 B 的源文件。

-map 0:v 和 -map 1:a 分别表示选择视频 A 的画面和视频 B 的声音。

-c:v copy 和 -c:a copy 表示复制视频 A 的画面和视频 B 的声音。

最后,videoC.mp4 表示合并后的新视频的输出文件。

ffmpeg -i G:\视频\1.mp4 -i G:\视频\2.mp4 -map 0:v -map 1:a -c:v copy -c:a copy G:\视频\videoC.mp4

要使用ffmpeg在不改变编码的情况下合并mp4和m4a文件,可以使用以下命令:

```

ffmpeg -i input.mp4 -i input.m4a -c copy output.mp4

```

其中,

`-i input.mp4`指定输入的mp4文件,

`-i input.m4a`指定输入的m4a文件,

`-c copy`表示保持原始编码不变,

`output.mp4`是输出的文件名。

这个命令会将两个文件合并为一个mp4文件,并保持原始编码不变。如果需要调整输出文件的分辨率、比特率等参数,可以在命令中添加相应的选项。例如,要将输出文件的分辨率调整为720p,可以使用以下命令:

```

ffmpeg -i input.mp4 -i input.m4a -c copy -s 1280x720 output.mp4

```

其中,`-s 1280x720`表示将输出文件的分辨率设置为1280x720。

改的脚本:

// ==UserScript==
// @name 大兄弟
// @namespace http://tampermonkey.net/
// @version 1.0
// @description
// @author 大兄弟
// @match https://*/post/details?pid=*

// @grant GM_setClipboard
// ==/UserScript==

(function() {
'use strict';

function isMobileDevice() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}

function getPidFromUrl() {
var url = window.location.href;
var regex = /[?&]pid=(\d+)/;
var matches = regex.exec(url);
if (matches && matches.length > 1) {
return matches[1];
}
return null;
}

function sendApiRequest(pid) {
var apiUrl = 'http://www.djyun.icu/api/hjjx?id=' + pid;
fetch(apiUrl)
.then(response => response.text())
.then(data => {
GM_setClipboard(data);
showNotification('数据:' + data + '\n已复制');
})
.catch(error => {
console.error('请求失败:', error);
showNotification('请求失败,请重试!');
});
}

function showNotification(message) {
var notification = document.createElement('div');
notification.style.position = 'fixed';
notification.style.bottom = '40px';
notification.style.right = '20px';
notification.style.width = '240px';
notification.style.padding = '16px';
notification.style.background = 'rgba(0, 0, 0, 0.8)';
notification.style.color = 'white';
notification.style.borderRadius = '8px';
notification.style.textAlign = 'center';
notification.style.lineHeight = '20px';
notification.style.fontFamily = 'Arial, sans-serif';
notification.style.fontSize = '14px';
notification.style.boxShadow = '0px 2px 4px rgba(0, 0, 0, 0.3)';
notification.innerText = message;
document.body.appendChild(notification);

setTimeout(function() {
notification.style.opacity = '0';
setTimeout(function() {
notification.remove();
}, 500);
}, 3000);
}

function addFloatingButton() {
var button = document.createElement('div');
button.style.position = 'fixed';
button.style.bottom = '50px';
button.style.right = '20px';
button.style.width = '60px';
button.style.height = '60px';
button.style.background = '#FF6161';
button.style.color = 'white';
button.style.borderRadius = '50%';
button.style.textAlign = 'center';
button.style.lineHeight = '60px';
button.style.cursor = 'pointer';
button.style.fontFamily = 'Arial, sans-serif';
button.style.fontSize = '16px';
button.style.fontWeight = 'bold';
button.style.boxShadow = '0px 2px 4px rgba(0, 0, 0, 0.3)';
button.innerText = '复制';
button.addEventListener('click', function() {
var pid = getPidFromUrl();
if (pid) {
sendApiRequest(pid);
} else {
showNotification('无法获取pid');
}
});
document.body.appendChild(button);
}

if (isMobileDevice()) {
addFloatingButton();
}
})();


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回