#Combining an image and an audio file into a single video
1 messages · Page 1 of 1 (latest)
Oh, I think you've got the wrong archive, ie. one with source code... one sec, let me see and tell you which archive you should download instead
Download ffmpeg-master-latest-win64-gpl-shared.zip from this link: https://github.com/BtbN/FFmpeg-Builds/releases
Once you've downloaded the archive, unpack it anywhere you want, like your desktop.
hi everyone so here is the code that Chat GPT gave me and worked and repeating the video 10 times I guess but when I download the output video, it turns out to be empty
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Video Looping Tool</title>
</head>
<body>
<video id="video" controls>
<source src="your_video.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
<br>
<button onclick="loopVideo()">Loop Video 10 Times</button>
<button id="download-btn" style="display:none">Download Looped Video</button>
<script>
function loopVideo() {
const video = document.getElementById("video");
const loopCount = 10;
let currentLoop = 1;
video.addEventListener("ended", function() {
if (currentLoop < loopCount) {
video.currentTime = 0;
video.play();
currentLoop++;
} else {
document.getElementById("download-btn").style.display = "block";
}
});
video.play();
}
document.getElementById("download-btn").addEventListener("click", function() {
const video = document.getElementById("video");
const blob = new Blob([video.src], { type: "video/mp4" });
const a = document.createElement("a");
a.style.display = "none";
document.body.appendChild(a);
a.href = URL.createObjectURL(blob);
a.download = "looped_video.mp4";
a.click();
});
</script>
</body>
</html>
note that the more I dive in this and the more I think I will never achieve this object with frontend only,
Backend comes back in many of Chat gpt messages
now I will have to go to sleep as my father is probably coming with shotg*n to kill me xD because i stayed so late so I'll chack your link by tomorrow @upper quartz
Your video variable in the loop function is a DOM element not the actual video. You're just playing the video not editing anything. I'm not sure you can edit a video in the browser like that.
Yeah, just had a look at the code myself, and it's definitely not what you're after
If you mean it won't let me combine an image and an audio to make a video, I know.
This code is to make the video output 10 times lengthier than the input
So what do you think, javascript will not achieve the goal of looping a video? Will I be needing backend?
So it's actually good news because it means that the problem why the output video was always 0 Mo was not a problem in my browser, just about code !
I'm pretty sure you're thinking about suggest nodeJS right?