
Recherche avancée
Médias (2)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
Autres articles (61)
-
MediaSPIP version 0.1 Beta
16 avril 2011, parMediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...) -
MediaSPIP 0.1 Beta version
25 avril 2011, parMediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
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 (...) -
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...)
Sur d’autres sites (5553)
-
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')



-
FFmpeg psycho-visual options - psy-rdoq
7 avril 2020, par SLVRI'm new to encoding and I like to do my encodings in x265 10bit. Currently, I'm facing a little issue with ffmpeg. I noticed when I'm using libx265 encoder output file looks a little bit blurred or small detail loss. Code I used to do my encodes is



ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -c:a copy -y output-x26510bit.mkv




I've found out psycho-visual options might help in this case. I modified my code in to



ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -psy-rd 2 -psy-rdoq 4 --rdoq-level 1 -c:a copy -y output-x26510bit.mkv




When I issue the above command, I get an error code



C:\Users\abc\Desktop\1>ffmpeg -i input.mp4 -c:v libx265 -preset medium -crf 22 -pix_fmt yuv420p10le -psy-rd 2 -psy-rdoq
 4 -rdoq-level 1 -c:a copy -y output-x26510bit.mkv
ffmpeg version git-2020-04-03-52523b6 Copyright (c) 2000-2020 the FFmpeg developers
 built with gcc 9.3.1 (GCC) 20200328
 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enabl
e-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enabl
e-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-l
ibvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom
--enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --en
able-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
 libavutil 56. 42.102 / 56. 42.102
 libavcodec 58. 77.101 / 58. 77.101
 libavformat 58. 42.100 / 58. 42.100
 libavdevice 58. 9.103 / 58. 9.103
 libavfilter 7. 77.101 / 7. 77.101
 libswscale 5. 6.101 / 5. 6.101
 libswresample 3. 6.100 / 3. 6.100
 libpostproc 55. 6.100 / 55. 6.100
Unrecognized option 'psy-rdoq'.
Error splitting the argument list: Option not found




How do I solve this issue


-
FFmpeg return 'invalid argument' only for some runs, even though it is the same code
20 septembre 2021, par Gustavo MarinhoI have code in Python where I need to use FFmpeg to merge an audio and a video downloaded using pytube together :


for video in p.videos:
 video.streams.filter(file_extension='mp4',resolution='480p')[0].download(parent_dir+'/mp4/processing/video')
 print(video.streams.filter(only_audio=True)[1].download(parent_dir+'/mp4/processing/audio'))

 subprocess.run([

 r'c:\FFmpeg\bin\ffmpeg', '-i',
 os.path.join(parent_dir+'/mp4/processing/video',video.streams.filter(file_extension='mp4',resolution='480p')[0].default_filename)
 ,'-i',
 os.path.join(parent_dir+'/mp4/processing/audio',video.streams.filter(only_audio=True)[1].default_filename),
 '-c:v','copy','-c:a','copy',
 os.path.join(parent_dir+'/mp4',video.streams.filter(file_extension='mp4',resolution='480p')[0].title+'.mp4')

 ])



I thought the code was working perfectly, but in some cases, the FFmpeg returns "invalid argument", like this example :


ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10.2.0 (Rev6, Built by MSYS2 project)
 configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
 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
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'D:/videos/mp4/processing/video\Dropkick Murphys - Rose Tattoo (Video).mp4':
 Metadata:
 major_brand : dash
 minor_version : 0
 compatible_brands: iso6avc1mp41
 creation_time : 2020-04-04T10:16:52.000000Z
 Duration: 00:05:26.08, start: 0.000000, bitrate: 557 kb/s
 Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 854x480 [SAR 1:1 DAR 427:240], 7 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
 Metadata:
 creation_time : 2020-04-04T10:16:52.000000Z
 handler_name : ISO Media file produced by Google Inc.
 vendor_id : [0][0][0][0]
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'D:/videos/mp4/processing/audio\Dropkick Murphys - Rose Tattoo (Video).mp4':
 Metadata:
 major_brand : dash
 minor_version : 0
 compatible_brands: iso6mp41
 creation_time : 2020-04-04T10:16:00.000000Z
 Duration: 00:05:26.12, start: 0.000000, bitrate: 129 kb/s
 Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 3 kb/s (default)
 Metadata:
 creation_time : 2020-04-04T10:16:00.000000Z
 handler_name : ISO Media file produced by Google Inc.
 vendor_id : [0][0][0][0]
D:/videos/mp4\Dropkick Murphys - "Rose Tattoo" (Video).mp4: Invalid argument



For some reason, the FFmpeg say that my output name is invalid, but I don't understand why, given that I ran the code multiple times before and it worked perfectly.