Recherche avancée

Médias (1)

Mot : - Tags -/musée

Autres articles (59)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

  • Gestion des droits de création et d’édition des objets

    8 février 2011, par

    Par défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

Sur d’autres sites (5675)

  • Subtitling Sierra RBT Files

    2 juin 2016, par Multimedia Mike — Game Hacking

    This is part 2 of the adventure started in my Subtitling Sierra VMD Files post. After I completed the VMD subtitling, The Translator discovered a wealth of animation files in a format called RBT (this apparently stands for “Robot” but I think “Ribbit” format could be more fun). What are we going to do ? We had come so far by solving the VMD subtitling problem for Phantasmagoria. It would be a shame if the effort ground to a halt due to this.

    Fortunately, the folks behind the ScummVM project already figured out enough of the format to be able to decode the RBT files in Phantasmagoria.

    In the end, I was successful in creating a completely standalone tool that can take a Robot file and a subtitle file and create a new Robot file with subtitles. The source code is here (subtitle-rbt.c). Here’s what the final result looks like :


    Spanish refrigerator
    “What’s in the refrigerator ?” I should note at this juncture that I am not sure if this particular Robot file even has sound or dialogue since I was conducting these experiments on a computer with non-working audio.

    The RBT Format
    I have created a new MultimediaWiki page describing the Robot Animation format based on the ScummVM source code. I have not worked with a format quite like this before. These are paletted animations which consist of a sequence of independent frames that are designed to be overlaid on top of static background. Because of these characteristics, each frame encodes its own unique dimensions and origin coordinate within the frame. While the Phantasmagoria VMD files are usually 288×144 (which are usually double-sized for the benefit of a 640×400 Super VGA canvas), these frames are meant to be plotted on a game field that was roughly 576×288 (288×144 doublesized).

    For example, 2 minimalist animation frames from a desk investigation Robot file :


    Robot Animation Frame #1
    100×147

    Robot Animation Frame #2
    101×149

    As for compression, my first impression was that the algorithm was the same as VMD. This is wrong. It evidently uses an unmodified version of a standard algorithm called Lempel-Ziv-Stac (LZS). It shows up in several RFCs and was apparently used in MS-DOS’s transparent disk compression scheme.

    Approach
    Thankfully, many of the lessons I learned from the previous project are applicable to this project, including : subtitle library interfacing, subtitling in the paletted colorspace, and replacing encoded frames from the original file instead of trying to create a new file.

    Here is the pitch for this project :

    • Create a C program that can traverse through an input file, piece by piece, and generate an output file. The result of this should be a bitwise identical file.
    • Adapt the LZS compression decoding algorithm from ScummVM into the new tool. Make the tool dump raw Portable NetMap (PNM) files of varying dimensions and ensure that they look correct.
    • Compress using LZS.
    • Stretch the frames and draw subtitles.
    • More compression. Find the minimum window for each frame.

    Compression
    Normally, my first goal is to decompress the video and store the data in a raw form. However, this turned out to be mathematically intractable. While the format does support both compressed and uncompressed frames (even though ScummVM indicates that the uncompressed path is yet unexercised), the goal of this project requires making the frames so large that they overflow certain parameters of the file.

    A Robot file has a sequence of frames and 2 tables describing the size of each frame. One table describes the entire frame size (audio + video) while the second table describes just the video frame size. Since these tables only use 16 bits to specify a size, the maximum frame size is 65536 bytes. Leaving space for the audio portion of the frame, this only leaves a per-frame byte budget of about 63000 bytes for the video. Expanding the frame to 576×288 (165,888 pixels) would overflow this limit.

    Anyway, the upshot is that I needed to compress the data up front.

    Fortunately, the LZS compressor is pretty straightforward, at least if you have experience writing VLC-oriented codecs. While the algorithm revolves around back references, my approach was to essentially write an RLE encoder. My compressor would search for runs of data (plentiful when I started to stretch the frame for subtitling purposes). When a run length of n=3 or more of the same pixel is found, encode the pixel by itself, and then store a back reference of offset -1 and length (n-1). It took a little while to iron out a few problems, but I eventually got it to work perfectly.

    I have to say, however, that the format is a little bit weird in how it codes very large numbers. The length encoding is somewhat Golomb-like, i.e., smaller values are encoded with fewer bits. However, when it gets to large numbers, it starts encoding counts of 15 as blocks of 1111. For example, 24 is bigger than 7. Thus, emit 1111 into the bitstream and subtract 8 from 23 -> 16. Still bigger than 15, so stuff another 1111 into the bitstream and subtract 15. Now we’re at 1, so stuff 0001. So 24 is 11111111 0001. 12 bits is not too horrible. But the total number of bytes (value / 30). So a value of 300 takes around 10 bytes (80 bits) to encode.

    Palette Slices
    As in the VMD subtitling project, I took the subtitle color offered in the subtitle spec file as a suggestion and used Euclidean distance to match to the closest available color in the palette. One problem, however, is that the palette is a lot smaller in these animations. According to my notes, for the set of animations I scanned, only about 80 colors were specified, starting at palette index 55. I hypothesize that different slices of the palette are reserved for different uses. E.g., animation, background, and user interface. Thus, there is a smaller number of colors to draw upon for subtitling purposes.

    Scaling
    One bit of residual weirdness in this format is the presence of a per-frame scale factor. While most frames set this to 100 (100% scale), I have observed 70%, 80%, and 90%. ScummVM is a bit unsure about how to handle these, so I am as well. However, I eventually realized I didn’t really need to care, at least not when decoding and re-encoding the frame. Just preserve the scale factor. I intend to modify the tool further to take scale factor into account when creating the subtitle.

    The Final Resolution
    Right around the time that I was composing this post, The Translator emailed me and notified me that he had found a better way to subtitle the Robot files by modifying the scripts, rendering my entire approach moot. The result is much cleaner :


    Proper RBT Subtitles
    Turns out that the engine supported subtitles all along

    It’s a good thing that I enjoyed the challenge or I might be annoyed at this point.

    See Also

    The post Subtitling Sierra RBT Files first appeared on Breaking Eggs And Making Omelettes.

  • How do I create RTMP stream from a picture ? [on hold]

    6 février 2017, par Muhammad Umer

    Now first the goal :

    I want to create a live video stream where people can vote and such, and it shows total votes in the live video.

    However, I have zero experience with streaming.

    After some thought My solution is this :

    Create a picture every 5 seconds and replace the old picture, new picture contain total number of votes.

    From old picture somehow create a continous live stream.

    I think it could be very easy or very hard.

    I am using nodejs, open to better performance oriented language suggestions.

  • bash script to install / update ffmpeg static builds

    1er mars 2017, par Joakim

    Hi I’m trying to make my first "real" bash script to do some real work than can be executed both manually and through cron jobs.

    The script should download and install the ffmpeg-static-build from https://johnvansickle.com/ffmpeg

    Here is what I’ve got so far :

    #!/bin/bash
    # Still to come, see if the script runs with root privileges else exit
    #Download FFMPEG static daily build and it's md5
    cd ~
    wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz | tar -xf
    #wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5
    curl -L https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5 | tar -xf | tee -a https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz | cut -d\  -f1 | md5sum > md5sum.txt


    #Chech the md5 is currect
    #md5sum -c MD5SUMS
    file1="md5sum.txt"
    file2="ffmpeg-git-64bit-static.tar.xz.md5"

    if ! cmp --silent "$file1" "$file2"; then
       echo "md5sum doesn't match...\n exit" >&2
       exit 1
    fi


    #tar -xf ffmpeg-*.tar.xz
    cp ffmpeg-*-static/ff* /usr/bin/
    cp ffmpeg-*-static/ff* /usr/local/bin/
    cp ffmpeg-*-static/qt-faststart /usr/bin/
    cp ffmpeg-*-static/qt-faststart /usr/local/bin/
    # Consider change second location to use ln -s
    # Remove downloads and do some clean up

    rm -fr ffmpeg-*

    #EOF

    As you can see in the script i would like to add the md5sum check but it fails (got the md5sum check part from Compare md5 sums in bash script)

    If i remove the md5sum part the script is working, but right now the script fails at the | tar -xf | part with this code

    2017-02-28 00:10:24 (617 KB/s) - ‘ffmpeg-git-64bit-static.tar.xz’ saved [17564756/17564756]

    tar: option requires an argument -- 'f'
    Try 'tar --help' or 'tar --usage' for more information.
    tee: 'https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz': No such file or directory
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed
    100    65  100    65    0     0     87      0 --:--:-- --:--:-- --:--:--    87
    (23) Failed writing body
    md5sum doesn't match...
    exit

    As this is my first, I would appreciate any "I’m 4 years old" advices and why

    update

    Have made some changes to the script based on the suggestions in this thread, but my problem is I have no output what so ever at this state :( So I think it’s time to ask for the next clue

    #!/bin/bash

    # version 0.3z

    ## Download FFMPEG static daily build and it's md5
    ##
    ## To make this script working you might need to change the below values
    ## based on whether you are using a 32bit or 64 bit OS
    ## to obtain the right links you have to have a look @ https://johnvansickle.com/ffmpeg/
    ## and then change those below
    ##
    ## If you are running on a shared server or dowsn't have root priviliges you might need to uncomment
    ## point 5.


    # a "~" means running users home folder :) and should be different from destination dir
    download_dir=~

    # as this can change if the ffmpeg is to be stored on ex. shared server
    dest_dir=/usr/bin/

    # The version it equal the filename from above link
    version=ffmpeg-git-64bit-static.tar.xz

    ## Do not change anything below here!!
    source_url=https://johnvansickle.com/ffmpeg/builds/${version}
    md5_url=https://johnvansickle.com/ffmpeg/builds/${version}.md5

    # Still to come, see if the script runs with write privileges else exit

    # 1. Can we enter download directory else exit
    cd ${download_dir} ||

           printf "%s\n" "You can't enter this folder.\nPlease chage download_dir in this script..." >&2
           exit 1

    # 2. Check the md5 is correct or have changed from last check
    ## instead of downloading ffmpeg-git-64bit-static.tar.xz every time,
    ## regardless if it is new or not, I recommend only downloading it
    ## if the md5 does not match. Would save John some bandwidth at least
    ## thx for the idea to @LordNeckbeard



    ## So somehow i'll guess some sed or grep only first part is nessesary :(
    ## This is getting more advance than expected for a first time script :/

    if ! diff <(md5sum ${version}) <(curl -s ${md5_url})

       then
           printf "%s\n" "md5sum doesn't match...\n
                           Downloading new version" >&2
           rm -f ${version} >&2
           curl ${source_url} -o ${download_dir}/${version} >&2
           #exit 2

       elif
           diff <(md5sum ${version}) <(curl -s ${md5_url})
           printf "%s\n" "Nothing new to download" >&2
         exit 3
    fi

    # 3. untar
    tar -xf ffmpeg-git-*-static.tar.xz

    # 4. Move builds to destination directories

    mv ${download_dir}/ffmpeg-*-static/ff* ${dest_dir}/
    mv ${download_dir}/ffmpeg-*-static/qt-faststart ${dest_dir}/

    # 5. Make soft links to static builds
    ln -sfn ${dest_dir}/qt-faststart /usr/local/bin/qt-faststart
    ln -sfn ${dest_dir}/ffmpeg /usr/local/bin/ffmpeg
    ln -sfn ${dest_dir}/ffmpeg-10bit /usr/local/bin/ffmpeg-10bit
    ln -sfn ${dest_dir}/ffprobe /usr/local/bin/ffprobe
    ln -sfn ${dest_dir}/ffserver /usr/local/bin/ffserver

    # Remove unzipped folder to do some clean up

    rm -fr ffmpeg-git-*-static/

    #EOF

    note : do to some more in depth answering of why not compile from source :
    1. This precompiled is usable on all Linux variations, despite distro and version
    2. It usable on shared hosting servers with ssh access

    UPDATE 2

       #!/bin/bash

    # version 0.4z

    ## Download FFMPEG static daily build and it's md5
    ##
    ## To make this script working you might need to change the below values
    ## based on whether you are using a 32bit or 64 bit OS
    ## to obtain the right links you have to have a look @ https://johnvansickle.com/ffmpeg/
    ## and then change those below
    ##
    ## Finished and working script should be distributed under GPLv3: free as in freedom
    ##
    ## If you are running on a shared server or dowsn't have root priviliges you might need to uncomment
    ## point 5.


    # a "~" means running users home folder :) and should be different from destination dir
    download_dir=~

    # as this can change if the ffmpeg is to be stored on ex. shared server
    dest_dir=/usr/bin/

    # The version it equal the filename from above link
    version=ffmpeg-git-64bit-static.tar.xz

    ## Do not change anything below here!!
    source_url=https://johnvansickle.com/ffmpeg/builds/${version}
    md5="curl -s https://johnvansickle.com/ffmpeg/builds/${version}.md5"

    # Still to come, see if the script runs with write privileges else exit

    # 1. Can we enter download directory else exit
    cd ${download_dir} ||
           printf "%s\n" "You can't enter this folder.\nPlease chage download_dir in this script..." >&2
           exit 1

    # 2. Check the md5 is correct or have changed from last check
    ## instead of downloading ffmpeg-git-64bit-static.tar.xz every time,
    ## regardless if it is new or not, I recommend only downloading it
    ## if the md5 does not match. Would save John some bandwidth at least
    ## thx for the idea to @LordNeckbeard

    ## This is getting more advance than expected for a first time script :/

    if diff <(md5sum ${version}) <(${md5})

       then
           printf "%s\n" "No new version availeble" >&2
           exit 1

    elif ! diff <(md5sum ${version}) <(${md5})
       then
           rm -f ${version}
           curl ${source_url} > ${version}
           exit 0

           #only proceed if downloaded version match it's md5
           if ! diff <(md5sum ${version}) <(${md5})
               then
               rm -f ${version}
               printf "%s\n" "Downloaded version is damaged, try later\ndamaged version have been deleted" >&2
               exit 1
           fi

               # 3. untar
               tar -xf ffmpeg-git-*-static.tar.xz

               # 4. Move builds to destination directories
               mv ${download_dir}/ffmpeg-*-static/ff* ${dest_dir}/
               mv ${download_dir}/ffmpeg-*-static/qt-faststart ${dest_dir}/

               # 5. Make soft links to static builds
               ln -sfn ${dest_dir}/qt-faststart /usr/local/bin/qt-faststart
               ln -sfn ${dest_dir}/ffmpeg /usr/local/bin/ffmpeg
               ln -sfn ${dest_dir}/ffmpeg-10bit /usr/local/bin/ffmpeg-10bit
               ln -sfn ${dest_dir}/ffprobe /usr/local/bin/ffprobe
               ln -sfn ${dest_dir}/ffserver /usr/local/bin/ffserver

               # Remove unzipped folder to do some clean up
               rm -fr ffmpeg-git-*-static/
               printf "%s\n" "Going to install new version" >&2
               exit 1
    fi
    #EOF

    But still having some issues :(

    1. Running this script returns : a blanc shell, but I’ve expected one of the printf statements
    2. When I’m trying to narrow down the problem and going back to basic and trying to run the script with only the "if" part it fails with 44 : Syntax error : "(" unexpected
    3. running the very same "if" part typed directly into the shell/terminal itself it’s all happy !!
      if diff <(md5sum ffmpeg-git-64bit-static.tar.xz) <(curl -s "https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5"); then printf "%s\n" "No new version availeble" >&2; elif ! diff <(md5sum ffmpeg-git-64bit-static.tar.xz) <(curl -s "https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz.md5"); then rm -f ffmpeg-git-64bit-static.tar.xz; curl https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-64bit-static.tar.xz > ffmpeg-git-64bit-static.tar.xz; printf "%s\n" "Going to install new version" >&2; fi

    4. I’m confused