
Recherche avancée
Autres articles (58)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Ajouter notes et légendes aux images
7 février 2011, parPour pouvoir ajouter notes et légendes aux images, la première étape est d’installer le plugin "Légendes".
Une fois le plugin activé, vous pouvez le configurer dans l’espace de configuration afin de modifier les droits de création / modification et de suppression des notes. Par défaut seuls les administrateurs du site peuvent ajouter des notes aux images.
Modification lors de l’ajout d’un média
Lors de l’ajout d’un média de type "image" un nouveau bouton apparait au dessus de la prévisualisation (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (7325)
-
Pydub wma to mp3 fixing "library configuration mismatch"
21 juillet 2020, par RichPython novice, looking to change that.


I am trying to convert a song from wma to mp3 while keeping the metadata on the song. Here is my code.


#musicproject.py
import os
import glob
from pydub import AudioSegment

music_dir ='/mnt/c/renameproject'
extension_list = ('*.wma')

os.chdir(music_dir)
for extension in extension_list:
 for song in glob.glob(extension):
 mp3_filename = os.path.splitext(os.path.basename(song))[0] + '.mp3'
 AudioSegment.from_file(song).export(mp3_filename, format='mp3')



The program finishes and the song is written as an mp3 in the same folder and plays just fine. Unfortunately all of the metadata has been stripped from the song. I get the following warning at the command line when I run the program. My theory on the problem is that there is a mismatch between pydub and ffmpeg as far as the metadata library goes so pydub is feeding in something that ffmpeg doesn't understand so it pukes. I have absolutely no idea what steps to take to fix it from here. Any breadcrumbs would be appreciated. Thanks.


File "./musicproject.py", line 12, in <module>
 AudioSegment.from_file(song).export(mp3_filename, format='mp3')
 File "/home/tom/.local/lib/python2.7/site-packages/pydub/audio_segment.py", line 725, in from_file
 p.returncode, p_err.decode(errors='ignore') ))
pydub.exceptions.CouldntDecodeError: Decoding failed. ffmpeg returned error code: 1

Output from ffmpeg/avlib:

ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
 configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy 
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 WARNING: library configuration mismatch
 avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
 libavutil 55. 78.100 / 55. 78.100
 libavcodec 57.107.100 / 57.107.100
 libavformat 57. 83.100 / 57. 83.100
 libavdevice 57. 10.100 / 57. 10.100
 libavfilter 6.107.100 / 6.107.100
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
musicproject.py: Invalid data found when processing input
</module>


-
How to create/repair the XingHeader for total stream size using taglib or other tools ?
6 novembre 2012, par user784637I downloaded a video from youtube whose audio was encoded in aac and then I transcoded it to an mp3 using the libmp3lame codec.
$ ffmpeg -i video.mp4 -vn -acodec libmp3lame -ab 128K -- cold.mp3
Now when I try to write id3 tags to it using the taglib example tagwriter I get the following warning :
$ ./testwriter -t 'stuff' cold.mp3
TagLib: MPEG::XingHeader::parse() -- Xing header doesn't contain the total stream size.The id3 tags are written and display correctly, but the lack of well formed XingHeaders causes older mp3 players to loop the song several times or even crash (I don't know why, this song has been encoded as cbr not vbr.) In windows 7 the Bit rate displays as 0kbps.
How do I create a wellformed XingHeader for total stream size using taglib or other tools that can be executed from the commandline ?
Here's some documentation for xingheaders on taglib
-
Batch File : How can I make input videos to be sequentially named in same loop
2 décembre 2022, par Ionut BejinariuI end up with the code in this form.


the first ffmpeg .. its working alone but not inside the second
For

that's why I made a second one, also I did this because I need to increment the Videos-*
to be beVideos-1.mp4, Videos-2.mp4 ... Videos-99.mp4
, all the videos are in %videodir% named like this.

I tried also
"%videodir%\Videos-%d.mp4"
also"%videodir%\*.mp4"
for videos to be sequentially named loop after loop, but not worked for me.

@echo off
setlocal enabledelayedexpansion
 
set "musicdir=F:\MONTAJ VIDEO\video-simplu\MUZICA-wav-mp3" 
set "videodir=F:\LUCRU-VIDEO\primele-15sec" 
set "exportdir=E:\Export-yt-shorts

for /l %%c in (1,1,2200) Do (
 
 ffmpeg -i "%videodir%\Videos-%%c.mp4" -i "%videodir%\Videos-%%c.mp4" -filter_complex "[0:v]scale=3413:1920,boxblur=4[bg];[1:v]scale=1080:-1[fg];[bg][fg]overlay=(W-w)/2:(H-h)/2[tmp];[tmp]crop=1080:1920:(3413-1080)/2:0[out]" -map [out] -map 0:a output01.mp4
 
)

 for %%A in ("%musicdir%\*") DO (
 ffmpeg -i output01.mp4 -i "%%A" -map 0:v -map 1:a -vcodec copy -c:a aac -b:a 320k -shortest "%exportdir%\%%~nA.mp4"
 del output01.mp4
 )





Can anyone help me on this ? Thank you
Later Edit :
I want to explain the logic I thought about the two
FOR


I have two folders.
— 1 folders with mp4 videos wide ratio 16/9 Full HD


are named like this ---> Videos-1.mp4, Videos-2.mp4 .. Videos-3.mp4 ... Videos-2200.mp4


and 1 folder with music mp3 and wav's


in first
for
its first mp4 export that I want to combine with first song from the secondfor
then second video with second song from folder. etc

in the end I want to have 9/16 ratio video