Recherche avancée

Médias (91)

Autres articles (102)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • L’agrémenter visuellement

    10 avril 2011

    MediaSPIP est basé sur un système de thèmes et de squelettes. Les squelettes définissent le placement des informations dans la page, définissant un usage spécifique de la plateforme, et les thèmes l’habillage graphique général.
    Chacun peut proposer un nouveau thème graphique ou un squelette et le mettre à disposition de la communauté.

  • Possibilité de déploiement en ferme

    12 avril 2011, par

    MediaSPIP peut être installé comme une ferme, avec un seul "noyau" hébergé sur un serveur dédié et utilisé par une multitude de sites différents.
    Cela permet, par exemple : de pouvoir partager les frais de mise en œuvre entre plusieurs projets / individus ; de pouvoir déployer rapidement une multitude de sites uniques ; d’éviter d’avoir à mettre l’ensemble des créations dans un fourre-tout numérique comme c’est le cas pour les grandes plate-formes tout public disséminées sur le (...)

Sur d’autres sites (8056)

  • Can ffmpeg copy metadata/ID3 from FLAC to MP3 ?

    9 avril 2019, par krypterro

    I have a bit of Python code that loops through audio files, finds .FLAC files, and then uses the Python subcommand to run ffmpeg. It works. The audio is fine, but even though I see the metadata in the shell, it doesn’t transfer the data to the ID3 tags in the MP3, and I am using the example found in the previous post here. Here’s the command :

    cmd = 'ffmpeg -y -i "' + src + '" -codec:a libmp3lame -q:a 0 -map_metadata 0 -id3v2_version 3 -write_id3v1 1 "' + dst + '"'

    Which works out to :

    ffmpeg -y -i "source.flac" -codec:a libmp3lame -q:a 0 -map_metadata 0 -id3v2_version 3 -write_id3v1 1 "destination.mp3"

    And here is the log dump :

    /usr/local/bin/python3.7 /home/krypterro/PycharmProjects/mediaman/RipFLAC.py
    1 Music Files Found
    2019-04-09 14:32:47.758 | INFO     | __main__:main:31 - Start of program
    2019-04-09 14:32:48.110 | DEBUG    | __main__:ripmp3:206 - Running Command: ffmpeg -y -i "/home/krypterro/audio/music_in/Visions/01-grimes-laughing_and_not_being_normal.flac" -acodec libmp3lame -ab 192000 "/home/krypterro/audio/music_out/Visions/01-grimes-laughing_and_not_being_normal.mp3"
    ffmpeg version 3.4.4-0ubuntu0.18.04.1 Copyright (c) 2000-2018 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
    Input #0, flac, from '/home/krypterro/audio/music_in/Visions/01-grimes-laughing_and_not_being_normal.flac':
     Metadata:
       ARTIST          : Grimes
       TITLE           : Laughing And Not Being Normal
       ALBUM           : Art Angels
       DATE            : 2015
       track           : 1
       GENRE           : Electronic
       disc            : 1
       TOTALDISCS      : 1
       TOTALTRACKS     : 15
       LANGUAGE        : English
       RIP DATE        : 2015-12-12
       RETAIL DATE     : 2015-00-00
       MEDIA           : CD
       ENCODER         : FLAC 1.2.1 -8 -V
       RIPPING TOOL    : EAC 1.0 Beta 3
       RELEASE TYPE    : Retail
       ORGANIZATION    : 4AD
       CATALOG         : CAD3535CD
     Duration: 00:01:47.51, start: 0.000000, bitrate: 743 kb/s
       Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    Stream mapping:
     Stream #0:0 -> #0:0 (flac (native) -> mp3 (libmp3lame))
    Press [q] to stop, [?] for help
    Output #0, mp3, to '/home/krypterro/audio/music_out/Visions/01-grimes-laughing_and_not_being_normal.mp3':
     Metadata:
       TPE1            : Grimes
       TIT2            : Laughing And Not Being Normal
       TALB            : Art Angels
       TDRC            : 2015
       TRCK            : 1
       TCON            : Electronic
       TPOS            : 1
       TOTALDISCS      : 1
       TOTALTRACKS     : 15
       TLAN            : English
       RIP DATE        : 2015-12-12
       RETAIL DATE     : 2015-00-00
       MEDIA           : CD
       CATALOG         : CAD3535CD
       RIPPING TOOL    : EAC 1.0 Beta 3
       RELEASE TYPE    : Retail
       ORGANIZATION    : 4AD
       TSSE            : Lavf57.83.100
       Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p, 192 kb/s
       Metadata:
         encoder         : Lavc57.107.100 libmp3lame
    size=    2522kB time=00:01:47.52 bitrate= 192.1kbits/s speed=  41x    
    video:0kB audio:2521kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.042501%
    2019-04-09 14:32:50.811 | INFO     | __main__:main:73 - End of program

    Process finished with exit code 0
  • Why are rectangular boxes ([]) showing instead of text in burned subtitles when using ffmpeg/MoviePy on Google Colab ?

    14 mai, par Lavish

    I'm working on a Python script that adds subtitles to a video using MoviePy and burns/hardcodes them directly onto the video. The subtitles contain Hindi text, and I’ve specified a custom font that supports Devanagari (Hindi) script.

    


    The code works perfectly fine on my local machine, the subtitles appear correctly with Hindi characters. However, when I run the same code on Google Colab, the subtitles display as rectangular boxes (something like this -> [][][]) instead of proper characters.

    


    Things I've tried :

    


      

    • Ensured the font used supports Hindi (I'm using NotoSansDevanagari-Regular.ttf renamed as font.ttf).
    • 


    • Uploaded the font to Colab and specified the full path correctly.
    • 


    • Verified that the text is passed as a proper Unicode string.
    • 


    


    Here's the code snippet :

    


    def add_subtitles(video_path, subtitles_path, output_path):
    """Adds subtitles using FFmpeg with proper path escaping."""
    # Convert to absolute paths and normalize
    
    video_path = os.path.abspath(video_path)
    subtitles_path = os.path.abspath(subtitles_path)
    output_path = os.path.abspath(output_path)


    # Subtitle path
    font_path = "input_files/font.ttf"
    font_path = os.path.abspath(font_path).replace("\\", "\\\\")
    subtitles_path_escaped = os.path.abspath(subtitles_path).replace("\\", "\\\\")
    
    # Escape backslashes in paths
    subtitles_path = subtitles_path.replace("\\", "\\\\")
    # Remove all files in final_videos
    [os.remove(os.path.join(base_dir, "final_videos", f)) for f in os.listdir(os.path.join(base_dir, "final_videos")) if os.path.isfile(os.path.join(base_dir, "final_videos", f))]

    os.makedirs(os.path.dirname(output_path), exist_ok=True)
    escaped_path = subtitles_path.replace(':', '\\:').replace('\\', '\\\\')

    cmd = [
    "ffmpeg",
    "-i", video_path,
    "-vf", f"subtitles={escaped_path}:force_style='FontFile={font_path}'",
    "-c:v", "libx264",
    "-c:a", "copy",
    "-preset", "fast",
    "-crf", "22",
    output_path
]


    # Debug: Print the exact command being executed
    print("Executing:", " ".join(cmd))
    try:
        subprocess.run(cmd, check=True, capture_output=True, text=True)
        print(f"✅ Success! Output saved to: {output_path}")
    except subprocess.CalledProcessError as e:
        print(f"❌ FFmpeg failed with error:\n{e.stderr}")



    


    What could be causing this issue on Colab, and how can I get non-English subtitles (like Hindi) to render properly when burning subtitles using MoviePy/ffmpeg in a Colab environment ?

    


  • Error while extracting subtitle from mkv or m2ts to srt with FFmpeg

    14 février 2013, par user2071701

    I need to extract subtitles from different video files to .srt format (to use it in html5 video).
    I tried a lot of variant i found with google. But every time i get this error :

    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    I think, this error means that ffmpeg can decode source subtitle but cant encode it to .srt format. All codecs a enabled (i compiled the later ffmpeg version from git a few times with a different configuration).

    Here is the output :

       # /usr/local/bin/ffmpeg -i /var/video/sources/Balbesy1.m2ts -an -vn  -copyinkf -scodec srt -f srt -y  sub.srt
    ffmpeg version N-49947-g9f16cb9 Copyright (c) 2000-2013 the FFmpeg developers
     built on Feb 14 2013 14:26:10 with gcc 4.4.5 (Debian 4.4.5-8)
     configuration: --enable-encoder=dvdsub --enable-decoder=dvdsub --enable-decoder=pgssub --enable-encoder=srt --enable-decoder=srt --enable-encoder=srt --enable-decoder=srt
     libavutil      52. 17.101 / 52. 17.101
     libavcodec     54. 91.103 / 54. 91.103
     libavformat    54. 63.100 / 54. 63.100
     libavdevice    54.  3.103 / 54.  3.103
     libavfilter     3. 37.101 /  3. 37.101
     libswscale      2.  2.100 /  2.  2.100
     libswresample   0. 17.102 /  0. 17.102
    [mpegts @ 0x2719040] Stream #5: not enough frames to estimate rate; consider increasing probesize
    [mpegts @ 0x2719040] Could not find codec parameters for stream 5 (Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)): unspecified size
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    [NULL @ 0x271fec0] start time is not set in estimate_timings_from_pts
    Input #0, mpegts, from '/var/video/sources/Balbesy1.m2ts':
     Duration: 01:18:11.89, start: 599.958300, bitrate: 37378 kb/s
     Program 1
       Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
       Stream #0:1[0x1100]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), fltp, 768 kb/s
       Stream #0:2[0x1101]: Audio: dts (DTS-HD MA) ([134][0][0][0] / 0x0086), 48000 Hz, 5.1(side), fltp, 768 kb/s
       Stream #0:3[0x1102]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
       Stream #0:4[0x1103]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s
       Stream #0:5[0x1200]: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090)
    Output #0, srt, to 'sub.srt':
       Stream #0:0: Subtitle: srt
    Stream mapping:
     Stream #0:5 -> #0:0 (pgssub -> srt)
    Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    sorry for my english