Recherche avancée

Médias (1)

Mot : - Tags -/framasoft

Autres articles (97)

  • 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 (...)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-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

Sur d’autres sites (12294)

  • 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 ?

    


  • Revision 223bf29307 : libyuv : update to r1305 MIPS build fixes https://code.google.com/p/webm/issues

    3 mars 2015, par Johann

    Changed Paths :
     Modify /third_party/libyuv/README.libvpx


     Modify /third_party/libyuv/include/libyuv/compare.h


     Modify /third_party/libyuv/include/libyuv/convert.h


     Modify /third_party/libyuv/include/libyuv/convert_argb.h


     Modify /third_party/libyuv/include/libyuv/convert_from.h


     Modify /third_party/libyuv/include/libyuv/convert_from_argb.h


     Delete /third_party/libyuv/include/libyuv/format_conversion.h


     Modify /third_party/libyuv/include/libyuv/row.h


     Modify /third_party/libyuv/include/libyuv/scale.h


     Modify /third_party/libyuv/include/libyuv/scale_row.h


     Modify /third_party/libyuv/include/libyuv/version.h


     Modify /third_party/libyuv/include/libyuv/video_common.h


     Modify /third_party/libyuv/source/compare.cc


     Modify /third_party/libyuv/source/compare_neon.cc


     Add /third_party/libyuv/source/compare_neon64.cc


     Modify /third_party/libyuv/source/compare_posix.cc


     Modify /third_party/libyuv/source/compare_win.cc


     Modify /third_party/libyuv/source/convert.cc


     Modify /third_party/libyuv/source/convert_argb.cc


     Modify /third_party/libyuv/source/convert_from.cc


     Modify /third_party/libyuv/source/convert_from_argb.cc


     Modify /third_party/libyuv/source/convert_to_argb.cc


     Modify /third_party/libyuv/source/convert_to_i420.cc


     Modify /third_party/libyuv/source/cpu_id.cc


     Delete /third_party/libyuv/source/format_conversion.cc


     Modify /third_party/libyuv/source/mjpeg_validate.cc


     Modify /third_party/libyuv/source/planar_functions.cc


     Modify /third_party/libyuv/source/rotate.cc


     Modify /third_party/libyuv/source/rotate_argb.cc


     Modify /third_party/libyuv/source/rotate_neon.cc


     Add /third_party/libyuv/source/rotate_neon64.cc


     Modify /third_party/libyuv/source/row_any.cc


     Modify /third_party/libyuv/source/row_common.cc


     Modify /third_party/libyuv/source/row_mips.cc


     Modify /third_party/libyuv/source/row_neon.cc


     Modify /third_party/libyuv/source/row_neon64.cc


     Modify /third_party/libyuv/source/row_posix.cc


     Modify /third_party/libyuv/source/row_win.cc


     Modify /third_party/libyuv/source/scale.cc


     Modify /third_party/libyuv/source/scale_argb.cc


     Modify /third_party/libyuv/source/scale_common.cc


     Modify /third_party/libyuv/source/scale_neon.cc


     Modify /third_party/libyuv/source/scale_neon64.cc


     Modify /third_party/libyuv/source/scale_posix.cc


     Modify /third_party/libyuv/source/scale_win.cc


     Modify /third_party/libyuv/source/video_common.cc



    libyuv : update to r1305

    MIPS build fixes

    https://code.google.com/p/webm/issues/detail?id=957

    Change-Id : I9d53900af36d783c369b5dff27a7479cb94fd16b

  • Capture Video with opencv, save to ffmpeg pipe and live stream

    9 mars 2018, par Chris

    The goal is to stream an analysed live video over RTSP to some media server. To make the edits/analysis I use opencv, save the edited frames as JPEG in an FFMPEG image pipe and use the same FFMPEG to create a RTSP stream. Sorry if the terminology is not that accurate, I find it still quite confusing.

    I have the following code after quite some struggle :

    import cv2
    from subprocess import Popen, PIPE
    from PIL import Image

    # open pipe
    p = Popen('ffmpeg -y -f image2pipe -vcodec mjpeg -r 24 -i - -vcodec h264 -f rtsp -rtsp_transport tcp rtsp://localhost:8081/test.sdp', stdin=PIPE)

    video = cv2.VideoCapture(0)
    i = 0
    while video.isOpened():
       i=i+1
       ret, frame = video.read()
       if ret:
           #[...do some analysis stuff]
           im = Image.fromarray(frame)
           im.save(p.stdin, 'JPEG')

           """
           alternatively
           img_str = cv2.imencode('.jpg', frame)[1].tostring()
           p.stdin.write(img_str)
           """

       else:
           break

       print (i)
       if(i==1000):
           break


    p.stdin.close()
    p.wait()
    video.release()
    cv2.destroyAllWindows()
    print("done streaming video")

    This runs for 124 frames (i=124) then the loop hangs and I get some message from ffmpeg where I am not sure what it is about, however it does not look like an error :

    push frame
    122
    push frame
    123
    push frame
    124
    Input #0, image2pipe, from 'pipe:':
     Duration: N/A, bitrate: N/A
       Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 640x480 [SAR 1:1 DAR 4:3], 24 fps, 24 tbr, 24 tbn, 24 tbc
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
    [libx264 @ 000002076650d980] using SAR=1/1
    [libx264 @ 000002076650d980] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 000002076650d980] profile High, level 3.0
    [libx264 @ 000002076650d980] 264 - core 155 r2893 b00bcaf - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=24 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    push frame

    The webcam seems to continue running but no more frames are pushed into the pipe. It looks like some buffer is filled or something. If I write directly to a video file instead of rtsp, it works. If I open the rtsp stream simultaneously with ffplay, it also works (although with a 5 seconds lag).
    Anyone an idea where this is coming from and how to solve it ?