Recherche avancée

Médias (91)

Autres articles (86)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

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

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (7716)

  • Why is the FindClass/JNI function behaving differently on nexus 5 and Honor Play ?

    17 août 2020, par Owl

    MobileFFmpeg v4.3.1LTS works on Honor Play, but doesn't work on Nexus 5. Why ?

    


    The build for Honor Play and nexus 5 is the same ->armeabi-v7a

    


    


    https://github.com/tanersener/mobile-ffmpeg/releases/tag/v4.3.1.LTS

    


    Nexus5 :enter image description here

    


    HonorPlay :enter image description here

    


    


    


    NDK = ndk-r14b

    


    


    


    JDK = jdk1.8.0_77

    


    


    I will ask the question immediately in English stackoverflow. Developing a game in Unreal Engine 4 v24.3. In the code itself there are only 2 lines that relate to MobileFFmpeg :

    


    Enabling the function :

    


    extern "C"
{
    int ffmpeg_execute(int argc, char** argv);
}


    


    Calling a function with ffmpeg parameters

    


    ffmpeg_execute(arg.size(), arg.data());


    


    Without mobile FFmpeg, the app on nexus 5 starts and works stably. When I start with FFmpeg, an error immediately appears and the app crashes :

    


    enter image description here

    


    The FindClass function does not work, the call itself is declared in mobile ffmpeg.c :

    


    /** Full name of the Config class */
const char *configClassName = "com/arthenica/mobileffmpeg/Config";


    


    ...

    


    /**
 * Called when 'mobileffmpeg' native library is loaded.
 *
 * @param vm pointer to the running virtual machine
 * @param reserved reserved
 * @return JNI version needed by 'mobileffmpeg' library
 */
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
    JNIEnv *env;
    if ((*vm)->GetEnv(vm, (void**)(&env), JNI_VERSION_1_6) != JNI_OK) {
        LOGE("OnLoad failed to GetEnv for class %s.\n", configClassName);
        return JNI_FALSE;
    }

    jclass localConfigClass = (*env)->FindClass(env, configClassName);
    if (localConfigClass == NULL) {
        LOGE("OnLoad failed to FindClass %s.\n", configClassName);
        return JNI_FALSE;
    }
