Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (111)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

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

  • Odd X server error with ffmpeg

    4 novembre 2013, par jhc

    I am building a weather data acquisition system. One of the things I would like to do would be to animate the satellite data that is arriving every 15 minutes. In fact, I have already devised a script (called animate) that successfully joins eight hours worth of PNG images into an AVI video file. This runs fine when run manually from the terminal.

    Unfortunately, the same cannot be said when run from my (as in my user, not root) crontab.

    Below is the cron job that I mentioned :

    1,16,31,46 * * * * /home/daniella/bin/anim_all > /home/daniella/logs/anim_all.log 2>&1

    anim_all simply calls animate for each distinct data product :

    #!/bin/bash
    set -x
    cd /home/daniella/data/imager

    rm -rf HRIT_MSG3_*.avi

    animate HRIT_MSG3_CTT
    animate HRIT_MSG3_IR108
    animate HRIT_MSG3_VIS006
    animate HRIT_MSG3_WV062

    And animate itself calls ffmpeg.

    #!/bin/bash

    set -x
    cd /home/daniella/data/imager
    product=$1
    hl="$product.8hl"

    declare -i i=0
    for file in $(cat $hl); do
       link=$(printf "images%02d.png" $i)
       ln -sf $file $link
       i=$((i+1))
       echo $i
    done

    ffmpeg -sameq -r 15 -i images%02d.png $product.avi
    rm -rf images*.png

    Just to be clear, the .8hl file is simply a list of PNG file paths that refer to that last 8 hours of data. Since there is new data every 15 minutes, that is a text file with 32 lines. Finally, this is the error that is returned when examining anim_all.log (referred in the crontab) file.

    + animate HRIT_MSG3_CTT
    animate: unable to open X server `' @ animate.c/AnimateImageCommand/365.
    + animate HRIT_MSG3_IR108
    animate: unable to open X server `' @ animate.c/AnimateImageCommand/365.
    + animate HRIT_MSG3_VIS006
    animate: unable to open X server `' @ animate.c/AnimateImageCommand/365.
    + animate HRIT_MSG3_WV062
    animate: unable to open X server `' @ animate.c/AnimateImageCommand/365.

    Please note that anim_all works fine, when called manually from the terminal. This error exists only when called by cron. I would imagine that this has to do with environment variables, but I have sourced my .bashrc inside the script to no prevail.

    EDIT -
    Investigating the animate.c file itself (see the full code here), at lines 365-368, there is this :

    if (display == (Display *) NULL)
       ThrowAnimateException(XServerError,"UnableToOpenXServer",
       XDisplayName(server_name));
    (void) XSetErrorHandler(XError);

    In response, I have attempted to export the $DISPLAY variable to 127.0.0.0:0 in the animate script, but this has not worked.

  • Convert a bash script to Windows bat script [closed]

    17 mai 2024, par gyandoo

    I have a bash script, now I need to convert it to bat.

    


    What the script does is based on the shortcut the script checks the audio codec and video codec using ffprobe and then loops through all the files in the folder to convert the file(s) using the presets based on which one the shortcut calls.

    


    It also limits the processor usage before running ffmpeg.

    


    Here's the script :

    


    #!/bin/sh
FILES="/home/red/Downloads/to_convert/*"
to_convert="/home/red/Downloads/to_convert"
TYPE="$1"
#echo "$TYPE"
if [ -e '/tmp/convert.txt' ]; then
  echo "Ffmpeg is currently converting a file!"
  exit 0
