
Recherche avancée
Autres articles (83)
-
(Dés)Activation de fonctionnalités (plugins)
18 février 2011, parPour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Activation de l’inscription des visiteurs
12 avril 2011, parIl est également possible d’activer l’inscription des visiteurs ce qui permettra à tout un chacun d’ouvrir soit même un compte sur le canal en question dans le cadre de projets ouverts par exemple.
Pour ce faire, il suffit d’aller dans l’espace de configuration du site en choisissant le sous menus "Gestion des utilisateurs". Le premier formulaire visible correspond à cette fonctionnalité.
Par défaut, MediaSPIP a créé lors de son initialisation un élément de menu dans le menu du haut de la page menant (...)
Sur d’autres sites (11568)
-
creating video from list of images using python and ffmpeg
13 août 2019, par haseebsummary
from given code, second function taking UI values and passing to first one. from log, first two lines shows command list and command string.
whats irritating me is, if i copied second line from log(dos cmd) and paste it in a cmd prompt, it works successfully and produces video correctly. but running it via gui subprocess, errors out.
TASK DESCRIPTION
directory contains thousand of images each after few minutes of a contruction project. i need to create a video from data (images) per day basis.
i have successfully extracted list of images etc and have datadef framesToVideoViaCount(srcFile,outputFile,start,count,rate):
# ffmpeg -start_number 1 -i test_%04d.png -vframes 100 -vcodec mpeg4 test.mp4
# "C:\\Users\\lalat\\Desktop\\03008427633\\output_%04d.png"
# ffmpeg -start_number 50 -i "C:\\Users\\lalat\\Desktop\\03008427633\\output_%04d.png" -vframes 200 -vcodec mpeg4 "C:\\Users\\lalat\\Desktop\\day1.mp4"
command = [ 'ffmpeg',
# '-loglevel', 'fatal',
'-r %d' %(rate),
'-start_number %d' %(start) ,
'-i "%s"' %(srcFile),
'-vframes %d' %(count),
'-vcodec mpeg4' ]
# command.append ('fps=%d' % (fps))
command.append (outputFile)
print ("COMMAND: " , command)
print ("DOS CMD: ", ' '.join(command))
ffmpeg = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE )
out, err = ffmpeg.communicate()
if(err) : print('error',err); return None;
print (out)Actual GUI function call
def approachByCount(self):
tdate = datetime(year=int(self.fyear.get()), month=int(self.fmonth.get()), day=int(self.fdate.get()))
# now = datetime.datetime.now()
outputName = str(tdate.strftime("%Y%m%d")) + ".txt"
outputVid = str(tdate.strftime("%Y%m%d")) + ".mp4"
files = os.listdir(self.userDir)
selected = []
for afile in files:
afile = os.path.join(self.userDir,afile)
sdate = datetime.fromtimestamp(os.path.getmtime(afile))
if sdate.date() == tdate.date():
selected.append(afile)
# get first file name
srcfilename = os.path.basename(selected[0])
srcfilename,ext = srcfilename.split(".")
filename,pad = srcfilename.split("_")
srcfilename = os.path.join(self.userDir,filename+"_%0"+str(len(pad))+"d."+ext)
start = int(pad)
count = len(selected)
utils.framesToVideoViaCount(srcfilename,outputVid,start,count,25)ERROR log
COMMAND : [’ffmpeg’, ’-r 25’, ’-start_number 1’, ’-i "C :\Users\lalat\Desktop\03008427633\output_%04d.png"’, ’-vframes 382’, ’-vcodec mpeg4’, ’20190810.mp4’]
DOC CMD : ffmpeg -r 25 -start_number 1 -i "C :\Users\lalat\Desktop\03008427633\output_%04d.png" -vframes 382 -vcodec mpeg4 20190810.mp4
error b"ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers\r\n built with gcc 8.2.1 (GCC) 20181017\r\n configuration : —enable-gpl —enable-version3 —enable-sdl2 —enable-fontconfig —enable-gnutls —enable-iconv —enable-libass —enable-libbluray —enable-libfreetype —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libtheora —enable-libtwolame —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxml2 —enable-libzimg —enable-lzma —enable-zlib —enable-gmp —enable-libvidstab —enable-libvorbis —enable-libvo-amrwbenc —enable-libmysofa —enable-libspeex —enable-libxvid —enable-libaom —enable-libmfx —enable-amf —enable-ffnvcodec —enable-cuvid —enable-d3d11va —enable-nvenc —enable-nvdec —enable-dxva2 —enable-avisynth\r\n libavutil 56. 22.100 / 56. 22.100\r\n libavcodec 58. 35.100 / 58. 35.100\r\n libavformat 58. 20.100 / 58. 20.100\r\n libavdevice 58. 5.100 / 58. 5.100\r\n libavfilter 7. 40.101 / 7. 40.101\r\n libswscale 5. 3.100 / 5. 3.100\r\n libswresample 3. 3.100 / 3. 3.100\r\n libpostproc 55. 3.100 / 55. 3.100\r\nUnrecognized option ’r 25’.\r\nError splitting the argument list : Option not found\r\n" -
Ytdl-Core / FFMPEG in NodeJs : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0
25 mars 2023, par VenoMSo I'm using ytdl-core & ffmpeg to convert some videos from YouTube to MP4 and then manipulate them in a way or take screenshots. But the issue I'm facing is - some videos are downloaded and are completely playable, but others are corrupt.


