
Recherche avancée
Autres articles (111)
-
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 (...) -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (7550)
-
how to set output video length from ffmpeg
25 avril 2022, par naval HurpadeI'm Creating youtube video downloader using
ytdl-core
andffmpeg
, I'm able to combine video and audio files using ffmpeg, and files are working fine, but

When I play that video video length (duration) is set to some random number like 212309854
I Already tryied ading
-t
flag to set time it works but I still video duration as this random number.

See screenshot bellow.
And in video properties I see no length is set.


module.exports = function (audio, video, selectedAudioFormat, selectedVideoFormat,res) {
 
 const ffmpegProcess = spawn(
 ffmpegInstallation.path,
 [
 '-i',
 `pipe:3`,
 '-i',
 `pipe:4`,
 '-map',
 '0:v',
 '-map',
 '1:a',
 '-c:v',
 'copy',
 '-c:a',
 'copy',
 '-crf',
 '27',
 '-preset',
 '6',
 '-movflags',
 'frag_keyframe+empty_moov',
 '-f',
 selectedVideoFormat.container,
 '-t',
 '30',
 '-loglevel',
 'info',
 '-',
 ],
 {
 stdio: ['pipe', 'pipe', 'pipe', 'pipe', 'pipe']
 }
 );
 
 
 video.pipe(ffmpegProcess.stdio[3]);
 audio.pipe(ffmpegProcess.stdio[4]);
 ffmpegProcess.stdio[1]
 .pipe(res);
 
 let ffmpegLogs = '';
 
 ffmpegProcess.stdio[2].on('data', (chunk) => {
 ffmpegLogs += chunk.toString();
 });
 
 ffmpegProcess.on('exit', (exitCode) => {
 if (exitCode === 1) {
 console.error('ERROR IN CHILD ::', ffmpegLogs);
 }
 });





-
FFmpeg python : different length after fps changed and interpolated
8 mai 2022, par Pablo DawsonFor my application I'm adapting the code from the ffmpeg-python github for tensorflow streaming.


It basically decodes each frame of your input, lets you process it with python, and encodes it again.


To optimize things I'm adding a fps filter at the input to get half the fps, so I can process only half the frames, then interpolate frames in the encoder with minterpolate to get the original fps.


My decoder looks like this :


def decoder(in_filename):
args = (
 ffmpeg
 .input(in_filename)
 .filter('fps', fps=30/2)
 (... more filters in between ...)
 .output('pipe:', format='rawvideo', pix_fmt='rgb24')
 .compile()
)
return subprocess.Popen(args, stdout=subprocess.PIPE)



And my encoder after processing the frames with python :


def encoder(out_filename, width, height):

args = (
 ffmpeg
 .input('pipe:', format='rawvideo', pix_fmt='rgb24', s='{}x{}'.format(width, height))
 .filter('minterpolate', fps=30)
 .filter('fps',fps=30)
 .output(out_filename, pix_fmt='rgb24')
 .overwrite_output()
 .compile()
)
return subprocess.Popen(args, stdin=subprocess.PIPE)



After that I horizontally stack the original input with the processed video


subprocess.run("ffmpeg -i {} -i {} -filter_complex hstack=inputs=2 -pix_fmt yuv420p -c:v libx264 {}".format(in_filename,out_filename,"out.mp4"))



Here's the problem : The "processed" video is faster and ends before the original. It's like they follow the same timestamp but it never actually interpolated frames. What am I doing wrong ?


-
Incorrect values for song length (duration) in Mp3tag after ffmpeg FLAC to MP3 conversion
29 mars 2024, par CluelessThe problem


As per this post, I use the following command to convert a flac file to mp3 while keeping all metadata :


ffmpeg -i input.flac -ab 320k -map_metadata 0 -id3v2_version 3 output.mp3



When inspecting the converted mp3 file by right-clicking it, going to properties and then details, everything looks in order. The value for "Length" is correct.




When inspecting the converted mp3 file with Mp3tag, the value for "Length" is different. From my testing, the "Length" value is consistently about 28% of what it is supposed to be.




Normally, this isn't an issue. Most music players I use, read the correct length value, same as Windows. However, I've recently discovered that Spotify Mobile for some reason ignores the length value that can be seen in the Windows panel and uses the one that can be seen in Mp3tag.


I want to figure out what command I should use so that after the flac file has been converted to mp3, Mp3tag shows the correct length, and there by, Spotify Mobile reads the correct length as well.


What I have tried


1.
After converting the file to Mp3, I've tried reencoding the mp3 file into a... mp3 file using the following command :


ffmpeg -i original.mp3 -c:v copy -c:a mp3 -vn -ar 44100 -ac 2 -b:a 320k copy.mp3





As can be seen in the image above, this fixes the issue and the length is showing correctly in Mp3tag and in Spotify Mobile.


Issues with this : Reencoding reduces quality and I don't know how to combine the previous flac conversion command and this one into one line.


2.
I tried https://cloudconvert.com/flac-to-mp3 and it worked. The length is displayed correctly in Mp3tag. (What commands did they use on the server ???)




Issues with this : I don't want to rely on a cloud service for conversion, I have a lot of files to convert and I'd prefer it to be done locally.


Some demo files


Here is a folder with a flac file, a bad mp3 file (wrong length) and a good mp3 file. It looks like if you preview the music in google drive, it also plays the wrong length for the bad mp3 (39s not 2m19s), while vlc, groove player, spotify (desktop not mobile) all play the correct full length (2m19s) for the bad mp3 file.


Folder : here's the link