
Recherche avancée
Autres articles (62)
-
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 ;
-
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 ) (...) -
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
Sur d’autres sites (10258)
-
ffmpeg padding doesn't scale when changing resolution
5 mars 2023, par MartinI have a ffmpeg command which takes a bunch of audio files, 3 image files, and renders a video with them.


Image Input Dimmensions :


- 

- 1_front.jpg 600w x 593h
- 2_back.jpg 600w x 466h
- 3_cd.jpg 600w x 598h








The video has a resolution of w=600 h=593, which is the resolution of the first img.


Here's the full command


ffmpeg
 -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock 'em All The Way Out.aiff"
 -r 2 -i "E:\filepath\11. Deejay Punk-Roc - Spring Break.aiff" -r 2 -i "E:\filepath\12. Deejay Punk-Roc - Fat Gold Chain.aiff" 
 -r 2 -i "E:\filepath\1_front.jpg" -r 2 -i "E:\filepath\2_back.jpg" -r 2 -i "E:\filepath\3_cd.jpg" 
 
 -filter_complex 
 "
 [0:a][1:a][2:a]concat=n=3:v=0:a=1[a]; 
 
 [3:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v3]; 

 [4:v]pad=600:593:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];
 
 [5:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v5];
 
 [v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"
 
 -map "[v]" -map "[a]" -c:a pcm_s32le -c:v libx264 -bufsize 3M -crf 18 -pix_fmt yuv420p -tune stillimage -t 870.04 
 "E:\filepath\vidOutPutCorrect.mkv"




For filter_complex this second part will add padding to the second image so that it does not get stretched or cropped.


[4:v]pad=600:593:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];



Specifically this part


pad=600:593:0:63:color=pink



Which I understand means w=600 and h=593, but i dont know that the last part
0:63
means.

You can see the output has the pink padding correctly



but i want to render the video with a resolution of w=1920 h=1898 instead of w=600 h=593.


So i update the command to have this new resolution :


ffmpeg -r 2 -i "E:\filepath\10. Deejay Punk-Roc - Knock 'em All The Way Out.aiff" -r 2 -i "E:\filepath\11. Deejay Punk-Roc - Spring Break.aiff" -r 2 -i "E:\filepath\12. Deejay Punk-Roc - Fat Gold Chain.aiff" -r 2 -i "E:\filepath\1_front.jpg" -r 2 -i "E:\filepath\2_back.jpg" -r 2 -i "E:\filepath\3_cd.jpg" 

-filter_complex "
[0:a][1:a][2:a]concat=n=3:v=0:a=1[a];

[3:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v3];

[4:v]pad=1920:1898:0:63:color=pink,setsar=1,loop=580.03:580.03[v4];

[5:v]scale=w=1920:h=1898,setsar=1,loop=580.03:580.03[v5];

[v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"

 -map "[v]" -map "[a]" -c:a pcm_s32le -c:v libx264 -bufsize 3M -crf 18 -pix_fmt yuv420p -tune stillimage -t 870.04 "E:\filepath\slidet.mkv"



my video does in fact now have a resolution of 1920x1798 which is great, but the 2nd image padding portion has the image super small and in a corner




So this line works :


pad=600:593:0:63:color=pink



but with a different resolution is looks bad with the image in the top left corner


pad=1920:1898:0:63:color=pink



What do I need to change
0:63
to in order to have the image be centered ?

Download files : http://www.mediafire.com/folder/e8ja1n8elszk1lu,dxw4vglrz7polyh,ojjx6kcqruksv5r,lah9rano4svj46o,q5jg0083vbj9y1p,d3pt8ydf3ulqm5m/shared


-
add padding to ffmpeg slideshow images with different dimensions
3 mars 2023, par MartinI have an ffmpeg command which takes 3 audio files and 3 image files, and concats the 3 audio files into a video with length 870.04 seconds, where the images play in a slideshow where each image is shown for 290.015 seconds.


You can copy and paste the command into your web browser search bar to turn it into one line, then run it (filepaths are formatted for win10 command prompt)


ffmpeg 
-r 2 -i "E:\myFolder\10. Deejay Punk-Roc - Knock 'em All The Way Out.aiff"
-r 2 -i "E:\myFolder\11. Deejay Punk-Roc - Spring Break.aiff"
-r 2 -i "E:\myFolder\12. Deejay Punk-Roc - Fat Gold Chain.aiff"
-r 2 -i "E:\myFolder\1_front.jpg"
-r 2 -i "E:\myFolder\2_back.jpg"
-r 2 -i "E:\myFolder\3_cd.jpg"

-filter_complex "[0:a][1:a][2:a]concat=n=3:v=0:a=1[a];[3:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v3];[4:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v4];[5:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v5];[v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"

-map "[v]" -map "[a]" -c:a pcm_s32le -c:v libx264 -bufsize 3M -crf 18 -pix_fmt yuv420p -tune stillimage -t 870.04 

"E:\myFolder\newOutputVid.mkv" 



The most complex part of this command, which is the logic behind how long to show each image, is the filter_complex argument, which I will try to explain below :


-filter_complex "

//concat the three audio files. [0:a] is referring to the 0'th file input which is audio file 'Knock 'em All The Way Out'
[0:a][1:a][2:a]concat=n=3:v=0:a=1[a];

//file input 3, is the first image, 
[3:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v3];[4:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v4];[5:v]scale=w=600:h=593,setsar=1,loop=580.03:580.03[v5];

//concat the three images in order
//set output resolution
[v3][v4][v5]concat=n=3:v=1:a=0,pad=ceil(iw/2)*2:ceil(ih/2)*2[v]"



With the output video that gets rendered, the first image is shown correctly, because the video resolution 600w x 593h is the same as the image itself



The second image however, was stretched to fit the frame of the video.



How can i edit my filter_complex line for the
[4:v]
, the 4th input file which is the second image2_back.jpg
, so that the image is not stretched ? Maybe like add black background padding to keep the image fully visible with the frame and not cropped/stretched

Download files :
http://www.mediafire.com/folder/e8ja1n8elszk1lu,dxw4vglrz7polyh,ojjx6kcqruksv5r,lah9rano4svj46o,q5jg0083vbj9y1p,d3pt8ydf3ulqm5m/shared


-
Show video length in HLS player before all TS files are created
14 novembre 2022, par WilliamTacoI have a spring-boot backend which on request (on demand) uses ffmpeg to create a m3u8 playlist with its ts files from a mp4 file. So basically my react frontend requests the index.m3u8 from the backend and if it doesnt already exist it creates it and then start serving it with its ts files. This causes the frontend HLS player to show the length of the video to the combined length of the generated chunks which gets longer as time goes on until its fully there. It totally makes sense but was wondering what the correct way of showing the full length in the player even though its not fully created yet ?


Im using react-hls-player for playing the stream and spring-boot + a java ffmpeg wrapper to transcode the video.


Might be thinking about this the wrong way so feel free to correct me if im in the wrong path !