
Recherche avancée
Autres articles (96)
-
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
MediaSPIP Core : La Configuration
9 novembre 2010, parMediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
Sur d’autres sites (8639)
-
Why AudioSegment doesn't read 'mp3' ?
22 octobre 2020, par freshITmeatI tried to read file that I give with absolute path.
When I run my code first that I see is this message :


D:\prog\datascience\anaconda\lib\site-packages\pydub\utils.py:170: RuntimeWarning: Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work
 warn("Couldn't find ffmpeg or avconv - defaulting to ffmpeg, but may not work", RuntimeWarning)



I tried this :


PATH_TO_FFMPEG = 'D:\\prog\\ffmpeg-win-2.2.2\\ffmpeg.exe'
pydub.AudioSegment.converter = r'D:\\prog\\ffmpeg-win-2.2.2\\ffmpeg.exe'



And I separately installed
ffmpeg
withpip
. But it didn't help.
When I try this :

raw_sound = pydub.AudioSegment.from_mp3(file=track_path)



where
track_path
is correct absolute path generated automatically.
So I got this this error :

Traceback (most recent call last):
 File "D:\prog\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\pydevd.py", line 1448, in _exec
 pydev_imports.execfile(file, globals, locals) # execute the script
 File "D:\prog\PyCharm Community Edition 2020.2.2\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
 exec(compile(contents+"\n", file, 'exec'), glob, loc)
 File "D:/testtask2/test_task/testtask/get_mffc.py", line 165, in <module>
 slice_all_in_a_dir('May 27 2020 LNC/Hydrophone 1/raw_records')
 File "D:/testtask2/test_task/testtask/get_mffc.py", line 70, in slice_all_in_a_dir
 slice_samples(track_path= [file],
 File "D:/testtask2/test_task/testtask/get_mffc.py", line 48, in slice_samples
 raw_sound = pydub.AudioSegment.from_mp3(file=track_path)
 File "D:\prog\datascience\anaconda\lib\site-packages\pydub\audio_segment.py", line 738, in from_mp3
 return cls.from_file(file, 'mp3', parameters=parameters)
 File "D:\prog\datascience\anaconda\lib\site-packages\pydub\audio_segment.py", line 680, in from_file
 stdin_data = file.read()
AttributeError: 'list' object has no attribute 'read'
python-BaseException
</module>


Full code when I use it :


def slice_samples(track_path: list, save_path: str,
 sample_folder_name: str, interval: float, given_format, name: str = "part", export_format = 'wav'):
 """
 This metod slice given track to parts.
 :param track_path: str, a path to the track you want to slice
 :param save_path: str, a path to folder, where you want save sliced tracks
 :param sample_folder_name: str, you don't need to create a folder for sliced tracks,
 you can just write the name of the folder in this argument where you want to save tracks
 :param interval: float, measure in seconds, the length of sliced tracks
 :param name: str, name of sliced tacks
 :param given_format: str, I strongly recommend use .wav format initially, when you record sounds
 :return: folder with sliced tracks
 """

 # it cuts a file in mp3 or wav formats (wav recommended)

 interval_secs = interval * 10 ** 3
 raw_sound = None
 if given_format == "WAV":
 raw_sound = pydub.AudioSegment.from_wav(file=track_path)
 elif given_format == "MP3":
 raw_sound = pydub.AudioSegment.from_mp3(file=track_path)
 else:
 raise Exception("It's temporarily unsupported given_format: " + given_format)
 start = 0
 end = interval_secs
 i = 0
 while end < len(raw_sound):
 save_to = save_path + sample_folder_name + "/" + name + str(i)
 part = raw_sound[start:end]
 part.export(save_to, format=export_format)
 i += 1
 start += interval_secs
 end += interval_secs
 return save_path + sample_folder_name

def slice_all_in_a_dir(tracks_folder: str):
 files = os.listdir(tracks_folder)
 for file in files:
 folder_name = file.split('.')
 f_name = folder_name[0]
 file = tracks_folder+'/'+file
 file = os.path.abspath(file)
 slice_samples(track_path= [file],
 save_path= PATH_FOR_SLICED,
 sample_folder_name= f_name,
 interval=5,
 given_format=folder_name[1])

if __name__ == "__main__":
 slice_all_in_a_dir('May 27 2020 LNC/Hydrophone 1/raw_records')



-
Anomalie #4546 : image_recadre perd l’EXIF de rotation
19 septembre 2020, par jluc -Le 19/07/2020, cerdic dit «
On pourrait envisager que conserver les exifs à travers chaque filtre image, mais c’est aussi dangereux du point de vue des données personnelles. Je verrais plutôt un filtre qui permettrait de recopier certains exifs d’une image source sur l’image finale, sur le mode :<span class="CodeRay">[(#FICHIER|image_reduire{…}|image_recadre{…}|image_copie_exif{#FICHIER,’author’})]
</span>
(syntaxe exacte à définir)
» -
Laravel FFMpeg - FFMpeg cannot edit existing files in-place
28 septembre 2020, par wlaskovicAfter I wanted to upload a video in the queue was returned a failed job.


[2020-09-25 13:24:25][125] Processing: App\Jobs\ConvertVideoForStreaming <br /> [2020-09-25 13:24:26][125] Failed: App\Jobs\ConvertVideoForStreaming



So I've took from the DB failed_jobs table the response and run the following :


C:\ffmpeg\bin\ffmpeg.exe -y -i "C:\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4" -threads 12 -vcodec libx264 -acodec libmp3lame -b:v 500k -refs 6 -coder 1 -sc_threshold 40 -flags +loop -me_range 16 -subq 7 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 1 -b:a 128k -vf "[in]scale=720:360 [out]" -pass 1 -passlogfile "C:\Users\wlask\AppData\Local\Temp\ffmpeg-passes5f6dd36a4519fd1fev/pass-5f6dd36a452c9" "C:\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4"



Which returned the following :


ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 10.2.1 (GCC) 20200726
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 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, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42mp41isomavc1
 creation_time : 2015-08-07T09:13:02.000000Z
 Duration: 00:00:30.53, start: 0.000000, bitrate: 411 kb/s
 Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 480x270 [SAR 1:1 DAR 16:9], 301 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
 Metadata:
 creation_time : 2015-08-07T09:13:02.000000Z
 handler_name : L-SMASH Video Handler
 encoder : AVC Coding
 Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 112 kb/s (default)
 Metadata:
 creation_time : 2015-08-07T09:13:02.000000Z
 handler_name : L-SMASH Audio Handler





Output C :\wamp64\www\laravel-stream\storage\app/public\WF3UL8fJTSE7BMxa.mp4 same as Input #0 - exiting


FFmpeg cannot edit existing files in-place.




This was returned after i've run the command from DB failed jobs table return.


How should I solve this ?