else
if [ "$(ls -A $to_convert)" ];
then
    #Create a temp file so if the script is run hourly and there is an existing instance running the scripts exits
    echo >> '/tmp/convert.txt'
    #iterate through each file in the directory
    for f in $FILES
    do
    FILENAME1=$(basename "$f")
    FILENAME=${FILENAME1%.*}

    
    ##  Detect what audio codec is being used:
    audio=$(ffprobe "$f" 2>&1 | sed -n '/Audio:/s/.*: \([a-zA-Z0-9]*\).*/\1/p' | sed 1q)
    ##  Detect video codec:
    video=$(ffprobe "$f" 2>&1 | sed -n '/Video:/s/.*: \([a-zA-Z0-9]*\).*/\1/p' | sed 1q)
    ##  Set default audio settings (you may need to use a different encoder,
    ##  since libfdk_aac is not re-distributable)
    aopts="-c:a libfdk_aac -vbr 3"
    ##  Set default video settings:
    vopts="-c:v libx264 -crf 22 -preset veryfast"

    case "$audio" in
        aac|mp3 )
    #If the audio is one of the MP4-supported codecs,
    #copy the stream instead of transcoding
            aopts="-c:a copy"
            ;;
        "" )
    #If there is no audio stream, don't bother with audio
            aopts="-an"
            ;;
        * )
            ;;
    esac

    case "$video" in
    #If the video stream is one of the MP4-compatible formats,
    #copy the stream
        h264|mpeg4|mpeg2video|mpeg1video )
            vopts="-c:v copy"
            ;;
        "" )
    #If no video stream is detected, don't bother with video
            vopts="-vn"
            ;;
        * )
            ;;
    esac

    
    if [ "$TYPE" = "shrink" ]; then
    
      taskset -c 0,2 ffmpeg -i "$f" -vcodec libx265 -crf 28 -map_metadata -1 "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

    elif [ "$TYPE" = "phone" ]; then

      taskset -c 0,2 ffmpeg -y -i "$f" -vf scale=640:-2 -map_metadata -1 "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

    elif [ "$TYPE" = "pmv" ]; then

      taskset -c 0,2 ffmpeg -y -i "$f" -vf scale=360:-2 -map_metadata -1 "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1      

    elif [ "$TYPE" = "music" ]; then

      taskset -c 0,2 ffmpeg -i "$f" -acodec libmp3lame "/home/red/Downloads/done/""$FILENAME"".mp3" && success=0 || success=1  

    elif [ "$TYPE" = "audio-boost" ]; then

      taskset -c 0,2 ffmpeg -i "$f" -vcodec copy -af "volume=10dB" "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

    elif [ "$TYPE" = "burn-first-sub" ]; then  

      taskset -c 0,2 ffmpeg -i "$f" -vf "subtitles=""$f"":si=0'" "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

    elif [ "$TYPE" = "burn-srt" ]; then  

      taskset -c 0,2 ffmpeg -i "$f" -vf "subtitles=/home/red/Downloads/to_convert/""$FILENAME"".srt" "/home/huckleberry/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

    elif [ "$TYPE" = "audio-track2" ]; then  

      taskset -c 0,2 ffmpeg -y -i "$f" -map 0:v -map 0:a:1 $vopts $aopts -map_metadata -1 "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

    elif [ "$TYPE" = "split" ]; then  

      taskset -c 0,2 MP4Box -splits 1996800 "$f" && success=0 || success=1

    elif [ "$TYPE" = "fix" ]; then  
      taskset -c 0,2 ffmpeg -y -i "$f" -map 0:v:0 -map 0:a:0 -vcodec libx264 -acodec aac -map_metadata -1 "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

    else    

      taskset -c 0,2 ffmpeg -y -i "$f" -map 0:v -map 0:a:0 $vopts $aopts -map_metadata -1 "/home/red/Downloads/done/""$FILENAME"".mp4" && success=0 || success=1

      TYPE="converted"

    fi

    
    if [ $success -eq 0 ]; then
        swaks --header Subject:"${TYPE} - ${FILENAME}" --body "${FILENAME}" -S
        echo "Removing $f file..."
        rm "$f"
    else
        swaks --header Subject:"failed - ${FILENAME}" --body "${FILENAME}" -S
        echo "process failed"
    fi    
   
    done
    
    #remove the temp file created
    rm "/tmp/convert.txt"
    exit 0
else
    echo "to_convert folder is empty"
    exit 0
fi
exit 0
fi



    


  • Studying A Game Wave Disc

    23 novembre 2010, par Multimedia Mike — Game Hacking

    I picked up a used copy of game called Gemz — a rather flagrant Bejeweled clone — for a game console called Game Wave Family Entertainment System. Heard of it ? Neither had I. But the game media is optical, so I had to get it and study it.



    When mounted in Linux (as UDF), the disc is reported to contain 2.8 GB of data, so it has to be a DVD. 810 MB of that is dedicated to the movies/ directory. Multimedia format ? Just plain, boring MPEG files (very YouTube-friendly— here’s the opening animation). Deeper digging reveals some more subdirectories called movies/ that, combined, occupy the lion’s share of the disc space. Additionally, there are several single-frame .m2v files in a directory called iframes/ which are used to encode things like load screens.



    There are more interesting data files including .zbm files for images and fonts, and .zwf files for audio. I suspect that these stand for zipped bitmap and zipped wave file, respectively. They can’t be directly unzipped with ’gunzip’. Some of the numbers at the start of some files lead me to believe they can be easily decompressed with standard zlib facilities.

    Based on the binary files on the Gemz disc, I couldn’t find any data on what CPU this system might use. A little Googling led me to this page at the Video Game Console Library which pegs the brain as a Mediamatics 6811. Some searching for that leads me to a long-discontinued line of hardware from National Semiconductor.

    The Console Library page also mentions that the games were developed using the Lua programming language. Indeed, there are many Lua-related strings in the game’s binaries (’zlib’ also makes an appearance).