Recherche avancée

Médias (91)

Autres articles (47)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Déploiements possibles

    31 janvier 2010, par

    Deux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
    L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
    Version mono serveur
    La version mono serveur consiste à n’utiliser qu’une (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (4168)

  • 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

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

  • Translating Return To Ringworld

    17 août 2016, par Multimedia Mike — Game Hacking

    As indicated in my previous post, the Translator has expressed interest in applying his hobby towards another DOS adventure game from the mid 1990s : Return to Ringworld (henceforth R2RW) by Tsunami Media. This represents significantly more work than the previous outing, Phantasmagoria.


    Return to Ringworld Title Screen
    Return to Ringworld Title Screen

    I have been largely successful thus far in crafting translation tools. I have pushed the fruits of these labors to a Github repository named improved-spoon (named using Github’s random name generator because I wanted something more interesting than ‘game-hacking-tools’).

    Further, I have recorded everything I have learned about the game’s resource format (named RLB) at the XentaxWiki.

    New Challenges
    The previous project mostly involved scribbling subtitle text on an endless series of video files by leveraging a separate software library which took care of rendering fonts. In contrast, R2RW has at least 30k words of English text contained in various blocks which require translation. Further, the game encodes its own fonts (9 of them) which stubbornly refuse to be useful for rendering text in nearly any other language.

    Thus, the immediate 2 challenges are :

    1. Translating volumes of text to Spanish
    2. Expanding the fonts to represent Spanish characters

    Normally, “figuring out the file format data structures involved” is on the list as well. Thankfully, understanding the formats is not a huge challenge since the folks at the ScummVM project already did all the heavy lifting of reverse engineering the file formats.

    The Pitch
    Here was the plan :

    • Create a tool that can dump out the interesting data from the game’s master resource file.
    • Create a tool that can perform the elaborate file copy described in the previous post. The new file should be bit for bit compatible with the original file.
    • Modify the rewriting tool to repack some modified strings into the new resource file.
    • Unpack the fonts and figure out a way to add new characters.
    • Repack the new fonts into the resource file.
    • Repack message strings with Spanish characters.

    Showing The Work : Modifying Strings
    First, I created the tool to unpack blocks of message string resources. I elected to dump the strings to disk as JSON data since it’s easy to write and read JSON using Python, and it’s quick to check if any mistakes have crept in.

    The next step is to find a string to focus on. So I started the game and looked for the first string I could trigger :


    Return to Ringworld: Original text

    This shows up in the JSON string dump as :

      
        "Spanish" : " !0205Your quarters on the Lance of Truth are spartan, in accord with your mercenary lifestyle.",
        "English" : " !0205Your quarters on the Lance of Truth are spartan, in accord with your mercenary lifestyle."
      ,
    

    As you can see, many of the strings are encoded with an ID key as part of the string which should probably be left unmodified. I changed the Spanish string :

      
        "Spanish" : " !0205Hey, is this thing on ?",
        "English" : " !0205Your quarters on the Lance of Truth are spartan, in accord with your mercenary lifestyle."
      ,
    

    And then I wrote the repacking tool to substitute this message block for the original one. Look ! The engine liked it !


    Return to Ringworld: Modified text

    Little steps, little steps.

    Showing The Work : Modifying Fonts
    The next little step is to find a place to put the new characters. First, a problem definition : The immediate goal is to translate the game into Spanish. The current fonts encoded in the game resource only support 128 characters, corresponding to 7-bit ASCII. In order to properly express Spanish, 16 new characters are required : á, é, í, ó, ú, ü, ñ (each in upper and lower case for a total of 14 characters) as well as the inverted punctuation symbols : ¿, ¡.

    Again, ScummVM already documents (via code) the font coding format. So I quickly determined that each of the 9 fonts is comprised of 128 individual bitmaps with either 1 or 2 bits per pixel. I wrote a tool to unpack each character into an individual portable grey map (PGM) image. These can be edited with graphics editors or with text editors since they are just text files.

    Where to put the 16 new Spanish characters ? ASCII characters 1-31 are non-printable, so my first theory was that these characters would be empty and could be repurposed. However, after dumping and inspecting, I learned that they represent the same set of characters as seen in DOS Code Page 437. So that’s a no-go (so I assumed ; I didn’t check if any existing strings leveraged those characters).

    My next plan was hope that I could extend the font beyond index 127 and use positions 128-143. This worked superbly. This is the new example string :

      
        "Spanish" : " !0205¿Ves esto ? ¡La puntuacion se hace girar !",
        "English" : " !0205Your quarters on the Lance of Truth are spartan, in accord with your mercenary lifestyle."
      ,
    

    Fortunately, JSON understands UTF-8 and after mapping the 16 necessary characters down to the numeric range of 128-143, I repacked the new fonts and the new string :


    Return to Ringworld: Espanol
    Translation : “See this ? The punctuation is rotated !”

    Another victory. Notice that there are no diacritics in this string. None are required for this translation (according to Google Translate). But adding the diacritics to the 14 characters isn’t my department. My tool does help by prepopulating [aeiounAEIOUN] into the right positions to make editing easier for the Translator. But the tool does make the effort to rotate the punctuation since that is easy to automate.

    Next Steps and Residual Weirdness
    There is another method for storing ASCII text inside the R2RW resource called strip resources. These store conversation scripts. There are plenty of fields in the data structures that I don’t fully understand. So, following the lessons I learned from my previous translation outing, I was determined to modify as little as possible. This means copying over most of the original data structures intact, but changing the field representing the relative offset that points to the corresponding string. This works well since the strings are invariably stored NULL-terminated in a concatenated manner.

    I wanted to document for the record that the format that R2RW uses has some weirdness in they way it handles residual bytes in a resource. The variant of the resource format that R2RW uses requires every block to be aligned on a 16-byte boundary. If there is space between the logical end of the resource and the start of the next resource, there are random bytes in that space. This leads me to believe that these bytes were originally recorded from stale/uninitialized memory. This frustrates me because when I write the initial file copy tool which unpacks and repacks each block, I want the new file to be identical to the original. However, these apparent nonsense bytes at the end thwart that effort.

    But leaving those bytes as 0 produces an acceptable resource file.

    Text On Static Images
    There is one last resource type we are working on translating. There are various bits of text that are rendered as images. For example, from the intro :


    Return to Ringworld: Static text

    It’s possible to locate and extract the exact image that is overlaid on this scene, though without the colors :


    Original static text

    The palettes are stored in a separate resource type. So it seems the challenge is to figure out the palette in use for these frames and render a transparent image that uses the same palette, then repack the new text-image into the new resource file.

    The post Translating Return To Ringworld first appeared on Breaking Eggs And Making Omelettes.