
Recherche avancée
Autres articles (98)
-
La sauvegarde automatique de canaux SPIP
1er avril 2010, parDans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...) -
Demande de création d’un canal
12 mars 2010, parEn fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...) -
Qualité du média après traitement
21 juin 2013, parLe bon réglage du logiciel qui traite les média est important pour un équilibre entre les partis ( bande passante de l’hébergeur, qualité du média pour le rédacteur et le visiteur, accessibilité pour le visiteur ). Comment régler la qualité de son média ?
Plus la qualité du média est importante, plus la bande passante sera utilisée. Le visiteur avec une connexion internet à petit débit devra attendre plus longtemps. Inversement plus, la qualité du média est pauvre et donc le média devient dégradé voire (...)
Sur d’autres sites (5666)
-
String is showing undefined
30 octobre 2022, par LolI am trying to create video using ffmpeg and returning its path to index.js but path is showing undefined.


index.js


app.get('/content/:myfact', async (req, res) => {
 let myfactdata = req.params.myfact;
 let myfact = myfactdata.replace("_", " ");
 const video = await generateVideo(myfact);
 console.log(video)
});



This is my contentVideo.js


const generateImage = require('./contentimage.js');
const { spawn } = require('child_process');

const generateVideo = async (myfact) => {
 await generateImage(myfact);
 const child = spawn('ffmpeg', [
 '-i', 'pictures/download/image.png', 'pictures/download/video.mp4'
 ]);
 child.on('close', function (code, signal) {
 const video = 'pictures/download/video.mp4'
 return video
 });
}

module.exports = generateVideo



-
PyInstaller has strange interaction with YT_DLP
12 janvier 2023, par MDorcelianthis is for debugging - it's so I can get some test variables when im not passing a json as an argument.


try: 
 data_string = sys.argv[1]

 # Convert the string back into an object
 data = json.loads(data_string)

 URL = data['url']
 PATH = data['filePath'] + "/"

except:
 URL = "https://www.youtube.com/watch?v=o9oGBnXqCgU"
 PATH = "C:/Users/PC/Downloads/videos"




this is the weird part.


try:
 ydl_opts = {
 'outtmpl':PATH_VIDEO + '/%(title)s.%(ext)s',
 'noplaylist':True,
 'format': "bv*[height<=1080][ext=mp4]+ba[ext=m4a]/b[height<=1080][ext=mp4] / bv*+ba/b",
 'mergeoutputformat':'mp4',
 'restrictfilenames':True,
 'ignoreerrors': False,
 'verbose':True,
 
 }
 with yt_dlp.YoutubeDL(ydl_opts) as ydl:
 ydl.download(URL)

 info = ydl.extract_info(URL, download=False)
 final_path_os = ydl.prepare_filename(info)
 except yt_dlp.utils.DownloadError as e:
 setJsonData(str(e))



when i download videos as a script with code runner, it downloads normally completely fine. After I compile it as an exe and click it, it downloads completely fine.


but when i pass my json through it, it knows where to download, it knows what's downloading, but it ALWAYS leaves two seperate video and audio files that were supposed to be combined. i assume its FFMPEG but i've included FFMPEG with the exe of pyinstaller.


pyinstaller --add-data "ffmpeg.exe;." --add-data "ffmpeg.exe;." -F returnMessage.py 



and i've put ffmpeg in the same folder just in case


setJsonData()
writes to a json i have but i don't know how to debug because IT NEVER WRITES AN ERROR THERE. my exe just keepes running in the background. i've spent a day on this and am so lost.

I've tried Exception error as e, nothing. I can't check the console because the application that launches this runs it silently.


I'm sure it's the
ydl.download(URL)
that's the problem because I've set it up to make a test_json before it and it worked. if i put it after, it doesn't.

I've checked the os paths to see if anything was up, but it's downloading in the correct place, just not downloading fully.


i've downloaded the ffmpeg that was compatible with yt_dlp as well.


-
From URL of Video GetThumbnail Using Nreco
8 février 2016, par Muhammad Abid FahadI working on a sharepoint project in which i have to upload the videos in the document library as videoset. after creating a video set i have have to upload the video and fetch the thumbnail from the video and upload it. video is uploaded succesfully using
spfile = item.Folder.Files.Add(fuUpload.FileName, fuUpload.PostedFile.InputStream, true);
I am using using Nreco to get thumbnail from the video. However my code works fine on local machine but its giving error "http://mysite/Download/abc/abc.mp4 : Server returned 401 Unauthorized (authorization failed) (exit code : 1)" when i am using my application from other pc browsers.
ffMpeg.GetVideoThumbnail(videoPath, ms, 10) ; the error line.
here is the code i am using
private MemoryStream SaveThumbnail(string videoPath)
{
MemoryStream ms;
try
{
videoPath = "http://mysitehttp/Download/abc/abc.mp4"
ms = new MemoryStream();
SPSecurity.RunWithElevatedPrivileges(delegate() {
var ffMpeg = new NReco.VideoConverter.FFMpegConverter();
ffMpeg.GetVideoThumbnail(videoPath, ms, 10);
});
}
catch(Exception ex)
{
throw ex;
}
return ms;
}