
Recherche avancée
Autres articles (75)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Les images
15 mai 2013 -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)
Sur d’autres sites (13215)
-
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