
Recherche avancée
Médias (1)
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
Autres articles (67)
-
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (5077)
-
How to create video from multiple gallery images store in array flutter ffmpeg
26 janvier 2023, par AmmaraI select images from gallery using multi_image_picker in flutter and store all images in array.


try {
 resultList = await 
 MultiImagePicker.pickImages(
 maxImages: 300,
 enableCamera: true,
 selectedAssets: images,
 materialOptions: MaterialOptions(
 actionBarTitle: "Photo Editor and Video 
 Maker App",
 ),
 );
 }



User can select images from gallery and store in resultlist array.
Now I want to pass this array to ffmpeg to create video from all these images.


I try a lot and search almost all sites but fail. Here is my code.


Future<void> ConvertImageToVideo () async{
const String BASE_PATH = '/storage/emulated/0/Download/';
const String AUDIO_PATH = BASE_PATH + 'audiio.mp3';
const String IMAGE_PATH = BASE_PATH + 'image002.png';
const String OUTPUT_PATH = BASE_PATH + 'output02.mp4';
// final FlutterFFmpeg _flutterFFmpeg = FlutterFFmpeg();
if(await Permission.storage.request().isGranted){
 List<asset> resultlist = <asset>[];
 String commandToExecute =
 '-r 15 -f mp3 -i ${AUDIO_PATH} -f image2 -i ${resultlist} -y ${OUTPUT_PATH}';
 await FFmpegKit.execute(commandToExecute).then((session) async {
 final returnCode = await session.getReturnCode();
 final state = await session.getState();
 if (ReturnCode.isSuccess(returnCode)) {
 print("ruuning "+state.toString());
 print("video created " + returnCode.toString());
 } else if (ReturnCode.isCancel(returnCode)) {
 print("video cancel " + returnCode.toString());
 } else {
 print("error " );
 }
 });
}else if (await Permission.storage.isPermanentlyDenied) {
 openAppSettings();
}
</asset></asset></void>


}