This is the error I get when I try to take screenshot of the corrupted video :




Error : ffmpeg exited with code 1 : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0




And obviously, error is there because the video is corrupted, but WHY is that the case ?


Here's my code (read TL ;DR below) :


router.post("/screenshot", async (req, res) => {
 const urlToScreenshot = req.body.url;
 const timestamp = parseInt(req.body.t, 10);
 const YouTubeURL = `https://youtube.com/watch?v=${urlToScreenshot}`;
 const filename = uuidv4();

 const videoPath = `${filePath}/${filename}.mp4`;

 const downloadStartTime = timestamp - 3;
 const downloadEndTime = timestamp + 3;

 const videoStream = ytdl(YouTubeURL, {
 quality: "highest",
 });

 const ffmpegCommand = ffmpeg(videoStream)
 .setStartTime(downloadStartTime)
 .duration(downloadEndTime - downloadStartTime)
 .outputOptions("-c:v", "libx264")
 .outputOptions("-c:a", "copy")
 .outputOptions("-b:v", "10M")
 .outputOptions("-filter:v", "scale=1920:1080")
 .outputOptions("-q:v", "1")
 .outputOptions("-reconnect", "1") // enable reconnection attempts
 .outputOptions("-ignore_io_errors", "1") // ignore input/output errors
 .on("end", async () => {
 console.log("Video downloaded successfully: " + videoPath);

 const screenshotPath = `${filePath}/${filename}.png`;
 ffmpeg(videoPath)
 .screenshots({
 count: 1,
 timemarks: ["1"],
 folder: filePath,
 filename: `${filename}.png`,
 })
 .on("end", async () => {
 console.log(`Screenshot saved successfully: ${screenshotPath}`);
 try {
 const cloudinaryResult = await cloudinary.uploader.upload(
 screenshotPath
 );
 const screenshotUrl = cloudinaryResult.secure_url;
 console.log(`Screenshot uploaded to Cloudinary: ${screenshotUrl}`);
 // await unlink(videoPath);
 console.log(`Video file deleted: ${videoPath}`);
 // await unlink(screenshotPath);
 console.log(`Screenshot file deleted: ${screenshotPath}`);
 res.status(200).json({ screenshotUrl });
 } catch (err) {
 console.error(
 "An error occurred while uploading the screenshot to Cloudinary:",
 err
 );
 // await unlink(videoPath);
 // await unlink(screenshotPath);
 res.status(500).send("Internal Server Error");
 }
 })
 .on("error", async (err) => {
 console.error("An error occurred while taking the screenshot:", err);
 // await unlink(videoPath);
 // await unlink(screenshotPath);
 res.status(500).send("Internal Server Error");
 });
 })
 .on("error", async (err) => {
 console.error("An error occurred while downloading the video:", err);
 await unlink(videoPath); // delete the file on error
 res.status(500).send("Internal Server Error");
 })
 .save(videoPath);

 // console.log(ffmpegCommand);
});



