
Recherche avancée
Autres articles (55)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Changer son thème graphique
22 février 2011, parLe thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
Modifier le thème graphique utilisé
Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
Il suffit ensuite de se rendre dans l’espace de configuration du (...)
Sur d’autres sites (5924)
-
C# File.Move creates an empty file and IO exception
30 novembre 2020, par MaddieMy code processes a video file (using ffmpeg) and creates different qualities (360p, 480p, etc) and formats (mp4 and HLS) of that. After creating these files, I move all of them to another drive (a network location).


my code looks Like this :


var files = Directory.GetFiles(srcFolder);
string filename, destFile = string.Empty, srcFile = string.Empty;
try
{
 for (int i = 0; i < files.Length; i++)
 {
 srcFile = files[i];
 filename = Path.GetFileName(srcFile);
 destFile = Path.Combine(destFolder, filename);
 File.Move(srcFile, destFile);
 }
}
catch
{
 _logger.LogError("Error in moving file. srcFile: {0}, destFile: {1}", destFile, srcFile);
 throw;
}



This process works fine most of the time, but for some files, I get an IO exception every time I run this process.




System.IO.IOException : The file exists. at System.IO.FileSystem.MoveFile(String sourceFullPath, String destFullPath, Boolean overwrite)




I made sure that destFolder does not exist before, nor did the destFile.


After logging the error and finding the path of source and target files, I downloaded both of them. The source file is a .ts file with a size of 1,048 KB, and the target file is an empty file with the same name (0KB).


This error happened multiple times with the same video, so I assume that it has something to do with the file itself. But I cannot figure it out.


-
Using find / for how do I remove the original file extension for the output file name ?
2 septembre 2022, par burntscarrWhen using
find
orfor
to run things on multiple files, how would I make something not keep the file extension ?

For example if using ffmpeg on multiple files to convert from DTS to WAV I would run one of the following :


find . -name "*.dts" -exec ffmpeg -i "{}" -c:a pcm_s24le "{}.wav" \;


or


for f in ./*.dts; do ffmpeg -i "$f" -c:a pcm_s24le "$f.wav"; done


Both of these make files that end in .dts.wav rather than just .wav


My goal is to find out what I would add/change to make the "{}.wav" or "$f.wav" not include the .dts part for the output file name. (and several other examples with various extensions)


This happens automatically when using the cli version of
flac
, the output file automatically removes .wav and has .flac instead, when no output file is specified.
(Ex :flac -8 *.wav
would create .flac files next to the .wav files, but they aren't .wav.flac, they're just .flac)

-
Convertion of mp3 file with ffmpeg results in a file with wrong length [duplicate]
16 avril 2018, par Arthur EfixtyThis question already has an answer here :
I wrote a simple script for Linux where I loop through the folder (containing only .mp3 files) and add an album art to every item.
Here is my code :
for file in ~/Desktop/Rise\ Against/*
do
ffmpeg -i "${file}" -i ~/Desktop/appeal\ to\ reason.jpeg -map 0:0 -map 1:0 -codec copy -id3v2_version 3 \-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" "${file%}";
doneIf I set the output filename to hardcoded value like
out.mp3
then it works fine. But I need these files to have the same name as existing and overwrite them.Running this script results in having all files edited as expected (the album art changed) but they all have a length of 3 seconds. In terminal I get this
[mp3 @ 0xc695e0] Audio packet of size 378219 (starting with 6B0855F2...) is invalid, writing it anyway.
Thanks in advance !