
Recherche avancée
Autres articles (60)
-
Librairies et logiciels spécifiques aux médias
10 décembre 2010, parPour un fonctionnement correct et optimal, plusieurs choses sont à prendre en considération.
Il est important, après avoir installé apache2, mysql et php5, d’installer d’autres logiciels nécessaires dont les installations sont décrites dans les liens afférants. Un ensemble de librairies multimedias (x264, libtheora, libvpx) utilisées pour l’encodage et le décodage des vidéos et sons afin de supporter le plus grand nombre de fichiers possibles. Cf. : ce tutoriel ; FFMpeg avec le maximum de décodeurs et (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...) -
Installation en mode standalone
4 février 2011, parL’installation de la distribution MediaSPIP se fait en plusieurs étapes : la récupération des fichiers nécessaires. À ce moment là deux méthodes sont possibles : en installant l’archive ZIP contenant l’ensemble de la distribution ; via SVN en récupérant les sources de chaque modules séparément ; la préconfiguration ; l’installation définitive ;
[mediaspip_zip]Installation de l’archive ZIP de MediaSPIP
Ce mode d’installation est la méthode la plus simple afin d’installer l’ensemble de la distribution (...)
Sur d’autres sites (5765)
-
ffmpeg video processing command does not end
24 août 2023, par HarryI am using ffmpeg to create a video processing lambda, I attached the log for the processing input below and the process never completes sometimes and other times it takes no more than 2 minutes. This also does not throw and error but just does not complete for certain videos.


2023-08-24T22:49:18.633Z bebc42e9-a60a-4e12-a5a1-ad3f2950f1f3 INFO Spawned Ffmpeg with command: ffmpeg -i /tmp/input.mp4 -i /tmp/background.mp4 -i /tmp/input_colored.ass -y -filter_complex 
 [0:v]scale=-1:853.3333333333334,crop=1080:853.3333333333334:540:426.6666666666667[videoOne];
 [1:v]scale=-1:1066.6666666666667,crop=1080:1066.6666666666667:540:533.3333333333334[videoTwo];
 [videoOne][videoTwo]vstack=shortest=1[vstacked];
 [vstacked]subtitles=/tmp/input_colored.ass:fontsdir=/tmp/fonts/:force_style='Alignment=2,Shadow=2,OutlineColour=#000000,Fontsize=18,Fontname=Burbank Big Condensed
'
 -c:v libx264 -preset fast -crf 18 -aspect 9:16 -f mp4 /tmp/_1692917333426-rah10.mp4_output.mp4




The intention is to provide two videos with varying lengths and have them stack on top of each other vertically with subtitles and a length of the shortest video.
I am running the function in a lambda and even with a timeout of 10 minutes it does not complete for certain videos but for others it does complete, please help me to resolve this.


-
FFmpeg : What re-encoding settings can be used to achieve results similar to Google Drive's video processing ?
4 août 2023, par Mycroft_47Context :


I have a large collection of videos recorded by my phone's camera, which is taking up a significant amount of space. Recently, I noticed that when I uploaded a video to Google Drive and then downloaded it again using IDM (by clicking on the pop-up that IDM displays when it detects something that can be downloaded here's what i mean), the downloaded video retained the same visual quality but occupied much less space. Upon further research, I discovered that Google re-encodes uploaded videos using H.264 video encoding, and I believe I can achieve similar compression using FFmpeg.


Problem :


Despite experimenting with various FFmpeg commands, I haven't been able to replicate Google Drive's compression. Every attempt using
-codec:v libx264
option alone resulted in videos larger than the original files.

While adjusting the
-crf
parameter to a higher value and opting for a faster-preset
option did yield smaller file sizes, it unfortunately came at the cost of a noticeable degradation in visual quality and the appearance of some visible artifacts in the video.

Google Drive's processing, on the other hand, strikes a commendable balance, achieving a satisfactory file size without compromising visual clarity, (I should note that upon zooming in on this video, I observed some minor blurring, but it was acceptable to me).


Note :


I'm aware that using the H.265 video encoder instead of H.264 may give better results. However, to ensure fairness and avoid any potential bias, I think the optimal approach is first to find the best command using the H.264 video encoder. Once identified, I can then replace
-codec:v libx264
with-codec:v libx265
. This approach will ensure that the chosen command is really the best that FFMPEG can achieve, and that it is not solely influenced by the superior performance of H.265 when used from the outset.

