
Recherche avancée
Médias (29)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (43)
-
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 ;
-
Gestion de la ferme
2 mars 2010, parLa ferme est gérée dans son ensemble par des "super admins".
Certains réglages peuvent être fais afin de réguler les besoins des différents canaux.
Dans un premier temps il utilise le plugin "Gestion de mutualisation" -
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 (6286)
-
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 :)


-
ffmpeg 180 degree panoramic fisheye image to equirectangular / flat
7 juillet 2024, par Willy62I am trying to get my Hikvision Panovu image of a sportsfield to look like a standard camera image, similar to what would be seen with a Veo solution / traditional camera.


This is what the image would ideally look like with a little bit of zoom. Note the players are all upright and it looks "correct" and not skewed with the far end of the field in line with the horizon.




The original image looks like this (same field but other side). This is a 180 degree panoramic image from a Hikvision camera as found here.


It provides the following output natively.




I have had some luck converting the image with ffmpeg using the v360 filter. Note there is a downward tilt meaning I have to apply some yaw to correct it.


v360=input=fisheye:output=rectilinear:ih_fov=180:iv_fov=87.5:d_fov=87.5:pitch=20:yaw=5:w=3840:h=2160



And this gets the following output :




So the challenge here to make the original image flat/equirect but to address the skew such that :


- 

- the players are orientated "upright"
- the far sideline of the field looks like a straight line in line with the horizon
- the image quality is preserved as best as possible








With these cameras the image is 32MP so there is the opportunity to do an ePTZ into the area of interest.


I suspect v360 isnt the right choice here and it is some remap-style filter, or perhaps I am best going across to gstreamer or similar.


I tried an ffmpeg v360 filter and it partially works, but the players are still skewed because the top of the image is not wide enough. The issue can possibly be solved by correctly applying a couplex perspective filter, but I think this will only mask the issue and perspective requires a complex filter that hasn't worked for me so far.