
Recherche avancée
Autres articles (39)
-
Contribute to documentation
13 avril 2011Documentation is vital to the development of improved technical capabilities.
MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
To contribute, register to the project users’ mailing (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
MediaSPIP v0.2
21 juin 2013, parMediaSPIP 0.2 is the first MediaSPIP stable release.
Its official release date is June 21, 2013 and is announced here.
The zip file provided here only contains the sources of MediaSPIP in its standalone version.
To get a working installation, you must manually install all-software dependencies on the server.
If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)
Sur d’autres sites (6798)
-
swscale/arm/yuv2rgb : re-order compute_rgba macro arguments
28 mars 2016, par Matthieu Bouron -
avfilter/x86/vf_blend : reorganize init in order to add 16 bit version
17 février 2018, par Martin Vignali -
Is it possible to merge multiple FFMPEG commands (cuts, slow down, watermark) into one in order to increase performance ?
14 novembre 2022, par Nectarie PFI wrote a small piece of software in PHP, using FFMPEG commands via shell exec. The final purpose is to take a 7 seconds MP4 file from a GoPro and transform it in order to achieve a sort of boomerang effect :


- 

- crop the video to 1080 width/height




ffmpeg -i ./files/video_small/$latestVideo -filter:v \"crop=1080:1080:420:0\" ./files/video_small/outcrop_$cod.mp4 2>&1");



- 

- first second should run normally




ffmpeg.exe -t 1 -i ./files/video_small/outcrop_$cod.mp4 ./files/video_small/out1_$cod.mp4 2>&1");



- 

- the next two seconds will run at slow motion with a 2x factor




ffmpeg.exe -ss 00:00:01 -t 2 -i ./files/video_small/outcrop_$cod.mp4 -filter_complex \"[0:v]setpts=2*PTS[v]\" -map \"[v]\" ./files/video_small/out2_$cod.mp4 2>&1");



- 

- the next second will speed up at 4x factor




ffmpeg.exe -ss 00:00:03 -t 1 -i ./files/video_small/outcrop_$cod.mp4 -filter_complex \"[0:v]setpts=0.25*PTS[v]\" -map \"[v]\" ./files/video_small/out3_$cod.mp4 2>&1");



- 

- the next 2 seconds again slow motion




ffmpeg.exe -ss 00:00:04 -t 2 -i ./files/video_small/outcrop_$cod.mp4 -filter_complex \"[0:v]setpts=2*PTS[v]\" -map \"[v]\" ./files/video_small/out4_$cod.mp4 2>&1");



- 

- final second again normal speed




ffmpeg.exe -ss 00:00:06 -i ./files/video_small/outcrop_$cod.mp4 ./files/video_small/out5_$cod.mp4 2>&1");



- 

- concatenate the above parts to achieve the modified clip




ffmpeg.exe -f concat -i ./files/video_small/files_$cod.txt -c copy ./files/video_small/output1_$cod.mp4 2>&1");



- 

- then append the resulting clip in reverse




ffmpeg -i ./files/video_small/output1_$cod.mp4 -filter_complex \"[0:v]reverse,fifo[r];[0:v][r] concat=n=2:v=1 [v]\" -map \"[v]\" ./files/video_small/output2_$cod.mp4 2>&1");



- 

- add watermark




ffmpeg -i ./files/video_small/output2_$cod.mp4 -i ./files/watermark-video1080.png -filter_complex \"[0:v][1:v]overlay=(W-w)/2:10[outv]\" -map [outv] -c:v libx264 -crf 22 -preset veryfast ./files/video_small/output3_$cod.mp4 2>&1");



- 

- add audio (we can discard the original audio in any of the above steps)




ffmpeg -i ./files/video_small/output3_$cod.mp4 -i ./files/video_small/sound-hip-hop.mp3 -map 0 -map 1:a -c:v copy -shortest ./files/video_small/output_final_$latestVideo 2>&1");



Right now it runs ok, but I have a problem with performance, the whole process lasts about 50 seconds on my 8th gen i7.


I am very new to the capabilities of ffmpeg and I was wondering if any of the below commands can be optimized or if any of the steps can be merged into one, as I can see the syntax is quite powerful.


Thanks !


I was expecting this to run a little bit faster, ideally half the time it takes right now.
As far as I have observed, the longest part is appending the resulting clip in reverse, perhaps I am adding something too heavy and unnecessary in the reverse filter.