Here's the FFMPEG command I am currently using :


ffmpeg -hide_banner -loglevel verbose ^
 -i input.mp4 ^
 -codec:v libx264 ^
 -crf 36 -preset ultrafast ^
 -codec:a libopus -b:a 112k ^
 -movflags use_metadata_tags+faststart -map_metadata 0 ^
 output.mp4








 Video file 

Size (bytes) 

Bit rate (bps) 

Encoder 

FFPROB - JSON 







 Original (named 'raw 1.mp4') 

31,666,777 

10,314,710 

!!! 

link 




 Without crf 

36,251,852 

11,805,216 

Lavf60.3.100 

link 




 With crf 

10,179,113 

3,314,772 

Lavf60.3.100 

link 




 Gdrive 

6,726,189 

2,190,342 

Google 

link 









Those files can be found here.


Update :


I continued my experiments with the video "raw_1.mp4" and found some interesting results that resemble those shown in this blog post, (I recommend consulting this answer).


In the following figure, I observed that using the
-preset
set to veryfast provided the most advantageous results, striking the optimal balance between compression ratio and compression time, (Note that a negative percentage in the compression variable indicates an increase in file size after processing) :


In this figure, I used the H.264 encoder and compared the compression ratio of different outputted files resulting from seven different values of the
-crf
parameter (CRF values used : 25, 27, 29, 31, 33, 35, 37),


For this figure, I've switched the encoder to H.265 while maintaining the same CRF values used in the previous figure :



Based on these results, the
-preset
veryfast and a-crf
value of 31 are my current preferred settings for FFmpeg, until they are proven to be suboptimal choices.
As a result, the FFmpeg command I'll use is as follows :

ffmpeg -hide_banner -loglevel verbose ^
 -i input.mp4 ^
 -codec:v libx264 ^
 -crf 31 -preset veryfast ^
 -codec:a libopus -b:a 112k ^
 -movflags use_metadata_tags+faststart -map_metadata 0 ^
 output.mp4



Note that these choices are based solely on the compression results obtained so far, and they do not take into account the visual quality of the outputted files.


-
Issue with Asynchronous Video Processing and New Window Creation in Windows Forms Application
2 août 2023, par sadra hoseiniI have a Windows Forms application that uses FFmpeg for video processing tasks. In this application, I have a textBox2_TextChanged event handler that performs some video processing tasks based on user input.


However, I noticed that when textBox2_TextChanged is called, the UI becomes unresponsive, and it seems like another window is being created but doesn't show up. I suspect that this issue is related to threading.


Here's a simplified version of the problematic code :


// Relevant code snippet:
private async void textBox2_TextChanged(object sender, EventArgs e)
{
 if (listBox1.Items.Count > 0 && int.TryParse(textBox2.Text, out int itemvalue) && int.TryParse(textBox1.Text, out int ratio))
 {
 await Task.Run(() =>
 {
 // Video processing code using FFmpeg (e.g., creating thumbnails).
 // This code seems to cause the UI to freeze and prevent new windows from showing up.
 });
 }
}



Expected Behavior :


When a user enters a valid input in textBox2, the video processing tasks should be executed in the background without freezing the UI. The application should remain responsive, and any new windows, including message boxes or progress dialogs, should show up as expected.


Actual Behavior :


When a user enters a valid input in textBox2, the video processing tasks appear to be running, but the UI becomes unresponsive, and new windows, such as message boxes, do not show up as expected. This makes it challenging to display any progress or error messages to the user during video processing.


Steps to Reproduce :


Open the Windows Forms application.
Add some video files to the list (listBox1) and provide valid input in textBox2.
Observe the UI behavior and any new windows that should be displayed, such as progress dialogs or message boxes.
Additional Notes :


I am using Visual Studio [version] for development.
The application uses FFmpeg for video processing tasks, and I've verified that FFmpeg is functioning correctly.
I've also tried using proper error handling to catch any exceptions, but no exceptions are thrown during the video processing tasks.
Any help or suggestions on how to resolve this issue and enable new window creation during video processing would be greatly appreciated. Thank you !