
Recherche avancée
Autres articles (66)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (11570)
-
Moving .wav files from S3 to /tmp folder in AWS Lambda
1er août 2019, par sleepyrobotI am currently trying to overlay two .wav files from S3 in AWS Lambda using FFMPEG. I am using node.js to do this. Here’s my process :
- Retrieve the files from S3, and save it to the Lambda /tmp folder
- Merge the two audio files, and save the output to the /tmp folder
- Upload the output from /tmp folder to S3.
However, I am encountering errors on the first part, since the .wav files being downloaded are corrupted and distorted.
I have tried using streams for this. However, I am still grasping its concept. I would appreciate any help. For my first try, I tried to retrieve an object from S3 and reupload the same
I have tried using function for getting the audio file from S3 :
async function readIn(bucketName, inputFilename, transfer, local) {
console.log('reading in locally?', local);
console.log(`reading from ${inputFilename} to ${transfer}`);
// inputFilename is the key name (object name)
// transfer is the filepath to where the obj will be transferred to (example: /tmp/audio1.wav)
const writeStream = fs.createWriteStream(transfer);
var file;
local? await new Promise((resolve, revoke) => {
file = fs.createReadStream(inputFilename);
writeStream.on('finish', () => {
console.log('file finished reading');
resolve();
});
writeStream.on('error', (err) => {
console.log('things messed up');
revoke();
});
file.pipe(writeStream);
}) : await new Promise((resolve, revoke) => {
writeStream.on('finish', () => {
console.log('file finished reading');
resolve();
});
writeStream.on('error', (err) => {
console.log('things messed up');
revoke();
});
s3.getObject({
Bucket : bucketName,
Key : inputFilename
}, function(err, data) {
if (err) {
console.log(err, err.stack);
} else {
console.log('data got!');
}
}).createReadStream().pipe(writeStream);
});
console.log('returning to main from reading');
return;
}For uploading the file to S3 :
async function writeOut(bucketName, outFile, transfer, contentType) {
console.log('uploading', bucketName, outFile, transfer);
return s3.upload({
Bucket: bucketName,
Key: outFile,
Body: fs.createReadStream(transfer),
//ACL: 'private',
ContentType: contentType
}).promise();
}For merging the files (I haven’t tried this yet) :
async function mergeFile(transfer1, transfer2, output) {
await new Promise((resolve, revoke) => {
console.log('beginning merge');
var outStream = fs.createWriteStream('/tmp/output.wav');
childProcess.exec('cp /var/task/ffmpeg /tmp/.; chmod 755 /tmp/ffmpeg;',
function (error, stdout, stderr) {
if (error) {
console.log('[ERROR]: An error occured in altering FFMPEG permission: ', error);
} else {
console.log("[SUCCESS]: Successfully altered FFMPEG permission!");
// merge audio files
ffmpeg('/tmp/audio1.wav')
.input('/tmp/audio2.wav')
.on('error', function(err) {
console.log('An error occurred with merging: ' + err.message);
})
.complexFilter(
{
filter: 'amix',
inputs: ['0:a','1:a']
})
.on('end', function() {
console.log('Merging finished!');
})
.pipe(outStream, { end: true });
//.save('/tmp/output.wav');
//////
}
})
});}However, the resulting file is corrupted. Is there any error in the functions ? Please help. Thanks !
-
Multiframe Dicom file not readable by some viewers
12 mai 2023, par PizzaPasNetteI have developed a program in C++ that works in 2 major steps :


- 

-
extract frames from a video with ffmpeg and convert them to jpeg

ffmpeg -i videofile.mp4 -q:v 1 -r desired_framerate tmp_04%d.jpeg


-
create a multiframe Dicom file from those jpeg images via DCMTK


//Example for one image

// Get the n-th image
QFile* imageFile = new QFile("Path/To/Image");

// Read the image inside a byte array
QByteArray * ba = new QByteArray();
imageFile->open(QIODevice::ReadOnly);
*ba = imageFile->readAll();

// Insert the byte array in the Dicom file
cond = jpegPixelItem->putUint8Array(reinterpret_cast<uint8>(ba->data()), ba->size());

// Rinse and repeat
</uint8>








It works well and can be displayed on most viewers but some complain about the Transfer Syntax being wrong.
As of now, I'm using the "JPEGLossless:Non-hierarchical-1stOrderPrediction" but It seems some viewers can't read my Dicom file unless I change the Transfer Syntax to "JPEG Baseline (Process 1)" which is a lossy Transfer Syntax.


I assume the problem comes from the first step of the program with ffmpeg that might be creating lossy JPEG images but I'm not sure because I'm using the "best" q:v scale as I've seen in other posts on the subject.


Therefore, my 2 main questions are :


- 

- why do some viewers have no problems displaying the dicom file whereas some others can't ?
- is there any way to obtain lossless JPEG images from a ffmpeg command ?






-
-
ffmpeg to encode MKV or MP4 with segmented Parts in one file
28 juillet 2014, par PhilIs it Possible to create an MP4 or MKV file where the Video, Meta and Audio Data is segmented and placed alternated in a single File ? (By segmented I don’t mean different Video or Audio Tracks.)
So that it looks like something like this :
[meta][video][audio][meta][video][audio]…
I searched for "segmenting", "clustering", and other buzz words. But the most searches ended up in an HTTP-Livestreaming where One File is segmented in single files.
That Segmenting Technology is okay (so you can stream it). But I don’t want these segments in single Files, i want them to be in one single MKV or MP4 File.Maybe someone has any clue.