Recherche avancée

Médias (1)

Mot : - Tags -/stallman

Autres articles (23)

  • 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

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

Sur d’autres sites (6092)

  • why type casting on non-pointer struct give syntax error

    31 mars 2016, par Sany Liew

    I am using Visual C++ express 2008 try to compile code similar to below :

    no problem

    {
     ...
     AVRational test = {1, 1000};
     ...
    }

    but has problem when it is as below :

    {
     ...
     AVRational test = (AVRational){1, 1000};
     ...
    }

    gave errors :

    1>..\..\..\projects\test\xyz.cpp(1139) : error C2059: syntax error : '{'
    1>..\..\..\projects\test\xyz.cpp(1139) : error C2143: syntax error : missing   ';' before '{'
    1>..\..\..\projects\test\xyz.cpp(1139) : error C2143: syntax error : missing ';' before '}'

    where AVRational (ffmpeg.org library) is defined as :

    typedef struct AVRational{
       int num; ///< numerator
       int den; ///< denominator
    } AVRational;

    FFmpeg come with some pre-define value such as

    #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE}

    which is used as below

    av_rescale_q(seek_target, AV_TIME_BASE_Q, pFormatCtx->streams[stream_index]->time_base);

    will failed to compile on Visual C++ express 2008

    It seem like the same code will be compiled with no error/warning on gcc compiler. Why I get this error on VC++ ? Is it a C/C++ standard way to do casting on struct value ? Anyway I can avoid this error while still able to use the defined AV_TIME_BASE_Q ?

  • FFMPEG and Mencoder building screenshot returns 0 size images

    12 avril 2014, par Genus

    I have a script and it used to work fine but suddenly it stopped working and giving me zero size images as screenshot after video convert.

    here is the command for video screenshot.

    $cmd = $GLOBALS["paths"]["ffmpeg"]." -y -i ".$file." -f mjpeg -r 1 -ss ".$time." -vframes 1 -an ".$tmpdir."/00000001.jpg 2>&1";
       exec($cmd,$results);

    Debug :

    -----------------------------------------------------

    ------------mencoder_and_fmpeg.php SCREENSHOT -------

    -----------------------------------------------------

     COMMAND: ffmpeg -y -i /home/TESTING/public_html/vid/6d/ad/29/6dad2946a2ba102.flv -f mjpeg -r 1 -ss 14.48 -vframes 1 -an /home/TESTING/public_html/scr/42/3a/92/00000001.jpg 2>&1

     FFmpeg version SVN-r16244, Copyright (c) 2000-2008 Fabrice Bellard, et al.

     configuration: --disable-mmx --enable-shared --enable-libvorbis --enable-gpl --enable-swscale --enable-pthreads --disable-static --disable-demuxer=v4l --disable-demuxer=v4l2 --enable-libtheora --enable-gpl --enable-libspeex --enable-libmp3lame --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libamr-nb --enable-libamr-wb --enable-nonfree --enable-libxvid
     libavutil     49.12. 0 / 49.12. 0
     libavcodec    52. 7. 0 / 52.108. 0
     libavformat   52.23. 1 / 52.92. 0
     libavdevice   52. 1. 0 / 52. 2. 3
     libswscale     0. 6. 1 /  0.12. 0

     built on Apr  9 2011 22:48:41, gcc: 4.1.2 20080704 (Red Hat 4.1.2-50)
     built by Admin-Ahead Server Technologies FFmpeg installer v5.0.6b
     Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 10.92 (131/12)
     Stream mapping:
     Stream #0.0 -> #0.0

     Press [q] to stop encoding
     ffmpeg: symbol lookup error: ffmpeg: undefined symbol: frame_hook_process
  • Playing With Emscripten and ASM.js

    1er mars 2014, par Multimedia Mike — General

    The last 5 years or so have provided a tremendous amount of hype about the capabilities of JavaScript. I think it really kicked off when Google announced their Chrome web browser in September, 2008 along with its V8 JS engine. This seemed to spark an arms race in JS engine performance along with much hyperbole that eventually all software could, would, and/or should be written in straight JavaScript for maximum portability and future-proofing, perhaps aided by Emscripten, a tool which magically transforms C and C++ code into JS. The latest round of rhetoric comes courtesy of something called asm.js which purports to narrow the gap between JS and native code performance.

    I haven’t been a believer, to express it charitably. But I wanted to be certain, so I set out to devise my own experiment to test modern JS performance.

    Up Front Summary
    I was extremely surprised that my experiment demonstrated JS performance FAR beyond my expectations. There might be something to these claims of magnficent JS speed in numerical applications. Basically, here were my thoughts during the process :

    • There’s no way that JavaScript can come anywhere close to C performance for a numerically intensive operation ; a simple experiment should demonstrate this.
    • Here’s a straightforward C program to perform a simple yet numerically intensive operation.
    • Let’s compile the C program on gcc and get some baseline performance numbers.
    • Let’s use Emscripten to convert the C program to JavaScript and run it under Chrome.
    • Ha ! Pitiful JS performance, just as I expected !
    • Try the same program under Firefox, since Firefox is supposed to have some crazy optimization for asm.js code, allegedly emitted by Emscripten.
    • LOL ! Firefox performs even worse than Chrome !
    • Wait a minute… the Emscripten documentation mentioned using optimization levels for generating higher performance JS, so try ‘-O1′.
    • Umm… wow : Chrome’s performance increased dramatically ! What about Firefox ? Not only is Firefox faster than Chrome, it’s faster than the gcc-generated code !
    • As my faith in C is suddenly shaken to its core, I remembered to compile the gcc version with an explicit optimization level. The native C version pulled ahead of Firefox again, but the Firefox code is still close.
    • Aha ! This is just desktop– but what about mobile ? One of the leading arguments for converting everything to pure JavaScript is that such programs will magically run perfectly in mobile browsers. So I wager that this is where the experiment will fall over.
    • I proceed to try the same converted program on a variety of mobile platforms.
    • The mobile platforms perform rather admirably as well.
    • I am surprised.

    The Experiment
    I wanted to run a simple yet numerically-intensive and relevant benchmark, and something I am familiar with. I settled on JPEG image decoding. Again, I wanted to keep this simple, ideally in a single file because I didn’t know how hard it might be to deal with Emscripten. I found NanoJPEG, which is a straightforward JPEG decoder contained in a single C file.

    I altered nanojpeg.c (to a new file called nanojpeg-static.c) such that the main() program would always load a 1920×1080 (a.k.a. 1080p) JPEG file (“bbb-1080p-title.jpg”, the Big Buck Bunny title), rather than requiring a command line argument. Then I used gettimeofday() to profile the core decoding function (njDecode()).

    Compiling with gcc and profiling execution :

    gcc -Wall nanojpeg-static.c -o nanojpeg-static
    ./nanojpeg-static
    

    Optimization levels such as -O0, -O3, or -Os can be applied to the compilation command.

    For JavaScript conversion, I installed Emscripten and converted using :

    /path/to/emscripten/emcc nanojpeg-static.c -o nanojpeg.html \
      —preload-file bbb-1080p-title.jpg -s TOTAL_MEMORY=32000000
    

    The ‘–preload-file’ option makes the file available to the program via standard C-style file I/O functions. The ‘-s TOTAL_MEMORY’ was necessary because the default of 16 MB wasn’t enough. Again, the -O optimization levels can be sent in.

    For running, the .html file is loaded (via webserver) in a web browser.

    Want To Try It Yourself ?
    I put the files here : http://multimedia.cx/emscripten/. The .c file, the JPEG file, and the Emscripten-converted files using -O0, -O1, -O2, -O3, -Os, and no optimization switch.

    Results and Charts
    Here is the spreadsheet with the raw results.

    I ran this experiment using Ubuntu Linux 12.04 on an Intel Atom N450-based netbook. For this part, I was able to compare the Chrome and Firefox browser results against the C results :



    These are the results for a 2nd generation Android Nexus 7 using both Chrome and Firefox :



    Here is the result for an iPad 2 running iOS 7 and Safari– there is no Firefox for iOS and while there is a version of Chrome for iOS, it apparently isn’t able to leverage an optimized JS engine. Chrome takes so long to complete this experiment that there’s no reason to muddy the graph with the results :



    Interesting that -O1 tends to provide better optimization than levels 2 or 3, and that -Os (optimize for size) seems to be a good all-around choice.

    Don’t Get Too Smug
    JavaScript can indeed get amazing performance in this day and age. Please be advised, however, that this isn’t the best that a C decoder implementation can possibly do. This version doesn’t leverage any SIMD extensions. According to profiling (using gprof against the C code), sample saturation in color conversion dominates followed by inverse DCT functions, common cases for SIMD ASM or intrinsics. Allegedly, there will be some support for JS SIMD optimizations some day. We’ll see.

    Implications For Development
    I’m still not especially motivated to try porting the entire Native Client game music player codebase to JavaScript. I’m still wondering about the recommended development flow. How are you supposed to develop for Emscripten and asm.js ? From what I can tell, Emscripten is not designed as a simple aide for porting C/C++ code to JS. No, it reduces the code into JS code you can’t possibly maintain. This seems to imply that the C/C++ code needs to be developed and debugged in its entirety and then converted to JS, which seems arduous.