Recherche avancée

Médias (2)

Mot : - Tags -/map

Autres articles (61)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 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, par

    MediaSPIP 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 2013

    Jolie 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 freshITmeat

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

    &#xA;

    Full code when I use it :

    &#xA;

    def slice_samples(track_path: list, save_path: str,&#xA;                  sample_folder_name: str, interval: float, given_format, name: str = "part", export_format = &#x27;wav&#x27;):&#xA;    """&#xA;    This metod slice given track to parts.&#xA;    :param track_path: str, a path to the track you want to slice&#xA;    :param save_path: str, a path to folder, where you want save sliced tracks&#xA;    :param sample_folder_name: str, you don&#x27;t need to create a folder for sliced tracks,&#xA;    you can just write the name of the folder in this argument where you want to save tracks&#xA;    :param interval: float, measure in seconds, the length of sliced tracks&#xA;    :param name: str, name of sliced tacks&#xA;    :param given_format: str, I strongly recommend use .wav format initially, when you record sounds&#xA;    :return: folder with sliced tracks&#xA;    """&#xA;&#xA;    # it cuts a file in mp3 or wav formats (wav recommended)&#xA;&#xA;    interval_secs = interval * 10 ** 3&#xA;    raw_sound = None&#xA;    if given_format == "WAV":&#xA;        raw_sound = pydub.AudioSegment.from_wav(file=track_path)&#xA;    elif given_format == "MP3":&#xA;        raw_sound = pydub.AudioSegment.from_mp3(file=track_path)&#xA;    else:&#xA;        raise Exception("It&#x27;s temporarily unsupported given_format: " &#x2B; given_format)&#xA;    start = 0&#xA;    end = interval_secs&#xA;    i = 0&#xA;    while end &lt; len(raw_sound):&#xA;        save_to = save_path &#x2B; sample_folder_name &#x2B; "/" &#x2B; name &#x2B; str(i)&#xA;        part = raw_sound[start:end]&#xA;        part.export(save_to, format=export_format)&#xA;        i &#x2B;= 1&#xA;        start &#x2B;= interval_secs&#xA;        end &#x2B;= interval_secs&#xA;    return save_path &#x2B; sample_folder_name&#xA;&#xA;def slice_all_in_a_dir(tracks_folder: str):&#xA;    files = os.listdir(tracks_folder)&#xA;    for file in files:&#xA;        folder_name = file.split(&#x27;.&#x27;)&#xA;        f_name = folder_name[0]&#xA;        file = tracks_folder&#x2B;&#x27;/&#x27;&#x2B;file&#xA;        file = os.path.abspath(file)&#xA;        slice_samples(track_path= [file],&#xA;                      save_path= PATH_FOR_SLICED,&#xA;                      sample_folder_name= f_name,&#xA;                      interval=5,&#xA;                      given_format=folder_name[1])&#xA;&#xA;if __name__ == "__main__":&#xA;    slice_all_in_a_dir(&#x27;May 27 2020 LNC/Hydrophone 1/raw_records&#x27;)&#xA;

    &#xA;

  • FFmpeg psycho-visual options - psy-rdoq

    7 avril 2020, par SLVR

    I'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

    &#xA;&#xA;

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

    &#xA;&#xA;

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

    &#xA;&#xA;

    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&#xA;

    &#xA;&#xA;

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

    &#xA;&#xA;

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

    &#xA;&#xA;

    How do I solve this issue

    &#xA;

  • FFmpeg return 'invalid argument' only for some runs, even though it is the same code

    20 septembre 2021, par Gustavo Marinho

    I have code in Python where I need to use FFmpeg to merge an audio and a video downloaded using pytube together :

    &#xA;

    for video in p.videos:&#xA;    video.streams.filter(file_extension=&#x27;mp4&#x27;,resolution=&#x27;480p&#x27;)[0].download(parent_dir&#x2B;&#x27;/mp4/processing/video&#x27;)&#xA;    print(video.streams.filter(only_audio=True)[1].download(parent_dir&#x2B;&#x27;/mp4/processing/audio&#x27;))&#xA;&#xA;    subprocess.run([&#xA;&#xA;        r&#x27;c:\FFmpeg\bin\ffmpeg&#x27;, &#x27;-i&#x27;,&#xA;        os.path.join(parent_dir&#x2B;&#x27;/mp4/processing/video&#x27;,video.streams.filter(file_extension=&#x27;mp4&#x27;,resolution=&#x27;480p&#x27;)[0].default_filename)&#xA;        ,&#x27;-i&#x27;,&#xA;        os.path.join(parent_dir&#x2B;&#x27;/mp4/processing/audio&#x27;,video.streams.filter(only_audio=True)[1].default_filename),&#xA;        &#x27;-c:v&#x27;,&#x27;copy&#x27;,&#x27;-c:a&#x27;,&#x27;copy&#x27;,&#xA;        os.path.join(parent_dir&#x2B;&#x27;/mp4&#x27;,video.streams.filter(file_extension=&#x27;mp4&#x27;,resolution=&#x27;480p&#x27;)[0].title&#x2B;&#x27;.mp4&#x27;)&#xA;&#xA;    ])&#xA;

    &#xA;

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

    &#xA;

    ffmpeg version 4.4-full_build-www.gyan.dev Copyright (c) 2000-2021 the FFmpeg developers&#xA;  built with gcc 10.2.0 (Rev6, Built by MSYS2 project)&#xA;  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&#xA;  libavutil      56. 70.100 / 56. 70.100&#xA;  libavcodec     58.134.100 / 58.134.100&#xA;  libavformat    58. 76.100 / 58. 76.100&#xA;  libavdevice    58. 13.100 / 58. 13.100&#xA;  libavfilter     7.110.100 /  7.110.100&#xA;  libswscale      5.  9.100 /  5.  9.100&#xA;  libswresample   3.  9.100 /  3.  9.100&#xA;  libpostproc    55.  9.100 / 55.  9.100&#xA;Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;D:/videos/mp4/processing/video\Dropkick Murphys - Rose Tattoo (Video).mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : dash&#xA;    minor_version   : 0&#xA;    compatible_brands: iso6avc1mp41&#xA;    creation_time   : 2020-04-04T10:16:52.000000Z&#xA;  Duration: 00:05:26.08, start: 0.000000, bitrate: 557 kb/s&#xA;  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)&#xA;    Metadata:&#xA;      creation_time   : 2020-04-04T10:16:52.000000Z&#xA;      handler_name    : ISO Media file produced by Google Inc.&#xA;      vendor_id       : [0][0][0][0]&#xA;Input #1, mov,mp4,m4a,3gp,3g2,mj2, from &#x27;D:/videos/mp4/processing/audio\Dropkick Murphys - Rose Tattoo (Video).mp4&#x27;:&#xA;  Metadata:&#xA;    major_brand     : dash&#xA;    minor_version   : 0&#xA;    compatible_brands: iso6mp41&#xA;    creation_time   : 2020-04-04T10:16:00.000000Z&#xA;  Duration: 00:05:26.12, start: 0.000000, bitrate: 129 kb/s&#xA;  Stream #1:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 3 kb/s (default)&#xA;    Metadata:&#xA;      creation_time   : 2020-04-04T10:16:00.000000Z&#xA;      handler_name    : ISO Media file produced by Google Inc.&#xA;      vendor_id       : [0][0][0][0]&#xA;D:/videos/mp4\Dropkick Murphys - "Rose Tattoo" (Video).mp4: Invalid argument&#xA;

    &#xA;

    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.

    &#xA;