Recherche avancée

Médias (1)

Mot : - Tags -/copyleft

Autres articles (74)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

Sur d’autres sites (13369)

  • Batch file : FOR loop not working to concatenate mp3 and mp4

    7 janvier 2023, par Ionut Bejinariu

    mp3list-1.txt contain the full patch to the mp3 files that will be concatenated

    


    mp4list-1.txt contain full path to the mp4 files that will be concatenated

    


    then both results mergedmp34.mp3 and mergeMp4.mp4 should be combined together in a final MP4 video file with a random name.

    


    something I do wrong I don't understand what

    


    my guess I do something wrong on FOR loop.

    


    sometimes my .txt files contain full path to a single file mp4 or mp3

    


    if don't have what to combine will concatenate 1 single file ?

    


    set exportdir=
set batsource= the place where this batch file is

1< mp3list-1.txt 2< mp4list-1.txt (
    FOR %%A in ("%batsource%") DO (
        set /p mp3list=" <&1
        set /p mp4list=" <&2
        ffmpeg -f concat -safe 0 -i "!mp3list!" -c copy mergedmp34.mp3
        ffmpeg -f concat -safe 0 -i "!mp4list!" -c copy mergeMp4.mp4
        ffmpeg -i mergedmp34.mp3 -i mergeMp4.mp4 -map 0:v -map 1:a -vcodec copy -c:a aac -b:a 320k "%exportdir%\%RANDOM%.mp4"
        del mergedmp34.mp3
        del mergeMp4.mp4
 
         
    )
)



    


    mp4list-1.txt

    


    F:\.....Videos-115\output-mp4.txt
F:\....\Videos-1150\output-mp4.txt
F:\.....\Videos-1151\output-mp4.txt
F:\......Videos-1152\output-mp4.txt


    


    mp3list-1.txt

    


    F:\......audio-52\output-mp3.txt



    


    and .txt with direct files are like :

    


    file 'F:\....00OH7011.mp3'
file 'F:\....00OH7011.mp3'
file 'F:\....00OH7011.mp3'


    


    and for videos

    


    file 'F:\....00OH7011.mp4'
file 'F:\....00OH7011.mp4'
file 'F:\....00OH7011.mp4'


    


    Later Edit
basically, I want to adapt to my needs the above script based on this working script bellow where I have 4 txt files that are looped.

    


    mkdir ".\Export"
set "sourcedir="  
set "outputdir=Export"

1< codfundal.txt 2< fontalbum.txt 3< album.txt 4< artist.txt (for %%F in (*.jpg *.jpeg) do (
set /P "artist=" <&4 
set /P "fontalbum="<&2  
set /P "album=" <&3
set /P "codfundal=" <&1
   
   
   magick convert -gamma 1 -contrast 30 %%F -fill white -undercolor  "!codfundal!"  -gravity Center -font "!fontalbum!" -pointsize 215   -annotate +0+5  "!album!"  -gravity Center -pointsize 120 -font "Calibri-Bold" -annotate +0+220 "!artist!" -crop 1440x1440+0+0   -quality 92 "%outputdir%\%%F" 




    )
)


    


    album.txt

    


    Circumferential
Genealogy
Iraqi
Fitters


    


    artist.txt

    


    Bhaskar Punk
Costas Fourie
Sonja Bryan
Jin Gullberg



    


    codfundal.txt

    


    
#E70E0E
#ff00ff
#993366
#99cc00
#cc99ff


    


    fontalbum.txt

    


    Bauhaus-93
Agency-FB
Bernard-MT-Condensed
Bodoni-MT


    


  • 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

  • Downscale and padding with FFmpeg

    26 juin 2022, par nrofis

    I have an input video with a resolution of 3000x2160. I want to downscale it to 1920x1080 but keep the aspect ratio and center the original view by adding padding.

    


    I tried this command :

    


    ffmpeg -i input.mkv -c:v libx264 -vf scale=-1:1080,pad=1920:1080:'(ow-iw)/2':0 output.1080.mp4


    


    But I get an error :

    


    


    Padded dimensions cannot be smaller than input dimensions.

    


    


    Of course, since I want to add padding relatively to the output video size.

    


    How can I downscale and add padding to the output view ?