
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 (111)
-
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...) -
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
Sur d’autres sites (9771)
-
Extract individual macroblock types and their corresponding motion vectors [closed]
14 mai 2023, par Prajit KumarI need to make a pair for each macroblock from a frame of a video containing its type and motion vector.


I extracted motion vectors by using the python module of mv-extractor.


For macroblock type I used ffmpeg command :
ffmpeg -threads 1 -debug 'mb_type' -i file.h264 -f null -


The info received from ffmpeg command doesn't match with the location of motion vectors extracted (Macroblocks which are divided into smaller blocks of size 8X16 or 16X8 do not match with the info of macroblock size received in motion vector info). Also, the ffmpeg command for extracting macroblock type doesn't work properly on some videos.


Can you please tell a more streamlined way of doing this task.


-
Different ffmpeg result after saving to png
28 juillet 2023, par Kalev MaricqSaving images to PNG first seems to produce different ffmpeg encodes. Running this test code


from PIL import Image
import cv2
import ffmpeg
import hashlib

ffmpeg.input('test.jpg').output('testff.png').run()
cv2.imwrite('testcv.png',cv2.imread('test.jpg'))
Image.open('test.jpg').save('testpil.png')

hashes=[]
for suf in ['.jpg','ff.png','cv.png','pil.png']:
 dest='test'+suf.replace('.','')+'.mp4'
 ffmpeg.input('test'+suf).output(dest).run()
 hashes.append(hashlib.file_digest(open(dest,'rb'),'md5').hexdigest())
 
print(hashes)



I get

['a5b744a8ac0f6de9ec4de43ff737c46e'

,'ab62474f2160899e064ba24890047372'

,'baa788d5e4ef212ab610b8b5cf7772cb'

,'baa788d5e4ef212ab610b8b5cf7772cb']

As you can see, the only two that match are the cv2 and pillow conversions, and none of them match the original. In terms of file size, the results that passed to png first seem to be about 10% smaller than the direct-from-jpg result.


Why is this happening and how can I avoid changing image data until I'm ready to encode ?


-
FFMPEG Command to convert images to svg [closed]
5 mai 2024, par themujahidkhanUsers are trying to convert images to SVG image on my website, Below I've given a link to the site, more detail on error and code that handles the conversion of media files.


You can check out the live site Here.


Steps to reproduce the error.


- 

- Upload the png file,
- Select SVG as output file
- Click convert.








It is throwing error.


Below is the code for that converts users input and gives input based on user preference.


// imports

import { createCanvas, loadImage } from "canvas";

import { Action } from "@/types";
import { FFmpeg } from "@ffmpeg/ffmpeg";
import { fetchFile } from "@ffmpeg/util";

function getFileExtension(file_name: string) {
 const regex = /(?:\.([^.]+))?$/; // Matches the last dot and everything after it
 const match = regex.exec(file_name);
 if (match && match[1]) {
 return match[1];
 }
 return ""; // No file extension found
}

function removeFileExtension(file_name: string) {
 const lastDotIndex = file_name.lastIndexOf(".");
 if (lastDotIndex !== -1) {
 return file_name.slice(0, lastDotIndex);
 }
 return file_name; // No file extension found
}

export default async function convert(
 ffmpeg: FFmpeg,
 action: Action
): Promise<any> {
 const { file, to, file_name, file_type } = action;
 const input = getFileExtension(file_name);
 const output = removeFileExtension(file_name) + "." + to;
 ffmpeg.writeFile(input, await fetchFile(file));

 // FFMPEG COMMANDS
 let ffmpeg_cmd: any = [];

 if (to === "svg") {
 ffmpeg_cmd = [
 "-i",
 input,
 "-vf",
 "scale=trunc(iw/2)*2:trunc(ih/2)*2",
 "-c:v",
 "libvpx-vp9",
 "-crf",
 "30",
 "-b:v",
 "1M",
 "-c:a",
 "libopus",
 "-b:a",
 "128k",
 output,
 ];
 } else if (to === "3gp") {
 ffmpeg_cmd = [
 "-i",
 input,
 "-r",
 "20",
 "-s",
 "352x288",
 "-vb",
 "400k",
 "-acodec",
 "aac",
 "-strict",
 "experimental",
 "-ac",
 "1",
 "-ar",
 "8000",
 "-ab",
 "24k",
 output,
 ];
 } else {
 ffmpeg_cmd = ["-i", input, output];
 }

 // execute cmd
 await ffmpeg.exec(ffmpeg_cmd);

 const data = (await ffmpeg.readFile(output)) as any;
 const blob = new Blob([data], { type: file_type.split("/")[0] });
 const url = URL.createObjectURL(blob);
 return { url, output };
}

</any>


Help appreciated, Thank You