Recherche avancée

Médias (91)

Autres articles (16)

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

  • Les tâches Cron régulières de la ferme

    1er décembre 2010, par

    La gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
    Le super Cron (gestion_mutu_super_cron)
    Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

Sur d’autres sites (3421)

  • avcodec/v410dec : add support for frame and slice threading

    25 novembre 2019, par Limin Wang
    avcodec/v410dec : add support for frame and slice threading
    

    1, Test server configure :
    [root@localhost ]# cat /proc/cpuinfo |grep "model name"
    model name  : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
    model name  : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
    ...

    [root@localhost ]# free -h
    total used free shared buff/cache available
    Mem : 102G 1.1G 100G 16M 657M 100G
    Swap : 4.0G 0B 4.0G

    2, Test result :
    encode the v410 input data for testing :
    ./ffmpeg -y -i 4k_422.ts -c:v v410 -vframes 10 test.avi

    master :
    ./ffmpeg -y -stream_loop 1000 -i ./test.avi -benchmark -f null -
    frame=10010 fps= 37 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed= 8.6x
    video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown
    bench : utime=166.016s stime=102.192s rtime=268.120s
    bench : maxrss=273400kB

    patch applied :
    ./ffmpeg -y -threads 2 -thread_type slice -stream_loop 1000 -i ./test.avi -benchmark -f null -
    frame=10010 fps= 53 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=12.3x
    video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown
    bench : utime=165.135s stime=100.456s rtime=187.994s
    bench : maxrss=275476kB

    ./ffmpeg -y -threads 2 -thread_type frame -stream_loop 1000 -i ./test.avi -benchmark -f null -
    frame=10010 fps= 61 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=14.1x
    video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead : unknown
    bench : utime=171.386s stime=122.102s rtime=163.637s
    bench : maxrss=340308kB

    Signed-off-by : Limin Wang <lance.lmwang@gmail.com>
    Signed-off-by : Michael Niedermayer <michael@niedermayer.cc>

    • [DH] libavcodec/v410dec.c
  • 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

    The post Approaches To Modifying Game Resource Files first appeared on Breaking Eggs And Making Omelettes.

  • an error about ffmpeg:maybe incorrect parameters such as bit_rate, rate, width or height?

    7 janvier 2023, par Roberick Li
    subprocess.CalledProcessError: Command &#x27;[&#x27;ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;, &#x27;-s&#x27;, &#x27;300x300&#x27;, &#x27;-pix_fmt&#x27;, &#x27;rgba&#x27;, &#x27;-r&#x27;, &#x27;20&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, &#x27;-i&#x27;, &#x27;pipe:&#x27;, &#x27;-vcodec&#x27;, &#x27;h264&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;-y&#x27;, &#x27;./save/humanml_trans_enc_512/samples_humanml_trans_enc_512_000200000_seed10/sample00_rep00.mp4&#x27;]&#x27; returned non-zero exit status 1.&#xA;

    &#xA;

    this is the error when I running a python script :

    &#xA;

    Traceback (most recent call last):&#xA;  File "/home/rob/anaconda3/envs/mdm/lib/python3.7/runpy.py", line 193, in _run_module_as_main&#xA;    "__main__", mod_spec)&#xA;  File "/home/rob/anaconda3/envs/mdm/lib/python3.7/runpy.py", line 85, in _run_code&#xA;    exec(code, run_globals)&#xA;  File "/home/rob/motion-diffusion-model/sample/generate.py", line 256, in <module>&#xA;    main()&#xA;  File "/home/rob/motion-diffusion-model/sample/generate.py", line 189, in main&#xA;    plot_3d_motion(animation_save_path, skeleton, motion, dataset=args.dataset, title=caption, fps=fps)&#xA;  File "/home/rob/motion-diffusion-model/data_loaders/humanml/utils/plot_script.py", line 128, in plot_3d_motion&#xA;    ani.save(save_path, fps=fps)&#xA;  File "/home/rob/anaconda3/envs/mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 1156, in save&#xA;    writer.grab_frame(**savefig_kwargs)&#xA;  File "/home/rob/anaconda3/envs/mdm/lib/python3.7/contextlib.py", line 130, in __exit__&#xA;    self.gen.throw(type, value, traceback)&#xA;  File "/home/rob/anaconda3/envs/mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 232, in saving&#xA;    self.finish()&#xA;  File "/home/rob/anaconda3/envs/mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 367, in finish&#xA;    self.cleanup()&#xA;  File "/home/rob/anaconda3/envs/mdm/lib/python3.7/site-packages/matplotlib/animation.py", line 411, in cleanup&#xA;    self._proc.returncode, self._proc.args, out, err)&#xA;subprocess.CalledProcessError: Command &#x27;[&#x27;ffmpeg&#x27;, &#x27;-f&#x27;, &#x27;rawvideo&#x27;, &#x27;-vcodec&#x27;, &#x27;rawvideo&#x27;, &#x27;-s&#x27;, &#x27;300x300&#x27;, &#x27;-pix_fmt&#x27;, &#x27;rgba&#x27;, &#x27;-r&#x27;, &#x27;20&#x27;, &#x27;-loglevel&#x27;, &#x27;error&#x27;, &#x27;-i&#x27;, &#x27;pipe:&#x27;, &#x27;-vcodec&#x27;, &#x27;h264&#x27;, &#x27;-pix_fmt&#x27;, &#x27;yuv420p&#x27;, &#x27;-y&#x27;, &#x27;./save/humanml_trans_enc_512/samples_humanml_trans_enc_512_000200000_seed10/sample00_rep00.mp4&#x27;]&#x27; returned non-zero exit status 1.&#xA;</module>

    &#xA;

    Thanks for you help very much !!!

    &#xA;

    I tried to run the command alone, then for a long time the program did not return, and after using ctrl+c it reported the following error:

    &#xA;

    [libopenh264 @ 0x555582eec100] Incorrect library version loaded&#xA;Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height&#xA;

    &#xA;