
Recherche avancée
Médias (1)
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (103)
-
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 -
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Les formats acceptés
28 janvier 2010, parLes commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
ffmpeg -codecs ffmpeg -formats
Les format videos acceptés en entrée
Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
Les formats vidéos de sortie possibles
Dans un premier temps on (...)
Sur d’autres sites (8341)
-
I need to implement video compression for files that exceed 5 MB in size
27 septembre 2024, par KAVYA PI need to implement video compression for files that exceed 5 MB in size. I have tried several packages for this purpose, but they either do not work as expected or have significant security vulnerabilities. It's crucial for me to find a reliable and secure solution for compressing videos that meet this file size requirement. If you have any recommendations for libraries or tools that effectively handle video compression without compromising security, please let me know.


const handleFileChange = async (
 event: React.ChangeEvent<htmlinputelement>
 ) => {
 const file = event.target.files?.[0];
 if (file) {
 const isImage = file.type.startsWith('image/');
 const MAX_FILE_SIZE = isImage ? 2 * 1024 * 1024 : 5 * 1024 * 1024; // 2 MB for images, 5 MB for videos

 if (file.size > MAX_FILE_SIZE) {
 if (isImage) {
 alert('Image file size exceeds 2 MB. Compressing the file...');
 try {
 const compressedFile = await imageCompression(file, {
 maxSizeMB: 2,
 maxWidthOrHeight: 1920,
 useWebWorker: true,
 });
 onSelectFile({
 ...event,
 target: {
 ...event.target,
 files: [compressedFile] as unknown as FileList,
 },
 });
 } catch (error) {
 console.error('Error compressing the image:', error);
 }
 } else {
 alert('Video file size exceeds 5 MB. Please choose a smaller video.');
 }
 } else {
 onSelectFile(event); // Proceed with the file selection
 }
 }
 };
</htmlinputelement>


-
How to use Hardware codec during video compression in Android
2 septembre 2024, par FilnikI was wondering how to use hardware acceleration in the best way to compress a video on Android. I've tried
Transformer
by ExoPlayer and is quite slow.

With ffmpegKit unfortunately
libopenh264
is quite slow (and doesn't use hardware codec) and I'm not able to makeh264_mediacodec
work. Any idea on how to make the mediacodec work ?

This is the code I'm using right now for the tests but it fails with mediacodec (generic error). I've compiled manually FFMpegKit to add mediacodec already.


companion object {
 private const val VIDEO_WIDTH = 1080
 private const val VIDEO_HEIGHT = 1920
 private const val BITRATE_MBS = 7 * 1000000
 private const val COMPRESSION_FILE_NAME = "compression"
 private const val VIDEO_EXTENSION = ".mp4"
}

suspend fun compressVideo(videoUri: Uri): String? = withContext(defaultDispatcher) {
 val tempInputFile = copyUriToFile(context, videoUri)
 val outputFile = File.createTempFile(COMPRESSION_FILE_NAME, VIDEO_EXTENSION, context.cacheDir)
 val outputPath = outputFile.absolutePath

 val cmd = mutableListOf(
 "-y",
 "-i", tempInputFile.absolutePath,
 "-vf", "scale=w=$VIDEO_WIDTH:h=$VIDEO_HEIGHT:force_original_aspect_ratio=decrease",
 "-c:v", "h264_mediacodec",
 "-b:v", "$BITRATE_MBS",
 outputPath
 )

 val session: FFmpegSession = FFmpegKit.execute(cmd.joinToString(" "))

 tempInputFile.delete()

 return@withContext if (ReturnCode.isSuccess(session.returnCode)) {
 outputPath
 } else {
 FirebaseCrashlytics.getInstance().recordException(Exception("FFmpeg compression failed: ${session.allLogsAsString}"))
 null
 }
}



-
avcodec/dovi_rpuenc : add a flag to enable compression
18 juin 2024, par Niklas Haasavcodec/dovi_rpuenc : add a flag to enable compression
Keyframes must reset the metadata compression state, so we need to
also signal this at rpu generation time.Default to uncompressed, because encoders cannot generally know if
a given frame will be a keyframe before they finish encoding, but also
cannot retroactively attach the RPU. (Within the confines of current
APIs)