
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (64)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Taille des images et des logos définissables
9 février 2011, parDans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...) -
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 (...)
Sur d’autres sites (3871)
-
Can FFmpeg crop gif image under 1 second ?
5 septembre 2021, par jeongbalmountainI am developing an iOS application about gif.


But I have a problem with gif cropping. Cropping gif spends so many times with FFmpeg.


(updated code)


These are the ffmpeg codes I've tried.


cropped images -> gif


ffmpeg -f image2 -i %d.jpg -vf 'scale=450:-1' output.gif



using concat command (cropped images -> gif)


ffmpeg -f concat -i tmp.txt output.gif



using crop filter


ffmpeg -i in.gif -filter:v "crop=out_w:out_h:x:y" out.gif



These codes are so slow when converting images to gif
or gif to cropped gif.


Is there a way to reduce the time to crop gif less than 1 second ?


(updated2)

ffmpeg -i in.gif -filter:v "crop=out_w:out_h:x:y" out.gif




ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers

built with Apple clang version 12.0.5 (clang-1205.0.22.9)

configuration : —prefix=/usr/local/Cellar/ffmpeg/4.4_2 —enable-shared





—enable-pthreads —enable-version3 —cc=clang —host-cflags= —host-ldflags= —enable-ffplay —enable-gnutls —enable-gpl —enable-libaom —enable-libbluray —enable-libdav1d —enable-libmp3lame —enable-libopus —enable-librav1e —enable-librubberband —enable-libsnappy —enable-libsrt —enable-libtesseract —enable-libtheora —enable-libvidstab —enable-libvorbis —enable-libvpx —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxml2 —enable-libxvid —enable-lzma —enable-libfontconfig —enable-libfreetype —enable-frei0r —enable-libass —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libspeex —enable-libsoxr —enable-libzmq —enable-libzimg —disable-libjack —disable-indev=jack —enable-avresample —enable-videotoolbox libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 /
58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 9.100 /
5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Input #0, gif, from './test.gif' : Duration : 00:00:18.27, start : 0.000000, bitrate : 70098 kb/s Stream #0:0 :
Video : gif, bgra, 1080x1920, 15 fps, 14.99 tbr, 100 tbn, 100 tbc
Stream mapping : Stream #0:0 -> #0:0 (gif (native) -> gif (native))
Press [q] to stop, [?] for help Output #0, gif, to './crop.gif' :

Metadata :
encoder : Lavf58.76.100 Stream #0:0 : Video : gif, bgr8(pc, progressive), 1080x1198, q=2-31, 200 kb/s, 14.99 fps, 100 tbn
Metadata :
encoder : Lavc58.134.100 gif frame= 1 fps=0.0 q=-0.0 size= 0kB time=00:00:00.01 bitrate= 0.0kbits/s speed=5e+03x





frame= 11 fps=0.0 q=-0.0 size= 4096kB time=00:00:00.68
bitrate=49344.8kbits/s speed=1.31x frame= 22 fps= 21 q=-0.0
size= 8192kB time=00:00:01.41 bitrate=47594.9kbits/s speed=1.32x

frame= 32 fps= 20 q=-0.0 size= 12288kB time=00:00:02.08
bitrate=48395.8kbits/s speed=1.32x frame= 43 fps= 20 q=-0.0
size= 16384kB time=00:00:02.81 bitrate=47764.3kbits/s speed=1.33x

frame= 54 fps= 20 q=-0.0 size= 20992kB time=00:00:03.55
bitrate=48441.3kbits/s speed=1.33x frame= 65 fps= 20 q=-0.0
size= 24832kB time=00:00:04.28 bitrate=47528.9kbits/s speed=1.35x

frame= 77 fps= 21 q=-0.0 size= 28928kB time=00:00:05.08
bitrate=46649.2kbits/s speed=1.36x frame= 87 fps= 21 q=-0.0
size= 32768kB time=00:00:05.75 bitrate=46684.4kbits/s speed=1.36x

frame= 98 fps= 21 q=-0.0 size= 36608kB time=00:00:06.48
bitrate=46279.7kbits/s speed=1.36x frame= 109 fps= 21 q=-0.0
size= 40704kB time=00:00:07.22 bitrate=46183.8kbits/s speed=1.37x

frame= 120 fps= 21 q=-0.0 size= 44800kB time=00:00:07.95
bitrate=46163.7kbits/s speed=1.37x frame= 131 fps= 21 q=-0.0
size= 49152kB time=00:00:08.69 bitrate=46335.2kbits/s speed=1.38x

frame= 142 fps= 21 q=-0.0 size= 53504kB time=00:00:09.42
bitrate=46529.2kbits/s speed=1.37x frame= 153 fps= 21 q=-0.0
size= 57344kB time=00:00:10.15 bitrate=46282.0kbits/s speed=1.38x

frame= 164 fps= 21 q=-0.0 size= 61184kB time=00:00:10.89
bitrate=46025.6kbits/s speed=1.38x frame= 174 fps= 21 q=-0.0
size= 65280kB time=00:00:11.55 bitrate=46300.8kbits/s speed=1.37x

frame= 185 fps= 21 q=-0.0 size= 69376kB time=00:00:12.29
bitrate=46243.1kbits/s speed=1.38x frame= 196 fps= 21 q=-0.0
size= 72960kB time=00:00:13.02 bitrate=45905.4kbits/s speed=1.38x