...


    


    I can't see what the FindClass(C++) function returns, Android Studio doesn't want to stop on the JNI_OnLoad(C++) function during debug.

    


    What are the assumptions why FindClass behavior is different on two phones ?

    


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

  • ffmpeg encoding .mp4 fails in safari when hosted from s3. handbrake encoded video works first time

    11 juin 2018, par Simon Rogers

    The mp4 videos I’ve encoded with ffmpeg work perfectly in Safari if stored locally, but break if hosted from s3. I have tried countless encoding settings to no avail.

    However having just run a mov quickly through Handbrake and ticking ’optimise for web’ and encoding baseline @ 4.0, this has worked perfectly first time.

    I don’t understand what could be going wrong with my ffmpeg encoding.

    Things I have noticed about files from two separate encoders which work :

    They both have yuv420p(tv, bt709) whereas ffmpeg is just saying yuv420p – this is the only thing I can identify from ffprobe that is consistently different.

    I have done a fresh install of ffmpeg to no avail :

    ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

    brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass  --with-libvorbis --with-libvpx --with-opus --with-x265

    This error appears in all the files I have encoded with ffmpeg :

    Unsupported codec with id 0 for input stream 1

    ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––

    mp4box gives the following for the ffmpeg video, which doesn’t work :

    Tempuras-iMac:tests tempura$ mp4box -info /Users/tempura/tests/mov-output-10-1400.mp4
    * Movie Info *
    Timescale 1000 - 1 track
    Computed Duration 00:00:10.967 - Indicated Duration 00:00:10.967
    Fragmented File: no
    File suitable for progressive download (moov before mdat)
    File Brand isom - version 512
       Compatible brands: isom iso2 avc1 mp41
    Created: UNKNOWN DATE   Modified: UNKNOWN DATE
    File has no MPEG4 IOD/OD

    iTunes Info:
    Encoder Software: Lavf58.12.100
    1 UDTA types: meta (1)

    Track # 1 Info - TrackID 1 - TimeScale 15360
    Media Duration 00:00:10.966 - Indicated Duration 00:00:10.966
    Track has 1 edit lists: track duration is 00:00:10.967
    Media Info: Language "English (eng)" - Type "vide:avc1" - 329 samples
    Visual Track layout: x=0 y=0 width=1800 height=1200
    MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
    AVC/H264 Video - Visual Size 1800 x 1200
    AVC Info: 1 SPS - 1 PPS - Profile Baseline @ Level 4
    NAL Unit length bits: 32
    Pixel Aspect Ratio 1:1 - Indicated track size 1800 x 1200
    Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
    SPS#1 hash: 2BD106A8DFD73B92825D87D4D312B22F9CEC1986
    PPS#1 hash: 656AE5F3BE854F3C8B889E72310662390F18EDBD
    Self-synchronized
    RFC6381 Codec Parameters: avc1.42C028
    Average GOP length: 329 samples

    And gives the following for two videos that do work.

    First :

    Tempuras-iMac:tests tempura$ mp4box -info /Users/tempura/tests/mov-output-05-1400.mp4
    [iso file] Unknown box type tmcd
    [iso file] Read Box type  (0x00000000) has size 0 but is not at root/file level, skipping
    * Movie Info *
    Timescale 1000 - 2 tracks
    Computed Duration 00:00:10.967 - Indicated Duration 00:00:10.967
    Fragmented File: no
    File suitable for progressive download (moov before mdat)
    File Brand isom - version 512
       Compatible brands: isom iso2 avc1 mp41
    Created: UNKNOWN DATE   Modified: UNKNOWN DATE
    File has no MPEG4 IOD/OD

    iTunes Info:
    Encoder Software: Lavf58.12.100
    1 UDTA types: meta (1)

    Track # 1 Info - TrackID 1 - TimeScale 15360
    Media Duration 00:00:10.966 - Indicated Duration 00:00:10.966
    Track has 1 edit lists: track duration is 00:00:10.967
    Media Info: Language "English (eng)" - Type "vide:avc1" - 329 samples
    Visual Track layout: x=0 y=0 width=1800 height=1200
    MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
    AVC/H264 Video - Visual Size 1800 x 1200
    AVC Info: 1 SPS - 1 PPS - Profile Baseline @ Level 4
    NAL Unit length bits: 32
    Pixel Aspect Ratio 1:1 - Indicated track size 1800 x 1200
    Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
    SPS#1 hash: 39D86732FD5F78B18F2E83C651FAE38EA0E30A6D
    PPS#1 hash: 656AE5F3BE854F3C8B889E72310662390F18EDBD
    Self-synchronized
    RFC6381 Codec Parameters: avc1.42C028
    Average GOP length: 329 samples

    Track # 2 Info - TrackID 2 - TimeScale 15360
    Media Duration 00:00:10.966 - Indicated Duration 00:00:10.966
    Track has 1 edit lists: track duration is 00:00:10.967
    Track is disabled
    Media Info: Language "Undetermined (und)" - Type "tmcd:tmcd" - 1 samples
    Unknown media type
    RFC6381 Codec Parameters: tmcd
    All samples are sync

    Second :

    Tempuras-iMac:tests tempura$ mp4box -info /Users/tempura/Documents/yes_2106.mp4
    * Movie Info *
    Timescale 30000 - 1 track
    Computed Duration 00:00:10.966 - Indicated Duration 00:00:10.966
    Fragmented File: no
    File suitable for progressive download (moov before mdat)
    File Brand isom - version 1
       Compatible brands: isom avc1 mp42
    Created: GMT Fri Jun  1 11:24:54 2018
    Modified: GMT Fri Jun  1 11:24:54 2018

    File has root IOD (9 bytes)
    Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
    Visual PL: ISO Reserved Profile (0x15)
    Audio PL: No audio capability required (0xff)
    No streams included in root OD

    Track # 1 Info - TrackID 1 - TimeScale 30
    Media Duration 00:00:10.966 - Indicated Duration 00:00:10.966
    Media Info: Language "Undetermined (und)" - Type "vide:avc1" - 329 samples
    Visual Track layout: x=0 y=0 width=1800 height=1200
    MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
    AVC/H264 Video - Visual Size 1800 x 1200
    AVC Info: 1 SPS - 1 PPS - Profile Baseline @ Level 4.2
    NAL Unit length bits: 32
    Pixel Aspect Ratio 1:1 - Indicated track size 1800 x 1200
    Chroma format YUV 4:2:0 - Luma bit depth 8 - chroma bit depth 8
    SPS#1 hash: ED5CFE0A3F65F36ADCFA347C1273A29784E8AEAC
    PPS#1 hash: 7ECF7597FDDAC5F8C82B54BFB40A1F9A8D8807FA
    Self-synchronized
    RFC6381 Codec Parameters: avc1.42C02A
    Average GOP length: 329 samples