Code Summary : Basically I'm passing the videoID and timestamp (because I want to download a certain section of the video, not the whole video), it downloads the video, then takes a screenshot of the video at a certain timestamp (i.e 1st second) and sends the screenshot to Cloudinary (a cloud file storage).


This works fine for 50% of the videos I've tried, but doesn't for other videos.


Here's a picture of a corrupt video and a working video.








Some help would be greatly appreciated !


-
Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0
26 mars 2023, par VenoMSo I'm using ytdl-core & ffmpeg to convert some videos from YouTube to MP4 and then manipulate them in a way or take screenshots. But the issue I'm facing is - some videos are downloaded and are completely playable, but others are corrupt.


This is the error I get when I try to take screenshot of the corrupted video :




Error : ffmpeg exited with code 1 : Cannot find a matching stream for unlabeled input pad 0 on filter Parsed_split_0




And obviously, error is there because the video is corrupted, but WHY is that the case ?


Here's my code (read TL ;DR below) :


router.post("/screenshot", async (req, res) => {
 const urlToScreenshot = req.body.url;
 const timestamp = parseInt(req.body.t, 10);
 const YouTubeURL = `https://youtube.com/watch?v=${urlToScreenshot}`;
 const filename = uuidv4();

 const videoPath = `${filePath}/${filename}.mp4`;

 const downloadStartTime = timestamp - 3;
 const downloadEndTime = timestamp + 3;

 const videoStream = ytdl(YouTubeURL, {
 quality: "highest",
 });

 const ffmpegCommand = ffmpeg(videoStream)
 .setStartTime(downloadStartTime)
 .duration(downloadEndTime - downloadStartTime)
 .outputOptions("-c:v", "libx264")
 .outputOptions("-c:a", "copy")
 .outputOptions("-b:v", "10M")
 .outputOptions("-filter:v", "scale=1920:1080")
 .outputOptions("-q:v", "1")
 .outputOptions("-reconnect", "1") // enable reconnection attempts
 .outputOptions("-ignore_io_errors", "1") // ignore input/output errors
 .on("end", async () => {
 console.log("Video downloaded successfully: " + videoPath);

 const screenshotPath = `${filePath}/${filename}.png`;
 ffmpeg(videoPath)
 .screenshots({
 count: 1,
 timemarks: ["1"],
 folder: filePath,
 filename: `${filename}.png`,
 })
 .on("end", async () => {
 console.log(`Screenshot saved successfully: ${screenshotPath}`);
 try {
 const cloudinaryResult = await cloudinary.uploader.upload(
 screenshotPath
 );
 const screenshotUrl = cloudinaryResult.secure_url;
 console.log(`Screenshot uploaded to Cloudinary: ${screenshotUrl}`);
 // await unlink(videoPath);
 console.log(`Video file deleted: ${videoPath}`);
 // await unlink(screenshotPath);
 console.log(`Screenshot file deleted: ${screenshotPath}`);
 res.status(200).json({ screenshotUrl });
 } catch (err) {
 console.error(
 "An error occurred while uploading the screenshot to Cloudinary:",
 err
 );
 // await unlink(videoPath);
 // await unlink(screenshotPath);
 res.status(500).send("Internal Server Error");
 }
 })
 .on("error", async (err) => {
 console.error("An error occurred while taking the screenshot:", err);
 // await unlink(videoPath);
 // await unlink(screenshotPath);
 res.status(500).send("Internal Server Error");
 });
 })
 .on("error", async (err) => {
 console.error("An error occurred while downloading the video:", err);
 await unlink(videoPath); // delete the file on error
 res.status(500).send("Internal Server Error");
 })
 .save(videoPath);

 // console.log(ffmpegCommand);
});



Code Summary : Basically I'm passing the videoID and timestamp (because I want to download a certain section of the video, not the whole video), it downloads the video, then takes a screenshot of the video at a certain timestamp (i.e 1st second) and sends the screenshot to Cloudinary (a cloud file storage).


This works fine for 50% of the videos I've tried, but doesn't for other videos.


Here's a picture of a corrupt video and a working video.








Some help would be greatly appreciated !