Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (81)

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

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

Sur d’autres sites (5285)

  • How to reduce size of moov atom of H.264 movies to improve streaming start for smartphones ?

    14 avril 2013, par alebedev

    We run a video service streaming movies to smartphones (iOS&Android).
    We are encoding in H.264+AAC and using the mp4 container.
    We have a problem that long movies (60 minutes+) take a very long time to
    start playing and have tracked this down to the large size of moov
    atom for these movies.
    For 110 minute movies the atom is as large as 4.2Mb which obviously takes a long
    time to download to a smart-phone over 3G !

    Is there anyway to make the moov atom smaller ? We can reduce it bit
    by dropping the audio sampling rate, but obviously anything below 22kHz
    would not really be acceptable.

    We are using ffmpeg as the encoder, and MP4Box to move the metadata
    to the front of the file. Is there any way to get it to make
    a smaller moov ? Any other encoders out there which make a smaller moov ?

    For example...

    Big size (280 Mb, 1h 49min) streamable mp4 (h.264, AAC) file have a big header size (4.2 Mb). File was encoded by two pass ffmpeg and MP4Box for replacing metadata into beginning of the file :

    /usr/bin/ffmpeg -i /var/lib/encoder/incoming/2388 -aspect 320:210 -threads 8 -vcodec libx264 -profile baseline -level 13 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -b:v 270k -maxrate 270k -bufsize 270k -g 30 -passlogfile /tmp/mediaservice/3100/video-IPH.ffmpeg -an -f rawvideo -pass 1 -y /dev/null

    /usr/bin/ffmpeg -i /var/lib/encoder/incoming/2388 -aspect 320:210 -threads 8 -vcodec libx264 -profile baseline -level 13 -flags +loop+mv4 -cmp 256 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -me_method hex -subq 7 -trellis 1 -refs 5 -bf 0 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qmin 10 -qmax 51 -qdiff 4 -b:v 270k -maxrate 270k -bufsize 270k -g 30 -passlogfile /tmp/mediaservice/3100/video-IPH.ffmpeg -acodec libfaac -ac 2 -b:a 32k -ar 44100 -f mp4 -pass 2 -y /var/lib/encoder/encoded/3100/video-IPH.mp4

    /usr/bin/MP4Box -quiet -tmp /tmp/mediaservice/3100/ -inter 500 /var/lib/encoder/encoded/3100/video-IPH.mp4

    Media info (audio sample rate = 44100) :

    General
    Count                                    : 278
    Count of stream of this kind             : 1
    Kind of stream                           : General
    Kind of stream                           : General
    Stream identifier                        : 0
    Count of video streams                   : 1
    Count of audio streams                   : 1
    Video_Format_List                        : AVC
    Video_Format_WithHint_List               : AVC
    Codecs Video                             : AVC
    Audio_Format_List                        : AAC
    Audio_Format_WithHint_List               : AAC
    Audio codecs                             : AAC LC
    Complete name                            : 1348645218_970458_2465.iph.mp4
    File name                                : 1348645218_970458_2465.iph.mp4
    File extension                           : mp4
    Format                                   : MPEG-4
    Format                                   : MPEG-4
    Format/Extensions usually used           : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
    Commercial name                          : MPEG-4
    Format profile                           : Base Media
    Internet media type                      : video/mp4
    Codec ID                                 : isom
    Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
    Codec                                    : MPEG-4
    Codec                                    : MPEG-4
    Codec/Extensions usually used            : mp4 m4v m4a m4b m4p 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma f4v
    File size                                : 272703970
    File size                                : 260 MiB
    File size                                : 260 MiB
    File size                                : 260 MiB
    File size                                : 260 MiB
    File size                                : 260.1 MiB
    Duration                                 : 6556027
    Duration                                 : 1h 49mn
    Duration                                 : 1h 49mn 16s 27ms
    Duration                                 : 1h 49mn
    Duration                                 : 01:49:16.027
    Overall bit rate                         : 332767
    Overall bit rate                         : 333 Kbps
    Stream size                              : 4230761
    Stream size                              : 4.03 MiB (2%)
    Stream size                              : 4 MiB
    Stream size                              : 4.0 MiB
    Stream size                              : 4.03 MiB
    Stream size                              : 4.035 MiB
    Stream size                              : 4.03 MiB (2%)
    Proportion of this stream                : 0.01551
    HeaderSize                               : 4230683
    DataSize                                 : 268473217
    FooterSize                               : 70
    IsStreamable                             : Yes
    File last modification date              : UTC 2012-09-26 12:38:19
    File last modification date (local)      : 2012-09-26 21:38:19
    Writing application                      : Lavf54.6.100

    Video
    Count                                    : 201
    Count of stream of this kind             : 1
    Kind of stream                           : Video
    Kind of stream                           : Video
    Stream identifier                        : 0
    ID                                       : 1
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format/Url                               : http://developers.videolan.org/x264.html
    Commercial name                          : AVC
    Format profile                           : Baseline@L1.3
    Format settings                          : 5 Ref Frames
    Format settings, CABAC                   : No
    Format settings, CABAC                   : No
    Format settings, ReFrames                : 5
    Format settings, ReFrames                : 5 frames
    Format settings, GOP                     : M=1, N=30
    Internet media type                      : video/H264
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
    Codec                                    : AVC
    Codec                                    : AVC
    Codec/Family                             : AVC
    Codec/Info                               : Advanced Video Codec
    Codec/Url                                : http://developers.videolan.org/x264.html
    Codec/CC                                 : avc1
    Codec profile                            : Baseline@L1.3
    Codec settings                           : 5 Ref Frames
    Codec settings, CABAC                    : No
    Codec_Settings_RefFrames                 : 5
    Duration                                 : 6556017
    Duration                                 : 01:49:16.017
    Bit rate                                 : 270000
    Bit rate                                 : 270 Kbps
    Width                                    : 480
    Width                                    : 480 pixels
    Height                                   : 270
    Height                                   : 270 pixels
    Pixel aspect ratio                       : 1.000
    Display aspect ratio                     : 1.778
    Display aspect ratio                     : 16:9
    Rotation                                 : 0.000
    Frame rate mode                          : CFR
    Frame rate mode                          : Constant
    FrameRate_Mode_Original                  : VFR
    Frame rate                               : 29.970
    Frame rate                               : 29.970 fps
    Frame count                              : 196484
    Resolution                               : 8
    Resolution                               : 8 bits
    Colorimetry                              : 4:2:0
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Scan type                                : Progressive
    Interlacement                            : PPF
    Interlacement                            : Progressive
    Bits/(Pixel*Frame)                       : 0.070
    Stream size                              : 220159060
    Stream size                              : 210 MiB (81%)
    Stream size                              : 210 MiB
    Stream size                              : 210 MiB
    Stream size                              : 210 MiB
    Stream size                              : 210.0 MiB
    Stream size                              : 210 MiB (81%)
    Proportion of this stream                : 0.80732
    Writing library                          : x264 - core 125
    Writing library                          : x264 core 125
    Writing library/Name                     : x264
    Writing library/Version                  : core 125
    Encoding settings                        : cabac=0 / ref=5 / deblock=1:0:0 / analyse=0x1:0x131 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=0 / keyint=30 / keyint_min=16 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=2pass / mbtree=1 / bitrate=270 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=270 / vbv_bufsize=270 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
    Tagged date                              : UTC 2012-09-25 07:21:37

    Audio
    Count                                    : 169
    Count of stream of this kind             : 1
    Kind of stream                           : Audio
    Kind of stream                           : Audio
    Stream identifier                        : 0
    ID                                       : 2
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Commercial name                          : AAC
    Format profile                           : LC
    Codec ID                                 : 40
    Codec                                    : AAC LC
    Codec                                    : AAC LC
    Codec/Family                             : AAC
    Codec/CC                                 : 40
    Duration                                 : 6556027
    Duration                                 : 1h 49mn
    Duration                                 : 1h 49mn 16s 27ms
    Duration                                 : 1h 49mn
    Duration                                 : 01:49:16.027
    Bit rate mode                            : VBR
    Bit rate mode                            : Variable
    Bit rate                                 : 58955
    Bit rate                                 : 59.0 Kbps
    Maximum bit rate                         : 270000
    Maximum bit rate                         : 270 Kbps
    Channel(s)                               : 2
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Channel positions                        : 2/0/0
    Sampling rate                            : 44100
    Sampling rate                            : 44.1 KHz
    Samples count                            : 289120791
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Stream size                              : 48314149
    Stream size                              : 46.1 MiB (18%)
    Stream size                              : 46 MiB
    Stream size                              : 46 MiB
    Stream size                              : 46.1 MiB
    Stream size                              : 46.08 MiB
    Stream size                              : 46.1 MiB (18%)
    Proportion of this stream                : 0.17717
    Tagged date                              : UTC 2012-09-25 07:21:37

    Moov atom info (/moov/trak[0] - video, /moov/trak[1] - audio) sample rate 44100 :
    (look stsz and stts nodes in trak)

    Atom ftyp @ 0 of size: 32, ends @ 32
    Atom moov @ 32 of size: 4230651, ends @ 4230683
        Atom mvhd @ 40 of size: 108, ends @ 148
        Atom trak @ 148 of size: 868970, ends @ 869118
            Atom tkhd @ 156 of size: 92, ends @ 248
            Atom edts @ 248 of size: 36, ends @ 284
                Atom elst @ 256 of size: 28, ends @ 284
            Atom mdia @ 284 of size: 868834, ends @ 869118
                Atom mdhd @ 292 of size: 32, ends @ 324
                Atom hdlr @ 324 of size: 45, ends @ 369
                Atom minf @ 369 of size: 868749, ends @ 869118
                    Atom vmhd @ 377 of size: 20, ends @ 397
                    Atom dinf @ 397 of size: 36, ends @ 433
                        Atom dref @ 405 of size: 28, ends @ 433
                    Atom stbl @ 433 of size: 868685, ends @ 869118
                        Atom stsd @ 441 of size: 149, ends @ 590
                            Atom avc1 @ 457 of size: 133, ends @ 590
                                Atom avcC @ 543 of size: 47, ends @ 590
                        Atom stts @ 590 of size: 24, ends @ 614
                        Atom stss @ 614 of size: 26340, ends @ 26954
                        Atom stsc @ 26954 of size: 52, ends @ 27006
                        Atom stsz @ 27006 of size: 785956, ends @ 812962
                        Atom stco @ 812962 of size: 56156, ends @ 869118
        Atom trak @ 869118 of size: 3361468, ends @ 4230586
            Atom tkhd @ 869126 of size: 92, ends @ 869218
            Atom edts @ 869218 of size: 36, ends @ 869254
                Atom elst @ 869226 of size: 28, ends @ 869254
            Atom mdia @ 869254 of size: 3361332, ends @ 4230586
                Atom mdhd @ 869262 of size: 32, ends @ 869294
                Atom hdlr @ 869294 of size: 45, ends @ 869339
                Atom minf @ 869339 of size: 3361247, ends @ 4230586
                    Atom smhd @ 869347 of size: 16, ends @ 869363
                    Atom dinf @ 869363 of size: 36, ends @ 869399
                        Atom dref @ 869371 of size: 28, ends @ 869399
                    Atom stbl @ 869399 of size: 3361187, ends @ 4230586
                        Atom stsd @ 869407 of size: 91, ends @ 869498
                            Atom mp4a @ 869423 of size: 75, ends @ 869498
                                Atom esds @ 869459 of size: 39, ends @ 869498
                        **Atom stts @ 869498 of size: 2135816, ends @ 3005314**
                        Atom stsc @ 3005314 of size: 39712, ends @ 3045026
                        **Atom stsz @ 3045026 of size: 1129400, ends @ 4174426**
                        Atom stco @ 4174426 of size: 56160, ends @ 4230586
        Atom udta @ 4230586 of size: 97, ends @ 4230683
            Atom meta @ 4230594 of size: 89, ends @ 4230683
                Atom hdlr @ 4230606 of size: 33, ends @ 4230639
                Atom ilst @ 4230639 of size: 44, ends @ 4230683
                    Atom ©too @ 4230647 of size: 36, ends @ 4230683
                        Atom data @ 4230655 of size: 28, ends @ 4230683
    Atom mdat @ 4230683 of size: 268473217, ends @ 272703900
    Atom free @ 272703900 of size: 8, ends @ 272703908
    Atom free @ 272703908 of size: 62, ends @ 272703970
    ------------------------------------------------------
    Total size: 272703970 bytes; 50 atoms total. AtomicParsley version: 0.9.0 (utf8)
    Media data: 268473217 bytes; 4230753 bytes all other atoms (1.551% atom overhead).
    Total free atom space: 70 bytes; 0.000% waste. Padding available: 0 bytes.
    ------------------------------------------------------

    After reencoding this movie with audio sample rate 11025 header size much less :

    Media info (audio sample rate = 11025) : (crop duplicate info)

    General
    ***
    HeaderSize                               : 1276359

    Video
    ***

    Audio
    Count                                    : 169
    Count of stream of this kind             : 1
    Kind of stream                           : Audio
    Kind of stream                           : Audio
    Stream identifier                        : 0
    ID                                       : 2
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Commercial name                          : AAC
    Format profile                           : LC
    Codec ID                                 : 40
    Codec                                    : AAC LC
    Codec                                    : AAC LC
    Codec/Family                             : AAC
    Codec/CC                                 : 40
    Duration                                 : 6556132
    Duration                                 : 1h 49mn
    Duration                                 : 1h 49mn 16s 132ms
    Duration                                 : 1h 49mn
    Duration                                 : 01:49:16.132
    Bit rate mode                            : VBR
    Bit rate mode                            : Variable
    Bit rate                                 : 37991
    Bit rate                                 : 38.0 Kbps
    Maximum bit rate                         : 128000
    Maximum bit rate                         : 128 Kbps
    Channel(s)                               : 2
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Channel positions                        : 2/0/0
    Sampling rate                            : 11025
    Sampling rate                            : 11.025 KHz
    Samples count                            : 72281355
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Stream size                              : 31134257
    Stream size                              : 29.7 MiB (12%)
    Stream size                              : 30 MiB
    Stream size                              : 30 MiB
    Stream size                              : 29.7 MiB
    Stream size                              : 29.69 MiB
    Stream size                              : 29.7 MiB (12%)
    Proportion of this stream                : 0.12327
    Tagged date                              : UTC 2012-09-25 13:20:28

    Moov atom info (/moov/trak[0] - video, /moov/trak[1] - audio) sample rate 11025 :

    Atom ftyp @ 0 of size: 32, ends @ 32
    Atom moov @ 32 of size: 1276327, ends @ 1276359
        Atom mvhd @ 40 of size: 108, ends @ 148
        Atom trak @ 148 of size: 821662, ends @ 821810
            Atom tkhd @ 156 of size: 92, ends @ 248
            Atom edts @ 248 of size: 36, ends @ 284
                Atom elst @ 256 of size: 28, ends @ 284
            Atom mdia @ 284 of size: 821526, ends @ 821810
                Atom mdhd @ 292 of size: 32, ends @ 324
                Atom hdlr @ 324 of size: 45, ends @ 369
                Atom minf @ 369 of size: 821441, ends @ 821810
                    Atom vmhd @ 377 of size: 20, ends @ 397
                    Atom dinf @ 397 of size: 36, ends @ 433
                        Atom dref @ 405 of size: 28, ends @ 433
                    Atom stbl @ 433 of size: 821377, ends @ 821810
                        Atom stsd @ 441 of size: 149, ends @ 590
                            Atom avc1 @ 457 of size: 133, ends @ 590
                                Atom avcC @ 543 of size: 47, ends @ 590
                        Atom stts @ 590 of size: 24, ends @ 614
                        Atom stss @ 614 of size: 26340, ends @ 26954
                        Atom stsc @ 26954 of size: 52, ends @ 27006
                        Atom stsz @ 27006 of size: 785956, ends @ 812962
                        Atom stco @ 812962 of size: 8848, ends @ 821810
        Atom trak @ 821810 of size: 454452, ends @ 1276262
            Atom tkhd @ 821818 of size: 92, ends @ 821910
            Atom edts @ 821910 of size: 36, ends @ 821946
                Atom elst @ 821918 of size: 28, ends @ 821946
            Atom mdia @ 821946 of size: 454316, ends @ 1276262
                Atom mdhd @ 821954 of size: 32, ends @ 821986
                Atom hdlr @ 821986 of size: 45, ends @ 822031
                Atom minf @ 822031 of size: 454231, ends @ 1276262
                    Atom smhd @ 822039 of size: 16, ends @ 822055
                    Atom dinf @ 822055 of size: 36, ends @ 822091
                        Atom dref @ 822063 of size: 28, ends @ 822091
                    Atom stbl @ 822091 of size: 454171, ends @ 1276262
                        Atom stsd @ 822099 of size: 91, ends @ 822190
                            Atom mp4a @ 822115 of size: 75, ends @ 822190
                                Atom esds @ 822151 of size: 39, ends @ 822190
                        Atom stts @ 822190 of size: 161368, ends @ 983558
                        Atom stsc @ 983558 of size: 1480, ends @ 985038
                        Atom stsz @ 985038 of size: 282372, ends @ 1267410
                        Atom stco @ 1267410 of size: 8852, ends @ 1276262
        Atom udta @ 1276262 of size: 97, ends @ 1276359
            Atom meta @ 1276270 of size: 89, ends @ 1276359
                Atom hdlr @ 1276282 of size: 33, ends @ 1276315
                Atom ilst @ 1276315 of size: 44, ends @ 1276359
                    Atom ©too @ 1276323 of size: 36, ends @ 1276359
                        Atom data @ 1276331 of size: 28, ends @ 1276359
    Atom mdat @ 1276359 of size: 251293325, ends @ 252569684
    Atom free @ 252569684 of size: 8, ends @ 252569692
    Atom free @ 252569692 of size: 62, ends @ 252569754
    ------------------------------------------------------
    Total size: 252569754 bytes; 50 atoms total. AtomicParsley version: 0.9.0 (utf8)
    Media data: 251293325 bytes; 1276429 bytes all other atoms (0.505% atom overhead).
    Total free atom space: 70 bytes; 0.000% waste. Padding available: 0 bytes.
    ------------------------------------------------------

    On slow connection this movie start playing after 30-40 seconds until header info (4.2 Mb) downloading. I need that movie start playing fast as it possible. And i have next questions :

    1. How reduce size of movie header ?

    2. How reduce size of
      /moov[0]/trak[1]/mdia[0]/minf[0]/stbl[0] and why it so big when
      sample rate 44100 ?

  • Approaches To Modifying Game Resource Files

    16 août 2016, par Multimedia Mike — Game Hacking

    I have been assisting The Translator in the translation of another mid-1990s adventure game. This one isn’t quite as multimedia-heavy as the last title, and the challenges are a bit different. I wanted to compose this post in order to describe my thought process and mental model in approaching this problem. Hopefully, this will help some others understand my approach since what I’m doing here often appears as magic to some of my correspondents.

    High Level Model
    At the highest level, it is valuable to understand the code and the data at play. The code is the game’s engine and the data refers to the collection of resources that comprise the game’s graphics, sound, text, and other assets.


    High-level game engine model
    Simplistic high-level game engine model

    Ideally, we want to change the data in such a way that the original game engine adopts it as its own because it has the same format as the original data. It is very undesirable to have to modify the binary engine executable in any way.

    Modifying The Game Data Directly
    How to modify the data ? If we modify the text strings for the sake of language translation, one approach might be to search for strings within the game data files and change them directly. This model assumes that the text strings are stored in a plain, uncompressed format. Some games might store these strings in a text format which can be easily edited with any text editor. Other games will store them as binary data.

    In the latter situation, a game hacker can scan through data files with utilities like Unix ‘strings’ to find the resources with the desired strings. Then, use a hex editor to edit the strings directly. For example, change “Original String”…

    0098F800   00 00 00 00  00 00 00 4F  72 69 67 69  6E 61 6C 20  .......Original 
    0098F810   53 74 72 69  6E 67 00 00  00 00 00 00  00 00 00 00  String..........
    

    …to “Short String” and pad the difference in string lengths using spaces (0x20) :

    0098F800   00 00 00 00  00 00 00 53  68 6F 72 74  20 53 74 72  .......Short Str
    0098F810   69 6E 67 20  20 20 00 00  00 00 00 00  00 00 00 00  ing   ..........
    

    This has some obvious problems. First, translated strings need to be of equal our smaller length compared to the original. What if we want to encode “Much Longer String” ?

    0098F800   00 00 00 00  00 00 00 4D  75 63 68 20  4C 6F 6E 67  .......Much Long
    0098F810   65 72 20 53  74 72 00 00  00 00 00 00  00 00 00 00  er Str..........
    

    It won’t fit. The second problem pertains to character set limitations. If the font in use was only designed for ASCII, it’s going to be inadequate for expressing nearly any other language.

    So a better approach is needed.

    Understanding The Data Structures
    An alternative to the approach outlined above is to understand the game’s resources so they can be modified at a deeper level. Here’s a model to motivate this investigation :


    Model of the game resource archive model
    Model of the game resource archive format

    This is a very common layout for such formats : there is a file header, a sequence of resource blocks, and a trailing index which describes the locations and types of the foregoing blocks.

    What use is understanding the data structures ? In doing so, it becomes possible to write new utilities that disassemble the data into individual pieces, modify the necessary pieces, and then reassemble them into a form that the original game engine likes.

    It’s important to take a careful, experimental approach to this since mistakes can be ruthlessly difficult to debug (unless you relish the thought of debugging the control flow through an opaque DOS executable). Thus, the very first goal in all of this is to create a program that can disassemble and reassemble the resource, thus creating an identical resource file. This diagram illustrates this complex initial process :


    Rewriting the game resource file
    Rewriting the game resource file

    So, yeah, this is one of the most complicated “copy file” operations that I can possibly code. But it forms an important basis, since the next step is to carefully replace one piece at a time.


    Modifying a specific game resource
    Modifying a specific game resource

    This diagram shows a simplistic model of a resource block that contains a series of message strings. The header contains pointers to each of the strings within the block. Instead of copying this particular resource block directly to the new file, a proposed modification utility will intercept it and rewrite the entire thing, writing new strings of arbitrary length and creating an adjusted header which will correctly point to the start of each new string. Thus, translated strings can be longer than the original strings.

    Further Work
    Exploiting this same approach, we can intercept and modify other game resources including fonts, images, and anything else that might need to be translated. I will explore specific examples in a later blog post.

    Followup

  • Could not find tag for codec h264 in stream #0 (mp4)

    18 août 2019, par TabsNotSpaces

    I’ve been using the sickbeard_mp4_converter for a while to convert video files to mp4 by generating a script for ffmpeg. I’m not sure what I changed, but the ffmpeg script it generates no longer works and I’m having trouble debugging it. Can anyone tell from my log what the issue is ? Yes, its supposed to be an mp4 to an mp4, which is typically fine.

    I’m at the point where I’m using an mp4 that worked with the same autogenerated script yesterday but it no longer is. I remember updating ffmpeg but downgrading did not resolve the issue, though I may have not downgraded enough.

    ffmpeg 4.1.4

    MediaInfo output :

    $ mediainfo --fullscan Downloads/Dallas\ Buyers\ Club\ \(2013\).mp4.original
    General
    Count                                    : 334
    Count of stream of this kind             : 1
    Kind of stream                           : General
    Kind of stream                           : General
    Stream identifier                        : 0
    Count of video streams                   : 1
    Count of audio streams                   : 1
    Video_Format_List                        : AVC
    Video_Format_WithHint_List               : AVC
    Codecs Video                             : AVC
    Audio_Format_List                        : AAC LC
    Audio_Format_WithHint_List               : AAC LC
    Audio codecs                             : AAC LC
    Audio_Language_List                      : English
    Complete name                            : Downloads/Dallas Buyers Club (2013).mp4.original
    Folder name                              : Downloads
    File name extension                      : Dallas Buyers Club (2013).mp4.original
    File name                                : Dallas Buyers Club (2013).mp4
    File extension                           : original
    Format                                   : MPEG-4
    Format                                   : MPEG-4
    Format/Extensions usually used           : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
    Commercial name                          : MPEG-4
    Format profile                           : Base Media
    Internet media type                      : video/mp4
    Codec ID                                 : isom
    Codec ID                                 : isom (isom/avc1)
    Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
    CodecID_Compatible                       : isom/avc1
    File size                                : 1987698473
    File size                                : 1.85 GiB
    File size                                : 2 GiB
    File size                                : 1.9 GiB
    File size                                : 1.85 GiB
    File size                                : 1.851 GiB
    Duration                                 : 7017023
    Duration                                 : 1 h 56 min
    Duration                                 : 1 h 56 min 57 s 23 ms
    Duration                                 : 1 h 56 min
    Duration                                 : 01:56:57.023
    Duration                                 : 01:56:58;17
    Duration                                 : 01:56:57.023 (01:56:58;17)
    Overall bit rate mode                    : VBR
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 2266144
    Overall bit rate                         : 2 266 kb/s
    Frame rate                               : 23.976
    Frame rate                               : 23.976 FPS
    Frame count                              : 168239
    Stream size                              : 3690657
    Stream size                              : 3.52 MiB (0%)
    Stream size                              : 4 MiB
    Stream size                              : 3.5 MiB
    Stream size                              : 3.52 MiB
    Stream size                              : 3.520 MiB
    Stream size                              : 3.52 MiB (0%)
    Proportion of this stream                : 0.00186
    HeaderSize                               : 3690598
    DataSize                                 : 1984007824
    FooterSize                               : 51
    IsStreamable                             : Yes
    Title                                    : Dallas Buyers Club
    Movie name                               : Dallas Buyers Club
    Director                                 : Jean-Marc Valle
    Actor                                    : Matthew McConaughey / Jennifer Garner / Jared Leto / Denis O'Hare / Steve Zahn
    Screenplay by                            : Craig Borten / Melisa Wallack
    Producer                                 : Robbie Brenner / Rachel Winter / Kerry Barden / Rich Delia / Paul Schnee
    Genre                                    : Drama
    ContentType                              : Unknown Type
    Description                              : Sometimes it takes a hustler to change the world
    Recorded date                            : 2013-11-17
    Encoded date                             : UTC 2014-01-24 08:11:15
    Tagged date                              : UTC 2014-01-24 08:11:15
    File last modification date              : UTC 2019-08-16 16:44:14
    File last modification date (local)      : 2019-08-16 11:44:14
    Writing application                      : MDH:Dallas Buyers Club (2013).mp4
    Writing application                      : MDH:Dallas Buyers Club (2013).mp4
    Cover                                    : Yes
    ContentRating                            : mpaa|R|400|
    LongDescription                          : Loosely based on the true-life tale of Ron Woodroof, a drug-taking, women-loving, homophobic man who in 1986 was diagnosed with HIV/AIDS and given thirty days to live.
    FileExtension_Invalid                    : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v

    Video
    Count                                    : 378
    Count of stream of this kind             : 1
    Kind of stream                           : Video
    Kind of stream                           : Video
    Stream identifier                        : 0
    StreamOrder                              : 0
    ID                                       : 1
    ID                                       : 1
    Format                                   : AVC
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format/Url                               : http://developers.videolan.org/x264.html
    Commercial name                          : AVC
    Format profile                           : High@L4.1
    Format settings                          : CABAC / 4 Ref Frames
    Format settings, CABAC                   : Yes
    Format settings, CABAC                   : Yes
    Format settings, Reference frames        : 4
    Format settings, Reference frames        : 4 frames
    Internet media type                      : video/H264
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 7016967
    Duration                                 : 1 h 56 min
    Duration                                 : 1 h 56 min 56 s 967 ms
    Duration                                 : 1 h 56 min
    Duration                                 : 01:56:56.967
    Duration                                 : 01:56:58;17
    Duration                                 : 01:56:56.967 (01:56:58;17)
    Bit rate                                 : 2169000
    Bit rate                                 : 2 169 kb/s
    Maximum bit rate                         : 12300880
    Maximum bit rate                         : 12.3 Mb/s
    Width                                    : 1920
    Width                                    : 1 920 pixels
    Height                                   : 800
    Height                                   : 800 pixels
    Sampled_Width                            : 1920
    Sampled_Height                           : 800
    Pixel aspect ratio                       : 1.000
    Display aspect ratio                     : 2.400
    Display aspect ratio                     : 2.40:1
    Rotation                                 : 0.000
    Frame rate mode                          : CFR
    Frame rate mode                          : Constant
    Frame rate                               : 23.976
    Frame rate                               : 23.976 (24000/1001) FPS
    FrameRate_Num                            : 24000
    FrameRate_Den                            : 1001
    Original frame rate                      : 23.976
    Original frame rate                      : 23.976 (23976/1000) FPS
    FrameRate_Original_Num                   : 23976
    FrameRate_Original_Den                   : 1000
    Frame count                              : 168239
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.059
    Stream size                              : 1901715488
    Stream size                              : 1.77 GiB (96%)
    Stream size                              : 2 GiB
    Stream size                              : 1.8 GiB
    Stream size                              : 1.77 GiB
    Stream size                              : 1.771 GiB
    Stream size                              : 1.77 GiB (96%)
    Proportion of this stream                : 0.95674
    Writing library                          : x264 - core 135 r2 f0c1c53
    Writing library                          : x264 core 135 r2 f0c1c53
    Encoded_Library_Name                     : x264
    Encoded_Library_Version                  : core 135 r2 f0c1c53
    Encoding settings                        : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=9 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-3 / threads=36 / lookahead_threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=2169 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=31250 / vbv_bufsize=31250 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
    Encoded date                             : UTC 2014-01-24 08:11:15
    Tagged date                              : UTC 2014-01-24 08:11:38
    colour_description_present               : Yes
    colour_description_present_Source        : Stream
    Color range                              : Limited
    colour_range_Source                      : Stream
    Color primaries                          : BT.709
    colour_primaries_Source                  : Stream
    transfer_characteristics_Source          : Stream
    Matrix coefficients                      : BT.709
    matrix_coefficients_Source               : Stream
    Codec configuration box                  : avcC

    Audio
    Count                                    : 280
    Count of stream of this kind             : 1
    Kind of stream                           : Audio
    Kind of stream                           : Audio
    Stream identifier                        : 0
    StreamOrder                              : 1
    ID                                       : 2
    ID                                       : 2
    Format                                   : AAC
    Format                                   : AAC LC
    Format/Info                              : Advanced Audio Codec Low Complexity
    Commercial name                          : AAC
    Format settings, SBR                     : No (Explicit)
    Format settings, SBR                     : No (Explicit)
    Format_AdditionalFeatures                : LC
    Codec ID                                 : mp4a-40-2
    Duration                                 : 7017023
    Duration                                 : 1 h 56 min
    Duration                                 : 1 h 56 min 57 s 23 ms
    Duration                                 : 1 h 56 min
    Duration                                 : 01:56:57.023
    Duration                                 : 01:56:38:17
    Duration                                 : 01:56:57.023 (01:56:38:17)
    Bit rate mode                            : VBR
    Bit rate mode                            : Variable
    Bit rate                                 : 93816
    Bit rate                                 : 93.8 kb/s
    Maximum bit rate                         : 107376
    Maximum bit rate                         : 107 kb/s
    Channel(s)                               : 2
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Channel positions                        : 2/0/0
    Channel layout                           : L R
    Samples per frame                        : 1024
    Sampling rate                            : 48000
    Sampling rate                            : 48.0 kHz
    Samples count                            : 336817104
    Frame rate                               : 46.875
    Frame rate                               : 46.875 FPS (1024 SPF)
    Frame count                              : 328923
    Compression mode                         : Lossy
    Compression mode                         : Lossy
    Stream size                              : 82292328
    Stream size                              : 78.5 MiB (4%)
    Stream size                              : 78 MiB
    Stream size                              : 78 MiB
    Stream size                              : 78.5 MiB
    Stream size                              : 78.48 MiB
    Stream size                              : 78.5 MiB (4%)
    Proportion of this stream                : 0.04140
    Language                                 : en
    Language                                 : English
    Language                                 : English
    Language                                 : en
    Language                                 : eng
    Language                                 : en
    Encoded date                             : UTC 2014-01-24 08:11:37
    Tagged date                              : UTC 2014-01-24 08:11:38

    Log :

    $ /usr/local/bin/ffmpeg -i "/Users/Me/Downloads/Dallas Buyers Club (2013).mp4.original" -vcodec libx264 -map 0:0 -vb 2063k -c:a:0 copy -map 0:2 -metadata:s:a:0 language=eng -disposition:a:0 default -f mp4 -threads 0 -y "/Users/Me/Downloads/Dallas Buyers Club (2013).mp4"
    ffmpeg version 4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
     built with Apple LLVM version 10.0.1 (clang-1001.0.46.4)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-I/Library/Java/JavaVirtualMachines/adoptopenjdk-12.0.1.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/adoptopenjdk-12.0.1.jdk/Contents/Home/include/darwin' --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr
     libavutil      56. 22.100 / 56. 22.100
     libavcodec     58. 35.100 / 58. 35.100
     libavformat    58. 20.100 / 58. 20.100
     libavdevice    58.  5.100 / 58.  5.100
     libavfilter     7. 40.101 /  7. 40.101
     libavresample   4.  0.  0 /  4.  0.  0
     libswscale      5.  3.100 /  5.  3.100
     libswresample   3.  3.100 /  3.  3.100
     libpostproc    55.  3.100 / 55.  3.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc38e801400] stream 0, timescale not set
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/Me/Downloads/Dallas Buyers Club (2013).mp4.original':
     Metadata:
       major_brand     : isom
       minor_version   : 1
       compatible_brands: isomavc1
       title           : Dallas Buyers Club
       genre           : Drama
       date            : 2013-11-17
       encoder         : MDH:Dallas Buyers Club (2013).mp4
       media_type      : 9
       hd_video        : 2
       description     : Sometimes it takes a hustler to change the world
       synopsis        : Loosely based on the true-life tale of Ron Woodroof, a drug-taking, women-loving, homophobic man who in 1986 was diagnosed with HIV/AIDS and given thirty days to live.
       creation_time   : 2014-01-24T08:11:15.000000Z
     Duration: 01:56:57.02, start: 0.000000, bitrate: 2266 kb/s
       Stream #0:0: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 500x750 [SAR 1:1 DAR 2:3], 90k tbr, 90k tbn, 90k tbc
       Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/unknown), 1920x800, 2168 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
       Metadata:
         creation_time   : 2014-01-24T08:11:15.000000Z
         handler_name    : video.264#trackID=1:fps=23.976 - Imported with GPAC 0.5.0-rev
       Stream #0:2(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 93 kb/s (default)
       Metadata:
         creation_time   : 2014-01-24T08:11:37.000000Z
         handler_name    : GPAC ISO Audio Handler
    Stream mapping:
     Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
     Stream #0:2 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    [mp4 @ 0x7fc38e811000] Frame rate very high for a muxer not efficiently supporting it.
    Please consider specifying a lower framerate, a different muxer or -vsync 2
    [libx264 @ 0x7fc38e823e00] using SAR=1/1
    [libx264 @ 0x7fc38e823e00] MB rate (135360000) > level limit (16711680)
    [libx264 @ 0x7fc38e823e00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    [libx264 @ 0x7fc38e823e00] profile High, level 6.2
    [libx264 @ 0x7fc38e823e00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=2063 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    [mp4 @ 0x7fc38e811000] Could not find tag for codec h264 in stream #0, codec not currently supported in container
    Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
    Error initializing output stream 0:0 --
    [libx264 @ 0x7fc38e823e00] final ratefactor: 89.20
    Conversion failed!