-
FFmpeg image to video conversion error : [image2] Opening file for reading
14 février 2018, par user1690179I am running ffmpeg on an AWS Lambda instance. The Lambda function takes an input image and transcodes it into a video segment using ffmpeg :
ffmpeg -loop 1 -i /tmp/photo-SNRUR7ZS13.jpg -c:v libx264 -t 7.00 -pix_fmt yuv420p -vf scale=1280x720 /tmp/output.mp4
I am seeing inconsistent behavior where sometimes the output video is shorter than the specified duration. This happens inconsistently to random images. The same exact image sometimes renders correctly, and sometimes is cut short.
This behavior only happens on Lambda. I am not able to replicate this on my local computer, or on a dedicated EC2 instance with the same environment that runs on lambda.
I noticed that when the output video is short, the ffmpeg log is different. The main difference are repeated
[image2 @ 0x4b11140] Opening '/tmp/photo-2HD2Z3UN3W.jpg' for reading
lines. See ffmpeg logs below.Normal execution with the correct output video length :
ffmpeg -loop 1 -i /tmp/photo-SNRUR7ZS13.jpg -c:v libx264 -t 7.00 -pix_fmt yuv420p -vf scale=1280x720 /tmp/video-TMB6RNO0EE.mp4
ffmpeg version N-89773-g7fcbebbeaf-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.4.0 (Debian 6.4.0-11) 20171206
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 56. 7.100 / 56. 7.100
libavcodec 58. 9.100 / 58. 9.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 11.101 / 7. 11.101
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, image2, from '/tmp/photo-SNRUR7ZS13.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 18703 kb/s
Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 687x860 [SAR 200:200 DAR 687:860], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x5837900] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x51c2340] using SAR=1477/3287
[libx264 @ 0x51c2340] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x51c2340] profile High, level 3.1
[libx264 @ 0x51c2340] 264 - core 155 r61 b00bcaf - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/tmp/video-TMB6RNO0EE.mp4':
Metadata:
encoder : Lavf58.3.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 6183:13760 DAR 687:860], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc58.9.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 49 fps=0.0 q=28.0 size= 0kB time=-00:00:00.03 bitrate=N/A speed=N/A
frame= 69 fps= 66 q=28.0 size= 0kB time=00:00:00.76 bitrate= 0.5kbits/s speed=0.728x
frame= 89 fps= 57 q=28.0 size= 0kB time=00:00:01.56 bitrate= 0.2kbits/s speed=0.998x
frame= 109 fps= 53 q=28.0 size= 0kB time=00:00:02.36 bitrate= 0.2kbits/s speed=1.14x
frame= 129 fps= 50 q=28.0 size= 0kB time=00:00:03.16 bitrate= 0.1kbits/s speed=1.22x
frame= 148 fps= 48 q=28.0 size= 0kB time=00:00:03.92 bitrate= 0.1kbits/s speed=1.27x
frame= 168 fps= 47 q=28.0 size= 0kB time=00:00:04.72 bitrate= 0.1kbits/s speed=1.31x
No more output streams to write to, finishing.
frame= 175 fps= 39 q=-1.0 Lsize= 94kB time=00:00:06.88 bitrate= 112.2kbits/s speed=1.54x
video:91kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.161261%
Input file #0 (/tmp/photo-SNRUR7ZS13.jpg):
Input stream #0:0 (video): 176 packets read (16459168 bytes); 176 frames decoded;
Total: 176 packets (16459168 bytes) demuxed
Output file #0 (/tmp/video-TMB6RNO0EE.mp4):
Output stream #0:0 (video): 175 frames encoded; 175 packets muxed (93507 bytes);
Total: 175 packets (93507 bytes) muxed
[libx264 @ 0x51c2340] frame I:1 Avg QP:14.33 size: 73084
[libx264 @ 0x51c2340] frame P:44 Avg QP:14.09 size: 302
[libx264 @ 0x51c2340] frame B:130 Avg QP:23.31 size: 50
[libx264 @ 0x51c2340] consecutive B-frames: 0.6% 1.1% 0.0% 98.3%
[libx264 @ 0x51c2340] mb I I16..4: 3.3% 84.5% 12.1%
[libx264 @ 0x51c2340] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 3.2% 0.1% 0.0% 0.0% 0.0% skip:96.7%
[libx264 @ 0x51c2340] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.4% 0.0% 0.0% direct: 0.0% skip:99.6% L0:31.2% L1:68.8% BI: 0.0%
[libx264 @ 0x51c2340] 8x8 transform intra:84.5% inter:98.8%
[libx264 @ 0x51c2340] coded y,uvDC,uvAC intra: 95.1% 63.9% 51.6% inter: 0.1% 0.6% 0.0%
[libx264 @ 0x51c2340] i16 v,h,dc,p: 26% 21% 4% 49%
[libx264 @ 0x51c2340] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 27% 21% 3% 5% 6% 6% 4% 9%
[libx264 @ 0x51c2340] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 23% 36% 10% 4% 7% 5% 6% 2% 6%
[libx264 @ 0x51c2340] i8c dc,h,v,p: 51% 29% 16% 4%
[libx264 @ 0x51c2340] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x51c2340] ref P L0: 96.5% 0.0% 3.3% 0.2%
[libx264 @ 0x51c2340] ref B L0: 42.4% 57.6%
[libx264 @ 0x51c2340] ref B L1: 97.0% 3.0%
[libx264 @ 0x51c2340] kb/s:106.08Log from a short video :
ffmpeg -framerate 25 -y -loop 1 -i /tmp/photo-2HD2Z3UN3W.jpg -t 15.00 -filter_complex "[0:v]crop=h=ih:w='if(gt(a,16/9),ih*16/9,iw)':y=0:x='if(gt(a,16/9),(ow-iw)/2,0)'[tmp];[tmp]scale=-1:4000,crop=w=iw:h='min(iw*9/16,ih)':x=0:y='0.17*ih-((t/15.00)*min(0.17*ih,(ih-oh)/6))',trim=duration=15.00[tmp1];[tmp1]zoompan=z='if(lte(pzoom,1.0),1.15,max(1.0,pzoom-0.0005))':x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':d=1,setsar=sar=1:1[animated];[animated]fade=out:st=12.00:d=3.00:c=#000000[animated]" -map "[animated]" -pix_fmt yuv420p -s 1280x720 -y /tmp/video-QB1JCDT021.mp4
ffmpeg version N-89773-g7fcbebbeaf-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 6.4.0 (Debian 6.4.0-11) 20171206
configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
libavutil 56. 7.100 / 56. 7.100
libavcodec 58. 9.100 / 58. 9.100
libavformat 58. 3.100 / 58. 3.100
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 11.101 / 7. 11.101
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
libpostproc 55. 0.100 / 55. 0.100
Input #0, image2, from '/tmp/photo-2HD2Z3UN3W.jpg':
Duration: 00:00:00.04, start: 0.000000, bitrate: 373617 kb/s
Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 1936x2592 [SAR 72:72 DAR 121:162], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
Stream #0:0 (mjpeg) -> crop
fade -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[swscaler @ 0x4d63b40] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x4df7340] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x50e97c0] deprecated pixel format used, make sure you did set range correctly
[swscaler @ 0x50e97c0] Warning: data is not aligned! This can lead to a speed loss
[libx264 @ 0x4b17480] using SAR=1/1
[libx264 @ 0x4b17480] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x4b17480] profile High, level 3.1
[libx264 @ 0x4b17480] 264 - core 155 r61 b00bcaf - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/tmp/video-QB1JCDT021.mp4':
Metadata:
encoder : Lavf58.3.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc
Metadata:
encoder : Lavc58.9.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
[swscaler @ 0x5bd0380] deprecated pixel format used, make sure you did set range correctly
debug=1
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[image2 @ 0x4b11140] Opening '/tmp/photo-2HD2Z3UN3W.jpg' for reading
[AVIOContext @ 0x4b6ecc0] Statistics: 1868086 bytes read, 0 seeks
[mjpeg @ 0x4b14940] marker=d8 avail_size_in_buf=1868084
[mjpeg @ 0x4b14940] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x4b14940] marker=e0 avail_size_in_buf=1868082
[mjpeg @ 0x4b14940] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x4b14940] marker=db avail_size_in_buf=1868064
[mjpeg @ 0x4b14940] index=0
[mjpeg @ 0x4b14940] qscale[0]: 0
[mjpeg @ 0x4b14940] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x4b14940] marker=db avail_size_in_buf=1867995
[mjpeg @ 0x4b14940] index=1
[mjpeg @ 0x4b14940] qscale[1]: 1
[mjpeg @ 0x4b14940] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x4b14940] marker=c0 avail_size_in_buf=1867926
[mjpeg @ 0x4b14940] sof0: picture: 1936x2592
[mjpeg @ 0x4b14940] component 0 1:1 id: 0 quant:0
[mjpeg @ 0x4b14940] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x4b14940] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x4b14940] pix fmt id 11111100
[mjpeg @ 0x4b14940] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867907
[mjpeg @ 0x4b14940] class=0 index=0 nb_codes=11
[mjpeg @ 0x4b14940] marker parser used 30 bytes (240 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867875
[mjpeg @ 0x4b14940] class=1 index=0 nb_codes=242
[mjpeg @ 0x4b14940] marker parser used 82 bytes (656 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867791
[mjpeg @ 0x4b14940] class=0 index=1 nb_codes=8
[mjpeg @ 0x4b14940] marker parser used 27 bytes (216 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867762
[mjpeg @ 0x4b14940] class=1 index=1 nb_codes=241
[mjpeg @ 0x4b14940] marker parser used 51 bytes (408 bits)
[mjpeg @ 0x4b14940] escaping removed 7149 bytes
[mjpeg @ 0x4b14940] marker=da avail_size_in_buf=1867709
[mjpeg @ 0x4b14940] component: 0
[mjpeg @ 0x4b14940] component: 1
[mjpeg @ 0x4b14940] component: 2
[mjpeg @ 0x4b14940] marker parser used 1860559 bytes (14884468 bits)
[mjpeg @ 0x4b14940] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x4b14940] decode frame unused 0 bytes
[swscaler @ 0x5bd42c0] deprecated pixel format used, make sure you did set range correctly
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
[image2 @ 0x4b11140] Opening '/tmp/photo-2HD2Z3UN3W.jpg' for reading
[AVIOContext @ 0x4b6ecc0] Statistics: 1868086 bytes read, 0 seeks
[mjpeg @ 0x4b14940] marker=d8 avail_size_in_buf=1868084
[mjpeg @ 0x4b14940] marker parser used 0 bytes (0 bits)
[mjpeg @ 0x4b14940] marker=e0 avail_size_in_buf=1868082
[mjpeg @ 0x4b14940] marker parser used 16 bytes (128 bits)
[mjpeg @ 0x4b14940] marker=db avail_size_in_buf=1868064
[mjpeg @ 0x4b14940] index=0
[mjpeg @ 0x4b14940] qscale[0]: 0
[mjpeg @ 0x4b14940] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x4b14940] marker=db avail_size_in_buf=1867995
[mjpeg @ 0x4b14940] index=1
[mjpeg @ 0x4b14940] qscale[1]: 1
[mjpeg @ 0x4b14940] marker parser used 67 bytes (536 bits)
[mjpeg @ 0x4b14940] marker=c0 avail_size_in_buf=1867926
[mjpeg @ 0x4b14940] sof0: picture: 1936x2592
[mjpeg @ 0x4b14940] component 0 1:1 id: 0 quant:0
[mjpeg @ 0x4b14940] component 1 1:1 id: 1 quant:1
[mjpeg @ 0x4b14940] component 2 1:1 id: 2 quant:1
[mjpeg @ 0x4b14940] pix fmt id 11111100
[mjpeg @ 0x4b14940] marker parser used 17 bytes (136 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867907
[mjpeg @ 0x4b14940] class=0 index=0 nb_codes=11
[mjpeg @ 0x4b14940] marker parser used 30 bytes (240 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867875
[mjpeg @ 0x4b14940] class=1 index=0 nb_codes=242
[mjpeg @ 0x4b14940] marker parser used 82 bytes (656 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867791
[mjpeg @ 0x4b14940] class=0 index=1 nb_codes=8
[mjpeg @ 0x4b14940] marker parser used 27 bytes (216 bits)
[mjpeg @ 0x4b14940] marker=c4 avail_size_in_buf=1867762
[mjpeg @ 0x4b14940] class=1 index=1 nb_codes=241
[mjpeg @ 0x4b14940] marker parser used 51 bytes (408 bits)
[mjpeg @ 0x4b14940] escaping removed 7149 bytes
[mjpeg @ 0x4b14940] marker=da avail_size_in_buf=1867709
[mjpeg @ 0x4b14940] component: 0
[mjpeg @ 0x4b14940] component: 1
[mjpeg @ 0x4b14940] component: 2
[mjpeg @ 0x4b14940] marker parser used 1860559 bytes (14884468 bits)
[mjpeg @ 0x4b14940] marker=d9 avail_size_in_buf=0
[mjpeg @ 0x4b14940] decode frame unused 0 bytes
[swscaler @ 0x5bd8200] deprecated pixel format used, make sure you did set range correctly
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
...
...
...As requested, here is a link to the full log. In this log - ffmpeg renders only 323 out of 375 frames.
The
Opening '/tmp/photo-2HD2Z3UN3W.jpg'
segment repeats many many times until it finally renders out a short video. Does anyone have insight into why it keeps opening the image file ? This must have something to do with the underlying issue. -
why it is taking a lot of time to convert image to video in ffmpeg ?
20 avril 2021, par al pacinoBelow is a snippet of code i am using to convert images into videos but It is taking around 3 minutes to convert image to 5 second video.
If I run the command on Image present on a directory then it converts images to videos very swiftly. but i need to use try except to catch ConnectionError..
can anyone tell what I am doing wrong ?


video = []
video_list = []
for video in videos:
 try:
 r = requests.get(video, stream=True)
 print(r.status_code)
 if not r.status_code == 200:
 message = "broken url process could not be completed"
 return message
 if r.status_code == 200:
 if video.endswith(".jpg") or video.endswith(".png") or video.endswith(".jpeg"):
 filename = str(uuid.uuid4())
 url2 = download_path + filename +".webm"
 #cmd = "ffmpeg -loop 1 -i '{}' -c:v libx264 -t 5 -pix_fmt yuv420p -vf scale={}:{} ".format(video, width, height)+ url2
 cmd = "ffmpeg -loop 1 -i '{}' -t 5 -vf scale={}:{} ".format(video, width, height) + url2
 os.system(cmd)
 path_remover(video)
 video_list.append(url2)
 else:
 video_list.append(video)
 except ConnectionError:
 for i in video_list:
 path_remover(i)
 message = "broken url process could not be completed"
 return message



full log after running the command with online url :


ffmpeg -loop 1 -i 'https://cdn.pixabay.com/photo/2020/10/23/12/03/arch-5678549__340.jpg' -t 5 -vf scale=1280:780 output.mp4 


ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
 configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-cuda --enable-cuda-sdk --enable-cuvid --enable-libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libnpp --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, image2, from 'https://cdn.pixabay.com/photo/2021/04/17/18/26/woman-6186493__340.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 5538 kb/s
 Stream #0:0: Video: mjpeg (Progressive), yuvj420p(pc, bt470bg/unknown/unknown), 511x340 [SAR 1:1 DAR 511:340], 25 fps, 25 tbr, 25 tbn, 25 tbc
Stream mapping:
 Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x5580ac8e7c40] deprecated pixel format used, make sure you did set range correctly
[libx264 @ 0x5580ac186b40] using SAR=1034/1129
[libx264 @ 0x5580ac186b40] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 AVX512
[libx264 @ 0x5580ac186b40] profile High, level 3.2
[libx264 @ 0x5580ac186b40] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'output.mp4':
 Metadata:
 encoder : Lavf58.45.100
 Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuvj420p(pc), 1280x780 [SAR 19929:21760 DAR 511:340], q=-1--1, 25 fps, 12800 tbn, 25 tbc
 Metadata:
 encoder : Lavc58.91.100 libx264
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 100 fps=0.0 q=28.0 size= 0kB time=00:00:01.64 bitrate= 0.2kbits/frame= 125 fps=0.0 q=-1.0 Lsize= 90kB time=00:00:04.88 bitrate= 151.7kbits/s speed=6.79x 
video:88kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.618829%
[libx264 @ 0x5580ac186b40] frame I:1 Avg QP:16.31 size: 75247
[libx264 @ 0x5580ac186b40] frame P:31 Avg QP:16.13 size: 314
[libx264 @ 0x5580ac186b40] frame B:93 Avg QP:31.33 size: 49
[libx264 @ 0x5580ac186b40] consecutive B-frames: 0.8% 0.0% 0.0% 99.2%
[libx264 @ 0x5580ac186b40] mb I I16..4: 10.6% 77.6% 11.8%
[libx264 @ 0x5580ac186b40] mb P I16..4: 0.0% 0.0% 0.0% P16..4: 2.5% 0.2% 0.2% 0.0% 0.0% skip:97.2%
[libx264 @ 0x5580ac186b40] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 0.4% 0.0% 0.0% direct: 0.0% skip:99.6% L0: 8.3% L1:91.7% BI: 0.0%
[libx264 @ 0x5580ac186b40] 8x8 transform intra:77.5% inter:98.7%
[libx264 @ 0x5580ac186b40] coded y,uvDC,uvAC intra: 88.4% 95.3% 79.5% inter: 0.1% 0.5% 0.0%
[libx264 @ 0x5580ac186b40] i16 v,h,dc,p: 2% 3% 0% 95%
[libx264 @ 0x5580ac186b40] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 18% 7% 6% 11% 10% 10% 8% 8%
[libx264 @ 0x5580ac186b40] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 18% 7% 5% 16% 11% 9% 6% 4%
[libx264 @ 0x5580ac186b40] i8c dc,h,v,p: 33% 21% 22% 24%
[libx264 @ 0x5580ac186b40] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x5580ac186b40] ref P L0: 85.7% 0.1% 13.2% 1.0%
[libx264 @ 0x5580ac186b40] ref B L0: 53.6% 46.4%
[libx264 @ 0x5580ac186b40] ref B L1: 92.8% 7.2%
[libx264 @ 0x5580ac186b40] kb/s:143.20
aman@aman:~/Desktop/a$ ffmpeg -loop 1 -i 'https://cdn.pixabay.com/photo/2021/04/17/18/26/woman-6186493__340.jpg' -t 5 -vf scale=1280:780 output.webm
ffmpeg version n4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
 configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-cuda --enable-cuda-sdk --enable-cuvid --enable-libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libnpp --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
 libavutil 56. 51.100 / 56. 51.100
 libavcodec 58. 91.100 / 58. 91.100
 libavformat 58. 45.100 / 58. 45.100
 libavdevice 58. 10.100 / 58. 10.100
 libavfilter 7. 85.100 / 7. 85.100
 libswscale 5. 7.100 / 5. 7.100
 libswresample 3. 7.100 / 3. 7.100
 libpostproc 55. 7.100 / 55. 7.100
Input #0, image2, from 'https://cdn.pixabay.com/photo/2021/04/17/18/26/woman-6186493__340.jpg':
 Duration: 00:00:00.04, start: 0.000000, bitrate: 5538 kb/s
 Stream #0:0: Video: mjpeg (Progressive), yuvj420p(pc, bt470bg/unknown/unknown), 511x340 [SAR 1:1 DAR 511:340], 25 fps, 25 tbr, 25 tbn, 25 tbc
File 'output.webm' already exists. Overwrite? [y/N] y
Stream mapping:
 Stream #0:0 -> #0:0 (mjpeg (native) -> vp9 (libvpx-vp9))
Press [q] to stop, [?] for help
[swscaler @ 0x5630553879c0] deprecated pixel format used, make sure you did set range correctly
[libvpx-vp9 @ 0x563054cd2500] v1.7.0
[libvpx-vp9 @ 0x563054cd2500] Neither bitrate nor constrained quality specified, using default CRF of 32
Output #0, webm, to 'output.webm':
 Metadata:
 encoder : Lavf58.45.100
 Stream #0:0: Video: vp9 (libvpx-vp9), yuv420p, 1280x780 [SAR 19929:21760 DAR 511:340], q=-1--1, 25 fps, 1k tbn, 25 tbc
 Metadata:
 encoder : Lavc58.91.100 libvpx-vp9
 Side data:
 cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
frame= 57 fps=0.0 q=0.0 size= 1kB time=00:00:01.28 bitrate= 3.3kbits/sframe= 103 fps=102 q=0.0 size= 1kB time=00:00:03.12 bitrate= 1.3kbits/sframe= 125 fps= 85 q=0.0 Lsize= 51kB time=00:00:04.96 bitrate= 84.0kbits/s speed=3.37x 
video:50kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.571023%