frame= 207 fps= 21 q=-0.0 size= 76544kB time=00:00:13.76
bitrate=45570.4kbits/s speed=1.38x frame= 218 fps= 21 q=-0.0
size= 80640kB time=00:00:14.49 bitrate=45590.3kbits/s speed=1.38x

frame= 229 fps= 21 q=-0.0 size= 84224kB time=00:00:15.23
bitrate=45302.9kbits/s speed=1.39x frame= 240 fps= 21 q=-0.0
size= 88064kB time=00:00:15.96 bitrate=45201.8kbits/s speed=1.39x

frame= 250 fps= 21 q=-0.0 size= 91648kB time=00:00:16.63
bitrate=45146.1kbits/s speed=1.39x frame= 261 fps= 21 q=-0.0
size= 96000kB time=00:00:17.36 bitrate=45301.4kbits/s speed=1.38x

frame= 271 fps= 21 q=-0.0 size= 99840kB time=00:00:18.03
bitrate=45362.7kbits/s speed=1.38x frame= 274 fps= 21 q=-0.0
Lsize= 101552kB time=00:00:18.23 bitrate=45634.2kbits/s speed=1.37x

video:101552kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead : 0.000019%



it takes 12 seconds


-
Spaces in FFMPEG Input Thwart Execution
2 septembre 2021, par WoolwitWhat's so baffling, is why spaces in the audio input seem to work fine, but spaces in the video input break things.
This fetches random images from a directory, pairs them with random audio clips and joins them into an mp4 video.


def makeAudioImgMovs():
 randImgs = getImgs()
 compAudClips = makeAudioClips()
 audioJpgs = dict(zip(randImgs,compAudClips)) #Heres where we join the completed audio clips and the jpgs into a dict
 for jpg, aud in audioJpgs.items():
 print(f'The img is {jpg}, the type of the img is {type(jpg)} the aud is {aud} the type of the aud is {type(aud)}')
 subprocess.call('ffmpeg -hide_banner -loglevel error -loop 1 -i "{0}" -i "{1}"\
 -filter:v \
 "fade=in:st=0:d=1, fade=out:st=10:d=1,scale=720:480:force_original_aspect_ratio=decrease,pad=720:480:(ow-iw)/2:(oh-ih)/2,setsar=1" \
 -filter:a "afade=in:st=0:d=1, afade=out:st=10:d=1" \
 -c:v libx264 -t 11 -pix_fmt yuv420p -preset faster -shortest -c:a aac {2}.mp4'.format(jpg,aud,timePath/(pathlib.Path(jpg).stem)),shell=True)
makeAudioImgMovs()



The print statement is writing what is in the dict of audioJpgs list. For example...


The img is 2021-09-02-1-40/ponty_me.jpg, the type of the img is
the aud is 2021-09-02-1-40/Jms Brn like it is like it was.aiff the type of the aud is 

The img is 2021-09-02-1-40/1966taxiToMassFromMomBack 2.tiff, the type of the img is
the aud is 2021-09-02-1-40/Lola_Fay.mp3 the type of the aud is 

[NULL @ 0x7fe503021400] Unable to find a suitable output format for '2021-09-02-1-40/1966taxiToMassFromMomBack'
2021-09-02-1-40/1966taxiToMassFromMomBack : Invalid argument


The img is 2021-09-02-1-40/1966taxiToMassFromMomBack 5.tiff, the type of the img is
the aud is 2021-09-02-1-40/M Miller Lonnie's Lament.aiff the type of the aud is 

[NULL @ 0x7fd32a854c00] Unable to find a suitable output format for '2021-09-02-1-40/1966taxiToMassFromMomBack'
2021-09-02-1-40/1966taxiToMassFromMomBack : Invalid argument


The img is 2021-09-02-1-40/10_021390_danny ? 1_jpg.jpg, the type of the img is
the aud is 2021-09-02-1-40/i_got_to_rock.mp3 the type of the aud is 

[NULL @ 0x7f8449835800] Unable to find a suitable output format for '2021-09-02-1-40/10_021390_danny ?'
2021-09-02-1-40/10_021390_danny ? : Invalid argument


The img is 2021-09-02-1-40/11_021390_danny_2_jpg.jpg, the type of the img is
the aud is 2021-09-02-1-40/M Miller Power.aiff the type of the aud is 

The last pair of img/aud complete fine and write an mp4. Notice there, that the audio file has spaces in it !
Notice that the errors 'Invalid argument' get thrown where there is a space in the jpg file name.


Help greatly appreciated.


-
ffmpeg - Convert files but keep Same Date Modification as Original ?
9 septembre 2021, par user5894146So I want to start with that ffmpeg and powershell isn't really my strength but I have been using the following powershell command to convert every .flac file in a certain directory to a 320K file.


dir *.flac | foreach {ffmpeg -i $_.FullName -c:v copy -b:a 320k $_.FullName.Replace('flac', 'mp3')}



This works exactly how I want to without any album art being transcoded but I want to incorporate a way so that the new .mp3 files that are created have the SAME DATE MODIFICATION value of the .flac files. Is something like this even possible ?


audio_ex.flac = Date Modification: 1/1/2010
audio_ex.mp3 = Date Modification: 9/8/2021



should be instead


audio_ex.flac = Date Modification: 1/1/2010
audio_ex.mp3 = Date Modification: 1/1/2010



I have a folder of 6K files and want each original date modified to match the newly created files so if I can do the above command and also have the date mod time match within one execution, that would be ideal.


I thought of manually changing each files mod time using 3rd party tools but it will be too time consuming.