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)

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

  • Android ffmpeg runtime error

    6 septembre 2013, par Syntaxicated

    I'm new to Stackoverflow and although I've tried to find an answer to my question, I can't see anything that fits my circumstances. Apologies if it is a duplicate, however.

    I'm trying my hand at some Android development and have hit a problem with ffmpeg.

    I have built a basic app which should take a file on the sdcard, rotate it and save it as a new file to the same folder.

    I'm using ffmpeg to do the transposing and cropping but so far I cannot get ffmpeg to execute.

    I've used the 'guardianproject' android-ffmpeg library on github (here) to execute the ffmpeg commands but it doesn't actually do anything.

    Here's my code :

    package com.tw.videwell;

    import java.io.File;

    import org.ffmpeg.android.FfmpegController;
    import org.ffmpeg.android.MediaDesc;
    import org.ffmpeg.android.ShellUtils.ShellCallback;
    import org.ffmpeg.android.filters.TransposeVideoFilter;

    import android.annotation.SuppressLint;
    import android.app.Activity;
    import android.os.Bundle;
    import android.view.Menu;
    import android.view.View;
    import android.widget.Button;

    public class MainActivity extends Activity {

    Button b;
    FfmpegController ff;
    MediaDesc in;
    MediaDesc out;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
       run();
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
       // Inflate the menu; this adds items to the action bar if it is present.
       getMenuInflater().inflate(R.menu.main, menu);
       return true;
    }

    private void run(){
       b = (Button) findViewById(R.id.button1);    

       //Set click listener for shoot button
       b.setOnClickListener(new View.OnClickListener() {
           public void onClick(View v) {
               process();
           }    
       });


    }

    @SuppressLint("SdCardPath")
    private void process(){
       try {
           in = new MediaDesc();
           out = new MediaDesc();
           in.path="/sdcard/Video/test.mp4";
           TransposeVideoFilter tvf= new TransposeVideoFilter(TransposeVideoFilter.NINETY_CLOCKWISE);
           out.path="/sdcard/Video/out.mp4";
           out.videoFilter=tvf.toString();
           File fileTemp = null;
           ff = new FfmpegController(getApplicationContext(), fileTemp);
           //ff.processVideo(in, out, true, scb);

       } catch (Exception e) {
           // TODO Auto-generated catch block
           e.printStackTrace();
       }
    }

    private ShellCallback scb = new ShellCallback(){

       @Override
       public void shellOut(String shellLine) {
           // TODO Auto-generated method stub
           System.out.println("Out");
       }

       @Override
       public void processComplete(int exitValue) {
           // TODO Auto-generated method stub
           System.out.println("Complete");
       }

    };
    }

    When I run the app on my device the log reports the following :

    W/System.err(32114): android.content.res.Resources$NotFoundException: File res/raw/ffmpeg from drawable resource ID #0x7f040000
    W/System.err(32114):    at android.content.res.Resources.openRawResourceFd(Resources.java:982)
    W/System.err(32114):    at org.ffmpeg.android.FfmpegController.checkBinary(FfmpegController.java:49)
    W/System.err(32114):    at org.ffmpeg.android.FfmpegController.<init>(FfmpegController.java:41)
    W/System.err(32114):    at com.tw.videwell.MainActivity.process(MainActivity.java:61)
    W/System.err(32114):    at com.tw.videwell.MainActivity.access$0(MainActivity.java:52)
    W/System.err(32114):    at com.tw.videwell.MainActivity$2.onClick(MainActivity.java:44)
    W/System.err(32114):    at android.view.View.performClick(View.java:4211)
    W/System.err(32114):    at android.view.View$PerformClick.run(View.java:17362)
    W/System.err(32114):    at android.os.Handler.handleCallback(Handler.java:725)
    W/System.err(32114):    at android.os.Handler.dispatchMessage(Handler.java:92)
    W/System.err(32114):    at android.os.Looper.loop(Looper.java:137)
    W/System.err(32114):    at android.app.ActivityThread.main(ActivityThread.java:5227)
    W/System.err(32114):    at java.lang.reflect.Method.invokeNative(Native Method)
    W/System.err(32114):    at java.lang.reflect.Method.invoke(Method.java:511)
    W/System.err(32114):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
    W/System.err(32114):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
    W/System.err(32114):    at dalvik.system.NativeStart.main(Native Method)
    W/System.err(32114): Caused by: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
    W/System.err(32114):    at android.content.res.AssetManager.openNonAssetFdNative(Native Method)
    W/System.err(32114):    at android.content.res.AssetManager.openNonAssetFd(AssetManager.java:450)
    W/System.err(32114):    at android.content.res.Resources.openRawResourceFd(Resources.java:979)
    W/System.err(32114):    ... 16 more
    </init>

    From what I can deduce, the ffmpeg executable can't be found. It is stored in the /res/raw folder as I believe it should be and appears in the app folder on the device when I run it, but still can't find it.

    I'm developing on a Mac in Eclipse 4.2.1 with the latest Android SDK and am running the app on a Sony Xperia T with Android 4.2.2.

    I compiled the ffmpeg library using the installation method described on github, Android NDK 9 and the Mac XCode command line developer tools (make etc).

    What am I doing wrong ? Do I need to store the FFmpeg library file somewhere else ? Is there a massive error in my, albeit basic, coding ?

  • Normalize Fish Eye Video

    19 novembre 2016, par Optonom Scientific

    I use more advance super fish eye lens. Unfortunately, I couldn’t find any technical properties of this lens.

    I want to dewrap with ffmpeg software with this command :

    ffmpeg -i left.MP4 -vf lenscorrection=cx=0.055:cy=0.005:k1=-.2:k2=-.2 new1.mp4

    In lenscorrection filter there are four parameters.

    How can I find right value for my lens ?