Recherche avancée

Médias (91)

Autres articles (49)

  • Emballe Médias : Mettre en ligne simplement des documents

    29 octobre 2010, par

    Le plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
    Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
    D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...)

  • 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

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (6365)

  • ffmpeg :how to apply animation in multiple images that will me merged in a video template in android

    1er mars 2023, par Pavan Ghanate

    I am trying to merge number of selected images from gallery to a video template in order to make video status or short video in a android app, I am able to merge the selected images in the video using below cammand now i want to add animation

    


     ArrayList<string> cmd2 = new ArrayList&lt;>();&#xA;    cmd2.add("-y");&#xA;    cmd2.add("-i");&#xA;    if (video_temp_path!= null){&#xA;        cmd2.add(video_temp_path);&#xA;    }else {&#xA;        cmd2.add(Environment.getExternalStorageDirectory().getPath()&#xA;                &#x2B; "/Download/happy.mp4");&#xA;    }&#xA;&#xA;&#xA;    for (int no = 0; no &lt; paths.length; no&#x2B;&#x2B;) {&#xA;        cmd2.add("-i");&#xA;&#xA;        cmd2.add(paths[no]);&#xA;&#xA;    }&#xA;&#xA;    cmd2.add("-filter_complex");&#xA;&#xA;&#xA;&#xA;    cmd2.add("[0][1]overlay=x=100:y=200:enable=&#x27;between(t,3,8)&#x27;[v1];" &#x2B;&#xA;            "[v1][2]overlay=x=100:y=200:enable=&#x27;between(t,10,15)&#x27;[v2];" &#x2B;&#xA;            "[v2][3]overlay=x=100:y=200:enable=&#x27;gt(t,17)&#x27;[v3]");&#xA;    cmd2.add("-map");&#xA;    cmd2.add("[v3]");&#xA;    cmd2.add("-map");&#xA;    cmd2.add( "0:a");&#xA;    cmd2.add(Environment.getExternalStorageDirectory().getPath()&#xA;            &#x2B; "/Download/output.mp4");&#xA;</string>

    &#xA;

    but now i want to add fade in out animation to images so I am using this cammand generated by chatgpt but its giving me error

    &#xA;

      ArrayList<string> cmd2 = new ArrayList&lt;>();&#xA;   cmd2.add("-y");&#xA;   cmd2.add("-i");&#xA;&#xA;   if (video_temp_path != null) {&#xA;    cmd2.add(video_temp_path);&#xA;  } else {&#xA;    cmd2.add(Environment.getExternalStorageDirectory().getPath() &#x2B;&#xA;            "/Download/happy.mp4");&#xA;}&#xA;&#xA;for (int no = 0; no &lt; paths.length; no&#x2B;&#x2B;) {&#xA;    cmd2.add("-loop");&#xA;    cmd2.add("1"); // loop the image&#xA;&#xA;    cmd2.add("-t");&#xA;    cmd2.add("5"); // duration of the image&#xA;&#xA;    cmd2.add("-i");&#xA;    cmd2.add(paths[no]);&#xA;&#xA;    cmd2.add("-filter_complex");&#xA;    cmd2.add("[1:v]fade=in:st=0:d=1[tin];" &#x2B;&#xA;            "[1:v]fade=out:st=4:d=1[tout];" &#x2B;&#xA;            "[0:v][tin]overlay=x=100:y=200" &#x2B;&#xA;            "[v1];" &#x2B;&#xA;            "[v1][tout]overlay=x=100:y=200:enable=&#x27;between(t,10,15)&#x27;[v2];" &#x2B;&#xA;            "[v2][2:v]overlay=x=100:y=200:enable=&#x27;gt(t,17)&#x27;[v3]");&#xA;&#xA;    cmd2.add("-map");&#xA;    cmd2.add("[v3]");&#xA;    cmd2.add("-map");&#xA;    cmd2.add("0:a");&#xA;}&#xA;&#xA;cmd2.add(Environment.getExternalStorageDirectory().getPath() &#x2B;&#xA;        "/Download/output.mp4");&#xA;</string>

    &#xA;

    error is

    &#xA;

     Option map (set input stream mapping) cannot be applied to input url /storage/emulated/0/Pictures/temp/1677570327312.jpg -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.&#xA;

    &#xA;

    2023-03-01 12:50:50.707 5950-6326/com.android.mergevideo E/mobile-ffmpeg : Error parsing options for input file /storage/emulated/0/Pictures/temp/1677570327312.jpg.&#xA;2023-03-01 12:50:50.707 5950-6326/com.android.mergevideo E/mobile-ffmpeg : Error opening input files :&#xA;2023-03-01 12:50:50.707 5950-6326/com.android.mergevideo E/mobile-ffmpeg : Invalid argument

    &#xA;

  • FFMPEG MP3 file size much larger than expected on Windows 10

    8 avril 2018, par The Gora

    I’ve been using FFMPEG on Windows to :

    1. Convert iTunes M4A files to MP3s (with a bit rate of 128k) ; and
    2. Create 30 sec sample MP3s of the above MP3s (same bit rate).

    When I run FFMEG on a Windows 7 64 bit machine, the size of the MP3s (both for 1. & 2.) is in line with the rough calculation of :

    (Audio length in seconds) X (Bit rate)

    For example, a 4 minute audio yields an approx. 3.7MB MP3 file ; a 30 second sample MP3 is approx. 470KB.

    However when I run the same FFMPEG binary (copied from the Windows 7 machine) on a Windows 10 64 bit machine, all of the MP3s (both for 1. and for 2.) are inflated by approx 5MB. I’m using the same batch file on both machines to execute FFMEG with the required parameters, so pretty confident the difference is not down to user error.

    My questions are :

    1. Why is there this apparent 5MB overhead on Windows 10 ? and more importantly ;
    2. What can I do to remove this ?

    The large file size is a problem as the sample MP3s are to be put on a website for people to listen to a snippet of the song, and the webpage with multiple tags takes a long time to load completely (several minutes).

    Here is the version and lib info :

    ffmpeg version 3.4.1 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 7.2.0 (GCC)
     configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --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-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
     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
     libswscale      4.  8.100 /  4.  8.100
     libswresample   2.  9.100 /  2.  9.100
     libpostproc    54.  7.100 / 54.  7.100

    And here are the command lines I’m using :

    1. ffmpeg -i input.m4a -id3v2_version 3 -b:a 128k -output.mp3
    2. ffmpeg -i input.m4a -ss 30 -t 30 -af "afade=in:st=30:d=5,afade=out:st=55:d=5" -id3v2_version 3 -b:a 128k -output.mp3
  • TypeError : expected str, bytes or os.PathLike object, not module when trying to sream openCv frames to rtmp server

    30 novembre 2022, par seriously

    I am using openCv and face-recognition api to detect a face using a webcam then compare it with a previously taken image to check and see if the people on both images are the same and the openCv and face-recognition part of the code works properly now what I am trying to achieve is to stream the openCv processed video frames to an rtmp server so for this I am trying to use ffmpeg and running the command using subprocess but when I run the code I get error TypeError: expected str, bytes or os.PathLike object, not module. But I am writing the frames as bytes to stdin hence p.stdin.write(frame.tobytes()). How can I fix it and properly stream my openCv frames to an rtmp server using ffmpeg. Thanks in advance.

    &#xA;

    Traceback (most recent call last):&#xA;  File "C:\Users\blah\blah\test.py", line 52, in <module>&#xA;    p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)&#xA;  File "C:\Python310\lib\subprocess.py", line 969, in __init__&#xA;    self._execute_child(args, executable, preexec_fn, close_fds,&#xA;  File "C:\Python310\lib\subprocess.py", line 1378, in _execute_child&#xA;    args = list2cmdline(args)&#xA;  File "C:\Python310\lib\subprocess.py", line 561, in list2cmdline&#xA;    for arg in map(os.fsdecode, seq):&#xA;  File "C:\Python310\lib\os.py", line 822, in fsdecode&#xA;    filename = fspath(filename)  # Does type-checking of `filename`.&#xA;TypeError: expected str, bytes or os.PathLike object, not module&#xA;</module>

    &#xA;

    import cv2&#xA;import numpy as np&#xA;import face_recognition&#xA;import os&#xA;import subprocess&#xA;import ffmpeg&#xA;&#xA;path = &#x27;../attendance_imgs&#x27;&#xA;imgs = []&#xA;classNames = []&#xA;myList = os.listdir(path)&#xA;&#xA;for cls in myList:&#xA;    curruntImg = cv2.imread(f&#x27;{path}/{cls}&#x27;)&#xA;    imgs.append(curruntImg)&#xA;    classNames.append(os.path.splitext(cls)[0])&#xA;&#xA;def findEncodings(imgs):&#xA;    encodeList = []&#xA;    for img in imgs:&#xA;        img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)&#xA;        encode = face_recognition.face_encodings(img)[0]&#xA;        encodeList.append(encode)&#xA;    return encodeList&#xA;&#xA;encodeListKnown = findEncodings(imgs)&#xA;print(&#x27;Encoding Complete&#x27;)&#xA;&#xA;cap = cv2.VideoCapture(0)&#xA;&#xA;rtmp_url = "rtmp://127.0.0.1:1935/stream/webcam"&#xA;&#xA;fps = int(cap.get(cv2.CAP_PROP_FPS))&#xA;width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))&#xA;height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))&#xA;&#xA;# command and params for ffmpeg&#xA;command = [ffmpeg,&#xA;           &#x27;-y&#x27;,&#xA;           &#x27;-f&#x27;, &#x27;rawvideo&#x27;,&#xA;           &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;,&#xA;           &#x27;-pix_fmt&#x27;, &#x27;bgr24&#x27;,&#xA;           &#x27;-s&#x27;, "{}x{}".format(width, height),&#xA;           &#x27;-r&#x27;, str(fps),&#xA;           &#x27;-i&#x27;, &#x27;-&#x27;,&#xA;           &#x27;-c:v&#x27;, &#x27;libx264&#x27;,&#xA;           &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;,&#xA;           &#x27;-preset&#x27;, &#x27;ultrafast&#x27;,&#xA;           &#x27;-f&#x27;, &#x27;flv&#x27;,&#xA;           &#x27;rtmp://127.0.0.1:1935/stream/webcam&#x27;]&#xA;&#xA;p = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False)&#xA;&#xA;&#xA;while True:&#xA;    ret, frame, success, img = cap.read()&#xA;    if not ret:&#xA;        print("frame read failed")&#xA;        break&#xA;    imgSmall = cv2.resize(img, (0,0), None, 0.25, 0.25)&#xA;    imgSmall = cv2.cvtColor(imgSmall, cv2.COLOR_BGR2RGB)&#xA;&#xA;    currentFrameFaces = face_recognition.face_locations(imgSmall)&#xA;    currentFrameEncodings = face_recognition.face_encodings(imgSmall, currentFrameFaces)&#xA;&#xA;    for encodeFace, faceLocation in zip(currentFrameEncodings, currentFrameFaces):&#xA;        matches = face_recognition.compare_faces(encodeListKnown, encodeFace)&#xA;        faceDistance = face_recognition.face_distance(encodeListKnown, encodeFace)&#xA;        matchIndex = np.argmin(faceDistance)&#xA;&#xA;        if matches[matchIndex]:&#xA;            name = classNames[matchIndex].upper()&#xA;            y1, x2, y2, x1 = faceLocation&#xA;            y1, x2, y2, x1 = y1 * 4, x2 * 4, y2 * 4, x1 * 4 &#xA;            cv2.rectangle(img, (x1, y1), (x2, y2), (0, 255, 0), 2)&#xA;            cv2.rectangle(img, (x1, y2 - 35), (x2, y2), (0, 255, 0), cv2.FILLED)&#xA;            cv2.putText(img, name, (x1 &#x2B; 6, y2 - 6), cv2.FONT_HERSHEY_DUPLEX, 1, (255, 255, 255), 2) &#xA;&#xA;    # write to pipe&#xA;    p.stdin.write(frame.tobytes())&#xA;

    &#xA;