Recherche avancée

Médias (1)

Mot : - Tags -/book

Autres articles (28)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

Sur d’autres sites (2900)

  • The 11th Hour RoQ Variation

    12 avril 2012, par Multimedia Mike — Game Hacking, dreamroq, Reverse Engineering, roq, Vector Quantization

    I have been looking at the RoQ file format almost as long as I have been doing practical multimedia hacking. However, I have never figured out how the RoQ format works on The 11th Hour, which was the game for which the RoQ format was initially developed. When I procured the game years ago, I remember finding what appeared to be RoQ files and shoving them through the open source decoders but not getting the right images out.

    I decided to dust off that old copy of The 11th Hour and have another go at it.



    Baseline
    The game consists of 4 CD-ROMs. Each disc has a media/ directory that has a series of files bearing the extension .gjd, likely the initials of one Graeme J. Devine. These are resource files which are merely headerless concatenations of other files. Thus, at first glance, one file might appear to be a single RoQ file. So that’s the source of some of the difficulty : Sending an apparent RoQ .gjd file through a RoQ player will often cause the program to complain when it encounters the header of another RoQ file.

    I have uploaded some samples to the usual place.

    However, even the frames that a player can decode (before encountering a file boundary within the resource file) look wrong.

    Investigating Codebooks Using dreamroq
    I wrote dreamroq last year– an independent RoQ playback library targeted towards embedded systems. I aimed it at a gjd file and quickly hit a codebook error.

    RoQ is a vector quantizer video codec that maintains a codebook of 256 2×2 pixel vectors. In the Quake III and later RoQ files, these are transported using a YUV 4:2:0 colorspace– 4 Y samples, a U sample, and a V sample to represent 4 pixels. This totals 6 bytes per vector. A RoQ codebook chunk contains a field that indicates the number of 2×2 vectors as well as the number of 4×4 vectors. The latter vectors are each comprised of 4 2×2 vectors.

    Thus, the total size of a codebook chunk ought to be (# of 2×2 vectors) * 6 + (# of 4×4 vectors) * 4.

    However, this is not the case with The 11th Hour RoQ files.

    Longer Codebooks And Mystery Colorspace
    Juggling the numbers for a few of the codebook chunks, I empirically determined that the 2×2 vectors are represented by 10 bytes instead of 6. Now I need to determine what exactly these 10 bytes represent.

    I should note that I suspect that everything else about these files lines up with successive generations of the format. For example if a file has 640×320 resolution, that amounts to 40×20 macroblocks. dreamroq iterates through 40×20 8×8 blocks and precisely exhausts the VQ bitstream. So that all looks valid. I’m just puzzled on the codebook format.

    Here is an example codebook dump :

    ID 0x1002, len = 0x0000014C, args = 0x1C0D
      0 : 00 00 00 00 00 00 00 00 80 80
      1 : 08 07 00 00 1F 5B 00 00 7E 81
      2 : 00 00 15 0F 00 00 40 3B 7F 84
      3 : 00 00 00 00 3A 5F 18 13 7E 84
      4 : 00 00 00 00 3B 63 1B 17 7E 85
      5 : 18 13 00 00 3C 63 00 00 7E 88
      6 : 00 00 00 00 00 00 59 3B 7F 81
      7 : 00 00 56 23 00 00 61 2B 80 80
      8 : 00 00 2F 13 00 00 79 63 81 83
      9 : 00 00 00 00 5E 3F AC 9B 7E 81
      10 : 1B 17 00 00 B6 EF 77 AB 7E 85
      11 : 2E 43 00 00 C1 F7 75 AF 7D 88
      12 : 6A AB 28 5F B6 B3 8C B3 80 8A
      13 : 86 BF 0A 03 D5 FF 3A 5F 7C 8C
      14 : 00 00 9E 6B AB 97 F5 EF 7F 80
      15 : 86 73 C8 CB B6 B7 B7 B7 85 8B
      16 : 31 17 84 6B E7 EF FF FF 7E 81
      17 : 79 AF 3B 5F FC FF E2 FF 7D 87
      18 : DC FF AE EF B3 B3 B8 B3 85 8B
      19 : EF FF F5 FF BA B7 B6 B7 88 8B
      20 : F8 FF F7 FF B3 B7 B7 B7 88 8B
      21 : FB FF FB FF B8 B3 B4 B3 85 88
      22 : F7 FF F7 FF B7 B7 B9 B7 87 8B
      23 : FD FF FE FF B9 B7 BB B7 85 8A
      24 : E4 FF B7 EF FF FF FF FF 7F 83
      25 : FF FF AC EB FF FF FC FF 7F 83
      26 : CC C7 F7 FF FF FF FF FF 7F 81
      27 : FF FF FE FF FF FF FF FF 80 80
    

    Note that 0x14C (the chunk size) = 332, 0x1C and 0x0D (the chunk arguments — count of 2×2 and 4×4 vectors, respectively) are 28 and 13. 28 * 10 + 13 * 4 = 332, so the numbers check out.

    Do you see any patterns in the codebook ? Here are some things I tried :

    • Treating the last 2 bytes as U & V and treating the first 4 as the 4 Y samples :


    • Treating the last 2 bytes as U & V and treating the first 8 as 4 16-bit little-endian Y samples :


    • Disregarding the final 2 bytes and treating the first 8 bytes as 4 RGB565 pixels (both little- and big-endian, respectively, shown here) :


    • Based on the type of data I’m seeing in these movies (which appears to be intended as overlays), I figured that some of these bits might indicate transparency ; here is 15-bit big-endian RGB which disregards the top bit of each pixel :


    These images are taken from the uploaded sample bdpuz.gjd, apparently a component of the puzzle represented in this screenshot.

    Unseen Types
    It has long been rumored that early RoQ files could contain JPEG images. I finally found one such specimen. One of the files bundled early in the uploaded fhpuz.gjd sample contains a JPEG frame. It’s a standard JFIF file and can easily be decoded after separating the bytes from the resource using ‘dd’. JPEGs serve as intraframes in the coding scheme, with successive RoQ frames moving objects on top.

    However, a new chunk type showed up as well, one identified by 0×1030. I have never encountered this type. Where could I possibly find data about this ? Fortunately, iD Games recently posted all of their open sourced games at Github. Reading through the code for their official RoQ decoder, I see that this is called a RoQ_PACKET. The name and the code behind it are both supremely unhelpful. The code is basically a no-op. The payloads of the various RoQ_PACKETs from one sample are observed to be either 8784, 14752, or 14760 bytes in length. It’s very likely that this serves the same purpose as the JPEG intraframes.

    Other Tidbits
    I read through the readme.txt on the first game disc and found this nugget :

            g)      Animations displayed normally or in SPOOKY MODE
    

    SPOOKY MODE is blue-tinted grayscale with color cursors, puzzle
    and game pieces. It is the preferred display setting of the
    developers at Trilobyte. Just for fun, try out the SPOOKY
    MODE.

    The MobyGames screenshot page has a number of screenshots labeled as being captured in spooky mode. Color tricks ?

    Meanwhile, another twist arose as I kept tweaking dreamroq to deal with more RoQ weirdness : After modifying my dreamroq code to handle these 10-byte vectors, it eventually chokes on another codebook. These codebooks happen to have 6-byte vectors again ! Fortunately, I was already working on a scheme to automatically detect which codebook is in play (plugging the numbers into a formula and seeing which vector size checks out).

  • The Future of the VP8 Bitstream

    18 juin 2010, par noreply@blogger.com (John Luther) — vp8

    Recently we’ve seen software products such as VLC, FFmpeg, Logitech Vid, Flumotion and Tixeo adopting and using WebM and VP8 (the video codec in WebM) in exciting new ways.

    In addition to software developers, many hardware vendors have committed to shipping VP8-accelerated products based on our current bitstream in 2011 . Devices that use hardware acceleration for video are a very small percentage of overall web traffic today, but they are a rapidly growing segment of the market and our project must be mindful of these vendors’ needs. Given the longer lead times for changes in chipsets, hardware companies implementing the codec today need to be confident that it will be stable and supported as VP8 content proliferates.

    Like every codec, WebM is not immune to change ; the difference in our project is that the improvements are publicly visible, and compatibility and implementation issues can be worked through in an open forum.

    So, to maintain codec stability while also allowing for quality and performance improvements in VP8, we have added an experimental branch to the VP8 source tree. The WebM community can use this unstable branch to propose changes to VP8 that will produce the best video codec possible, but without the constraints of a frozen bitstream. At some point in the future, when the experimental branch proves significantly better than the stable branch, we will create a new version of the codec.

    Teams dedicated to improving WebM are actively investigating and evaluating new techniques, and are committed to do so for the long term. We encourage the WebM community to keep contributing as well. To learn more about the experimental branch and get involved, see our repository layout page.

    Jim Bankoski is Codec Engineering Manager at Google.

  • VP8 And FFmpeg

    18 juin 2010, par Multimedia Mike — VP8

    UPDATE, 2010-06-17 : You don’t need to struggle through these instructions anymore. libvpx 0.9.1 and FFmpeg 0.6 work together much better. Please see this post for simple instructions on getting up and running quickly.

    Let’s take the VP8 source code (in Google’s new libvpx library) for a spin ; get it to compile and hook it up to FFmpeg. I am hesitant to publish specific instructions for building in the somewhat hackish manner available on day 1 (download FFmpeg at a certain revision and apply a patch) since that kind of post has a tendency to rise in Google rankings. I will just need to remember to update this post after the library patches are applied to the official FFmpeg tree.

    Statement of libvpx’s Relationship to FFmpeg
    I don’t necessarily speak officially for FFmpeg. But I’ve been with the project long enough to explain how certain things work.

    Certainly, some may wonder if FFmpeg will incorporate Google’s newly open sourced libvpx library into FFmpeg. In the near term, FFmpeg will support encoding and decoding VP8 via external library as it does with a number of other libraries (most popularly, libx264). FFmpeg will not adopt the code for its own codebase, even if the license may allow it. That just isn’t how the FFmpeg crew rolls.

    In the longer term, expect the FFmpeg project to develop an independent, interoperable implementation of the VP8 decoder. Sometime after that, there may also be an independent VP8 encoder as well.

    Building libvpx
    Download and build libvpx. This is a basic ’configure && make’ process. The build process creates a static library, a bunch of header files, and 14 utilities. A bunch of these utilities operate on a file format called IVF which is apparently a simple transport method for VP8. I have recorded the file format on the wiki.

    We could use a decoder for this in the FFmpeg code base for testing VP8 in the future. Who’s game ? Just as I was proofreading this post, I saw that David Conrad has sent an IVF demuxer to the ffmpeg-devel list.

    There doesn’t seem to be a ’make install’ step for the library. Instead, go into the overly long directory (on my system, this is generated as vpx-vp8-nopost-nodocs-generic-gnu-v0.9.0), copy the contents of include/ to /usr/local/include and the static library in lib/ to /usr/local/lib .

    Building FFmpeg with libvpx
    Download FFmpeg source code at the revision specified or take your chances with the latest version (as I did). Download and apply provided patches. This part hurts since there is one diff per file. Most of them applied for me.

    Configure FFmpeg with 'configure --enable-libvpx_vp8 --enable-pthreads'. Ideally, this should yield no complaints and ’libvpx_vp8’ should show up in the enabled decoders and encoders sections. The library apparently relies on threading which is why '--enable-pthreads' is necessary. After I did this, I was able to create a new webm/VP8/Vorbis file simply with :

     ffmpeg -i input_file output_file.webm
    

    Unfortunately, I can’t complete the round trip as decoding doesn’t seem to work. Passing the generated .webm file back into FFmpeg results in a bunch of errors of this format :

    [libvpx_vp8 @ 0x8c4ab20]v0.9.0
    [libvpx_vp8 @ 0x8c4ab20]Failed to initialize decoder : Codec does not implement requested capability
    

    Maybe this is the FFmpeg revision mismatch biting me.

    FFmpeg Presets
    FFmpeg features support for preset files which contain collections of tuning options to be loaded into the program. Google provided some presets along with their FFmpeg patches :

    • 1080p50
    • 1080p
    • 360p
    • 720p50
    • 720p

    To invoke one of these (assuming the program has been installed via ’make install’ so that the presets are in the right place) :

     ffmpeg -i input_file -vcodec libvpx_vp8 -vpre 720p output_file.webm
    

    This will use a set of parameters that are known to do well when encoding a 720p video.

    Code Paths
    One of goals with this post was to visualize a call graph after I got the decoder hooked up to FFmpeg. Fortunately, this recon is greatly simplified by libvpx’s simple_decoder utility. Steps :

    • Build libvpx with --enable-gprof
    • Run simple_decoder on an IVF file
    • Get the pl_from_gprof.pl and dot_from_pl.pl scripts frome Graphviz’s gprof filters
    • gprof simple_decoder | ./pl_from_gprof.pl | ./dot_from_pl.pl > 001.dot
    • Remove the 2 [graph] and 1 [node] modifiers from the dot file (they only make the resulting graph very hard to read)
    • dot -Tpng 001.dot > 001.png

    Here are call graphs generated from decoding test vectors 001 and 017.


    Like this, only much larger and scarier (click for full graph)


    It’s funny to see several functions calling an empty bubble. Probably nothing to worry about. More interesting is the fact that a lot of function_c() functions are called. The ’_c’ at the end is important— that generally indicates that there are (or could be) SIMD-optimized versions. I know this codebase has plenty of assembly. All of the x86 ASM files appear to be written such that they could be compiled with NASM.

    Leftovers
    One interesting item in the code was vpx_scale/leapster. Is this in reference to the Leapster handheld educational gaming unit ? Based on this item from 2005 (archive.org copy), some Leapster titles probably used VP6. This reminds me of finding references to the PlayStation in Duck/On2’s original VpVision source release. I don’t know of any PlayStation games that used Duck’s original codecs but with thousands to choose from, it’s possible that we may find a few some day.