Recherche avancée

Médias (1)

Mot : - Tags -/3GS

Autres articles (58)

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

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

Sur d’autres sites (9826)

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

  • How can I test and know what is the latency of streaming with ffmpeg ?

    1er octobre 2017, par Davis8988

    I am using ffmpeg to stream a window of an app to another computer.
    How can I measure/check/get/see exact value of latency ?

    Here is the script I use :

    ffmpeg -y -rtbufsize 100M -f gdigrab -framerate 25 -probsize 100M -i  
    title="App Name" -c:v libx264 -r 25 -preset ultrafast -tune zerolatency  
    -crf 25 -f mpegts udp://30.30.2.38:1080  

    And here is the script I use to capture it with ffplay on receiving computer :

    ffplay -fflags nobuffer -sync ext udp://30.30.2.38:1080  
  • FFmpeg : Green images from TS file

    5 septembre 2017, par Tatsiana

    I use ffmpeg to generate images from a TS file and at some places it generates green images. I checked a couple of ffmpeg versions. The issue reproduces on
    3.3.3, 2.8.11, 2.7.7, but doesn’t on 2.6.9.
    What might be the reason ?

    For example, the output of 2.8.11 :

        $ ffmpeg -ss 00:42:20 -i video.ts -frames:v 1 out_42_20.jpg -loglevel debug
        ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
          built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1 16.04.4) 20160609
          configuration : —prefix=/usr —extra-version=0ubuntu0.16.04.1 —build-suffix=-ffmpeg —toolchain=hardened —libdir=/usr/lib/x86_64-linux-=/usr/include/x86_64-linux-gnu —cc=cc —cxx=g++ —enable-gpl —enable-shared —disable-stripping —disable-decoder=libopenjpeg —disable-dhroedinger —enable-avresample —enable-avisynth —enable-gnutls —enable-ladspa —enable-libass —enable-libbluray —enable-libbs2b —enab-enable-libcdio —enable-libflite —enable-libfontconfig —enable-libfreetype —enable-libfribidi —enable-libgme —enable-libgsm —enable—enable-libmp3lame —enable-libopenjpeg —enable-libopus —enable-libpulse —enable-librtmp —enable-libschroedinger —enable-libshine —enpy —enable-libsoxr —enable-libspeex —enable-libssh —enable-libtheora —enable-libtwolame —enable-libvorbis —enable-libvpx —enable-linable-libwebp —enable-libx265 —enable-libxvid —enable-libzvbi —enable-openal —enable-opengl —enable-x11grab —enable-libdc1394 —enab83 —enable-libzmq —enable-frei0r —enable-libx264 —enable-libopencv
          libavutil      54. 31.100 / 54. 31.100
          libavcodec     56. 60.100 / 56. 60.100
          libavformat    56. 40.101 / 56. 40.101
          libavdevice    56.  4.100 / 56.  4.100
          libavfilter     5. 40.101 /  5. 40.101
          libavresample   2.  1.  0 /  2.  1.  0
          libswscale      3.  1.101 /  3.  1.101
          libswresample   1.  2.101 /  1.  2.101
          libpostproc    53.  3.100 / 53.  3.100
        Splitting the commandline.
        Reading option ’-ss’ ... matched as option ’ss’ (set the start time offset) with argument ’00:42:20’.
        Reading option ’-i’ ... matched as input url with argument ’video.ts’.
        Reading option ’-frames:v’ ... matched as option ’frames’ (set the number of frames to output) with argument ’1’.
        Reading option ’out_42_20.jpg’ ... matched as output url.
        Reading option ’-loglevel’ ... matched as option ’loglevel’ (set logging level) with argument ’debug’.
        Finished splitting the commandline.
        Parsing a group of options : global .
        Applying option loglevel (set logging level) with argument debug.
        Successfully parsed a group of options.
        Parsing a group of options : input url video.ts.
        Applying option ss (set the start time offset) with argument 00:42:20.
        Successfully parsed a group of options.
        Opening an input file : video.ts.
        [mpegts @ 0x22ba400] Format mpegts probed with size=2048 and score=100
        [mpegts @ 0x22ba400] stream=0 stream_type=1b pid=1e1 prog_reg_desc=
        [mpegts @ 0x22ba400] stream=1 stream_type=f pid=1e2 prog_reg_desc=
        [mpegts @ 0x22ba400] stream=2 stream_type=6 pid=1e3 prog_reg_desc=
        [mpegts @ 0x22ba400] Before avformat_find_stream_info() pos : 0 bytes read:32768 seeks:0
        [h264 @ 0x22be840] no picture
        [mpegts @ 0x22ba400] max_analyze_duration 5000000 reached at 5000000 microseconds st:0
        [mpegts @ 0x22ba400] stream 0 : no PTS found at end of file, duration not set
        [mpegts @ 0x22ba400] After avformat_find_stream_info() pos : 0 bytes read:4026800 seeks:3 frames:550
        Input #0, mpegts, from ’video.ts’ :
          Duration : 02:15:27.97, start : 1.079989, bitrate : 4983 kb/s
          Program 1
            Stream #0:0[0x1e1], 216, 1/90000 : Video : h264 (High), 4 reference frames ([27][0][0][0] / 0x001B), yuv420p(left), 1920x1080 (1920x1088)R 16:9], 1/50, 25 fps, 50 tbr, 90k tbn, 50 tbc
            Stream #0:1[0x1e2](und), 203, 1/90000 : Audio : aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 127 kb/s
            Stream #0:2[0x1e3](und), 131, 1/90000 : Audio : ac3 ([6][0][0][0] / 0x0006), 48000 Hz, 5.1(side), fltp, 384 kb/s
        Successfully opened the file.
        Parsing a group of options : output url out_42_20.jpg.
        Applying option frames:v (set the number of frames to output) with argument 1.
        Successfully parsed a group of options.
        Opening an output file : out_42_20.jpg.
        Successfully opened the file.
        detected 1 logical cores
        [graph 0 input from stream 0:0 @ 0x22ba280] Setting ’video_size’ to value ’1920x1080’
        [graph 0 input from stream 0:0 @ 0x22ba280] Setting ’pix_fmt’ to value ’0’
        [graph 0 input from stream 0:0 @ 0x22ba280] Setting ’time_base’ to value ’1/90000’
        [graph 0 input from stream 0:0 @ 0x22ba280] Setting ’pixel_aspect’ to value ’1/1’
        [graph 0 input from stream 0:0 @ 0x22ba280] Setting ’sws_param’ to value ’flags=2’
        [graph 0 input from stream 0:0 @ 0x22ba280] Setting ’frame_rate’ to value ’25/1’
        [graph 0 input from stream 0:0 @ 0x22ba280] w:1920 h:1080 pixfmt:yuv420p tb:1/90000 fr:25/1 sar:1/1 sws_param:flags=2
        [format @ 0x2328360] compat : called with args=[yuvj420p|yuvj422p|yuvj444p]
        [format @ 0x2328360] Setting ’pix_fmts’ to value ’yuvj420p|yuvj422p|yuvj444p’
        [auto-inserted scaler 0 @ 0x2326600] Setting ’flags’ to value ’bicubic’
        [auto-inserted scaler 0 @ 0x2326600] w:iw h:ih flags :’bicubic’ interl:0
        [format @ 0x2328360] auto-inserting filter ’auto-inserted scaler 0’ between the filter ’Parsed_null_0’ and the filter ’format’
        [AVFilterGraph @ 0x2327ba0] query_formats : 5 queried, 3 merged, 1 already done, 0 delayed
        [auto-inserted scaler 0 @ 0x2326600] picking yuvj420p out of 3 ref:yuv420p alpha:0
        [swscaler @ 0x2310660] deprecated pixel format used, make sure you did set range correctly
        [auto-inserted scaler 0 @ 0x2326600] w:1920 h:1080 fmt:yuv420p sar:1/1 -> w:1920 h:1080 fmt:yuvj420p sar:1/1 flags:0x4
        [mjpeg @ 0x2327620] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multipl
        [mjpeg @ 0x2327620] intra_quant_bias = 96 inter_quant_bias = 0
        Output #0, image2, to ’out_42_20.jpg’ :
          Metadata :
            encoder : Lavf56.40.101
            Stream #0:0, 0, 1/25 : Video : mjpeg, 1 reference frame, yuvj420p(pc, left), 1920x1080 [SAR 1:1 DAR 16:9], 1/25, q=2-31, 200 kb/s, 25 fps tbc
            Metadata :
              encoder : Lavc56.60.100 mjpeg
        Stream mapping :
          Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
        Press [q] to stop, [?] for help
        [h264 @ 0x232a040] Missing reference picture, default is 0
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 0
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 0
        [h264 @ 0x232a040] decode_slice_header error
        timestamp discontinuity 0, new offset= -2541079989
        [h264 @ 0x232a040] no picture
        [h264 @ 0x232a040] illegal short term buffer state detected
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] Missing reference picture, default is 65537
        [h264 @ 0x232a040] decode_slice_header error
        [h264 @ 0x232a040] no picture
        *** 0 dup !
        [AVIOContext @ 0x2448c00] Statistics : 0 seeks, 2 writeouts
        No more output streams to write to, finishing.
        frame=    1 fps=0.0 q=2.2 Lsize=N/A time=00:00:00.04 bitrate=N/A dup=1 drop=1
        video:32kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown
        Input file #0 (video.ts) :
          Input stream #0:0 (video) : 9 packets read (261340 bytes) ; 3 frames decoded ;
          Input stream #0:1 (audio) : 0 packets read (0 bytes) ;
          Input stream #0:2 (audio) : 0 packets read (0 bytes) ;
          Total : 9 packets (261340 bytes) demuxed
        Output file #0 (out_42_20.jpg) :
          Output stream #0:0 (video) : 1 frames encoded ; 1 packets muxed (33209 bytes) ;
          Total : 1 packets (33209 bytes) muxed
        3 frames successfully decoded, 0 decoding errors
        [AVIOContext @ 0x22c2e40] Statistics : 8798032 bytes read, 36 seeks