Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (65)

  • 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

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

Sur d’autres sites (9005)

  • ffmpeg-python lib's 'run' function works locally but doesn't work in server

    27 décembre 2023, par Fire Deus

    I am using ffmpeg-python library to process video, specifically I had to add watermark to video. Code is very simple :

    


    def set_watermark_to_video(
    video_url: str,
    directory: str,
    filename: str,
    extension: str,
):
    video_input = ffmpeg.input(video_url)
    output_path: str = f"/tmp/{filename}_watermarked.mp4"
    logo_input = ffmpeg.input(vid_mycar_logo_path)
    video_probe = ffmpeg.probe(video_url)
    video_stream = next(
        (
            stream
            for stream in video_probe["streams"]
            if stream["codec_type"] == "video"
        ),
        None,
    )

    logo_probe = ffmpeg.probe("my_logo_path")
    logo_stream = next(
        (stream for stream in logo_probe["streams"] if stream["codec_type"] == "video"),
        None,
    )
    ffmpeg.filter(
        [video_input, logo_input],
        "overlay",
        10,
        video_stream["height"] - logo_stream["height"] - 10,
    ).output(output_path).run(overwrite_output=True)


    


    Exception occurs when .run(overwrite_output=True) function is called.
    
Exception looks like this : ffmpeg._run.Error : ffmpeg error (see stderr output for detail).

    


    When I print exc.stderr the only warning I can see is "Unknown cover type : 0x1."

    


    But this code works perfectly when I run it locally. I am using docker to build my service, so dependencies, versions, etc all the same in both environments.

    


    The version of ffmpeg I'm using is 5.1.4-0+deb12u1

    


    I tried to run code line by line in server and local machine to compare all parameters and values that have been generated. And still they are the same, so I don't understand why this error happens in server

    


  • BASH recursive go trough all subdirectories and if a specific file existis, touch all files from one type in this directory [duplicate]

    20 décembre 2023, par mkirbst

    I have a music collection of the structure Interpret -> Album -> song1.m4a song2.m4a cover.jpg

    


    I can use ffmpeg to add the cover.jpg to the files :

    


    #! /bin/bash

COVER=./cover.jpg

if test -f "${COVER}"
then
    for f in ./*.m4a
    do
        echo "Adding ${COVER} for ${f}"
        mv ${f} tmp.m4a
        ffmpeg -i tmp.m4a -i ${COVER} -map_metadata 0 -map 0 -map 1 -acodec copy ${f} && rm tmp.m4a
    done
else
    echo "No ${COVER} found. Aborting..."
fi


    


    How can I modify my script to do that ?

    


    What it does : when there is a cover.jpg in the folder, then add this folder lossless to all m4a audio files.
BUT : It seems that this does not work for all folders. It would be nice to just cd to the main music folder instead of going to every album folder and run the script above by hand.

    


    What it should do :

    


      

    1. go to every subfolder
    2. 


    3. if there is a cover.jpg file then proceed at 3. if not go to step 1. (next subfolder)
    4. 


    5. for every m4a in this folder embed the cover.jpg into every m4a file in this subfolder
    6. 


    


  • How can I combine a screenshot and two video files with ffmpeg ?

    26 novembre 2023, par lukascbossert

    I have a folder with video files. Some are .mov, some are .mp4. As a first step I am converting the .mov-files into .mp4 with :

    


    while read mov; do
   mp4=$(echo "$mov"|sed -e 's|\.mov$|.mp4|i')
   if [ "$mov" == "$mp4" ]; then
     echo "Failed to generate unique MP4 filename for file $mov"
   fi
   ffmpeg -i "$mov" -c:v libx264 -f mp4 "$mp4"
 done < <(find . -type f -iname '*.mov')


    


    This works technically fine.

    


    As a second step I need to merge two video files : the first one is always the same (intro.mp4 with audio), the second file is the either converted .mov or the .mp4 from the folder (also with audio).
Additionally I need a screenshot of the first frame from the second video, which shall be the very first frame and visible for e.g. half a second (for e.g. youtube-shorts to differentiate the videos).

    


    I create the screenshot with

    


    ffmpeg -i ${fzbVideo} -ss 1 -vframes 1 ${cover}"_%01d.jpg"


    


    which works perfectly fine.

    


    As far as I could I followed the example shown here and the documentation of ffmpeg
and created a loop for all the videos and the steps of merge screenshot and videos :

    


    for fzbVideo in *.mp4; do
    # intro should be at the beginning of each video
    intro="intro/fzb-intro.mp4"
    # getting a cover imge
    cover="$(basename ${fzbVideo} .mp4)_cover"
    # naming the output file
    fzbVideoOutput="$(basename ${fzbVideo} .mp4)_output.mp4"
    #   create a cover image from the first frame of the video
    ffmpeg -i ${fzbVideo} -ss 1 -vframes 1 ${cover}"_%01d.jpg"
    # combine the cover image with the intro and the actual video file
    ffmpeg \
-loop 1 -framerate 1 -t 1 -i ${cover}"_1.jpg" \
-i ${intro} \
-i ${fzbVideo} \
-f lavfi -t 0.1 -i anullsrc=channel_layout=stereo:sample_rate=44100 \
-filter_complex '[0:v:0][0:a:0][1:v:0][1:a:0][2:a:0][2:a:0]concat=n=3:v=1:a=1' ${fzbVideoOutput}
done


    


    But this creates the error :

    


    Stream specifier ':a:0' in filtergraph description [0:v:0][0:a:0][1:v:0][1:a:0][2:a:0][2:a:0]concat=n=3:v=1:a=1 matches no streams.


    


    What do I need to change ?
Additionally, is there a way to combine the converstion from .mov to .mp4 also in the loop (if necessary) ?

    



    


    Edit : content from the CLI, in case this is important information :

    


    ffmpeg version 6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with Apple clang version 14.0.3 (clang-1403.0.22.14.1)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/6.0_1 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Input #0, image2, from 'IMG_5546_cover_1.jpg':
  Duration: 00:00:01.00, start: 0.000000, bitrate: 836 kb/s
  Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 1080x1920, 1 fps, 1 tbr, 1 tbn
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'intro/fzb-intro.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 1
    compatible_brands: isommp41mp42
    creation_time   : 2023-11-24T21:59:10.000000Z
  Duration: 00:00:00.83, start: 0.000000, bitrate: 1247 kb/s
  Stream #1:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 602x1070, 1191 kb/s, 30 fps, 30 tbr, 600 tbn (default)
    Metadata:
      creation_time   : 2023-11-24T21:59:10.000000Z
      handler_name    : Core Media Video
      vendor_id       : [0][0][0][0]
  Stream #1:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 38 kb/s (default)
    Metadata:
      creation_time   : 2023-11-24T21:59:10.000000Z
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_5546.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf60.3.100
  Duration: 00:00:28.37, start: 0.000000, bitrate: 3126 kb/s
  Stream #2:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1080x1920, 2989 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
    Metadata:
      handler_name    : Core Media Video
      vendor_id       : [0][0][0][0]
      encoder         : Lavc60.3.100 libx264
  Stream #2:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio
      vendor_id       : [0][0][0][0]
Stream specifier ':a' in filtergraph description [0:v] [0:a] [1:v] [1:a] [2:v] [2:a] concat=n=3:v=1:a=1 [v] [a] matches no streams.