
Recherche avancée
Autres articles (46)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...) -
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 (...)
Sur d’autres sites (5335)
-
avcodec/png{dec,enc} : update mDCV and cLLI chunk capitalization
1er décembre 2024, par Leo Izenavcodec/pngdec,enc : update mDCV and cLLI chunk capitalization
The PNGv3 Specification Draft [1] has changed the capitalization
of mDCV and cLLI chunks (formerly mDCv and cLLi). This patch updates
FFmpeg to work with the new chunk names while retaining decode-side
compatibility with files created using the old names.[1] : https://w3c.github.io/png/
Signed-off-by : Leo Izen <leo.izen@gmail.com>
-
Correct Complex Lens Distortion in FFMPEG (or OpenCV) [closed]
29 septembre 2024, par C.M.I need to process videos which were taken with a wide angle vehicle camera. A good example is this frame from a video :




As you can see, the image is pretty distorted and I need to correct that. After some research, neither a Barrel distortion or a Pincushion distortion is the case here. I'd say it depends on the axis. The x axis seems to have a Pincushion distortion, but the y axis seems to have a Barrel distortion.


In my project I use a Java backend and I use FFmpeg to process the videos (re-encoding, color correction, ...). Therefore I'd like to do this in FFmpeg as another video filter.


I tried to use the lenscorrection filter but couldn't find any suitable values for k1 and k2. IMHO this isn't even possible since the filter can only handle the two types of distortion mentioned above. Here are two examples where I tried to correct the horizontal and vertical elements of the image :




(with k1= -0.7, k2=0.4)




(with k1=0.7)


But the resulting image would need to look like this (just roughly edited with GIMP) :




Is this even possible with FFmpeg filters ? I already tried out the v360 filter (similar like in this article) but just achieved similar results.


If I'm correct this isn't possible with video filters. So I thought of doing this in OpenCV in Java by extracting all the frames with FFmpeg, transforming them with OpenCV and rendering them to a video again. Unfortunately I have no experience with OpenCV and couldn't get any results. I think this should be possible in some way.


Can someone help me ?


-
Cropping ? a Video with ffmpeg
12 juillet 2024, par jwmdI want to build a script that downloads a video from youtube, and then place that video on a canvas with the aspect ratio of 1080px wide and 1920px high.


Because youtube video have an aspect ratio of 1080px high and 1920px wide i want to select the middle of the video and make a 1080px by 1080px square. I do not want to stretch the video but rather select the middle part. Here is a picture that i hope makes everything clearer :




Here is my current code Implementation :


const ytdl = require('@distube/ytdl-core');
const fs = require('fs');
const ffmpeg = require('fluent-ffmpeg');
const ffmpegPath = require('ffmpeg-static');
const ffprobePath = require('ffprobe-static').path;

ffmpeg.setFfmpegPath(ffmpegPath);
ffmpeg.setFfprobePath(ffprobePath);

const DOWNLOADED_VIDEO = '/example/path';
const TRIMMED_VIDEO = '/example/path';
const SCALED_VIDEO = '/example/path';
const OUTPUT_VIDEO = '/example/path';

const YOUTUBE_VIDEO_ID = 'chJWuDZFQDE'



async function downloadYouTubeVideo(id) {
 try {
 const url = `https://www.youtube.com/watch?v=${id}`;
 return await new Promise((resolve, reject) => {
 const videoStream = ytdl(url, {
 quality: 'highest',
 filter: 'videoandaudio',

 });
 const writeStream = fs.createWriteStream(DOWNLOADED_VIDEO);
 videoStream.pipe(writeStream);

 writeStream.on('finish', () => {
 resolve(DOWNLOADED_VIDEO);
 });

 writeStream.on('error', (error) => {
 console.error('Error writing video to disk:', error);
 reject(error);
 });

 videoStream.on('error', (error) => {
 console.error('Error downloading video:', error);
 reject(error);
 });
 });
 } catch (error) {
 console.error('Error downloading YouTube video:', error);
 throw error; // Rethrow or handle as needed
 }
}




async function scaleVideo() {
 return new Promise((resolve, reject) => {
 ffmpeg(TRIMMED_VIDEO)
 .size('1080x?')
 .aspect(1)
 .on('end', () => {
 resolve(SCALED_VIDEO);
 })
 .on('error', (err) => {
 console.error('Error during video processing: ', err);
 reject(err);
 })
 .save(SCALED_VIDEO);
 })
}

async function padVideo() {
 return new Promise((resolve, reject) => {
 ffmpeg(SCALED_VIDEO)
 .size('1080x1920')
 .autopad('white')
 .on('end', () => {
 resolve(OUTPUT_VIDEO);
 })
 .on('error', (err) => {
 console.error('Error during video processing: ', err);
 reject(err);
 })
 .save(OUTPUT_VIDEO);
 });

}



async function main() {
 console.log('Downloading video');
 await downloadYouTubeVideo(YOUTUBE_VIDEO_ID);
 console.log('video downloaded')

 console.log('scaling video');
 await scaleVideo();
 console.log('video scaled')


 console.log('padding video');
 await padVideo();
 console.log('video padded')


 console.log('Video processing finished successfully');
}

main();



changing the values in the scale video sadly does not change the output video and i dont know why.


Appreciate any help :)