
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (55)
-
La file d’attente de SPIPmotion
28 novembre 2010, parUne file d’attente stockée dans la base de donnée
Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...) -
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains 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, parPré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 (8255)
-
FFmpeg convert .mov to .ogv
24 juillet 2016, par Morten HaubergI have some troubles converting my .mov to a .ogg file using FFmpeg.
This command should work, right ?
ffmpeg -i test.mov -s 640x320 -vcodec libtheora -acodec libvorbis out.ogv
It gives me this output
[0] => FFmpeg version SVN-r0.5.9-4:0.5.9-1, Copyright (c) 2000-2009 Fabrice Bellard, et al.
[1] => configuration: --extra-version=4:0.5.9-1 --prefix=/usr --enable-avfilter --enable-avfilter-lavf --enable-vdpau --enable-bzlib --enable-libdirac --enable-libgsm --enable-libopenjpeg --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --disable-stripping --disable-vhook --enable-runtime-cpudetect --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libfaad --enable-libdc1394 --enable-shared --disable-static
[2] => libavutil 49.15. 0 / 49.15. 0
[3] => libavcodec 52.20. 1 / 52.20. 1
[4] => libavformat 52.31. 0 / 52.31. 0
[5] => libavdevice 52. 1. 0 / 52. 1. 0
[6] => libavfilter 0. 4. 0 / 0. 4. 0
[7] => libswscale 0. 7. 1 / 0. 7. 1
[8] => libpostproc 51. 2. 0 / 51. 2. 0
[9] => built on Jun 10 2012 08:33:06, gcc: 4.4.5
[10] =>
[11] => Seems stream 0 codec frame rate differs from container frame rate: 1200.00 (1200/1) -> 30.00 (30/1)
[12] => Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.mov':
[13] => Duration: 00:00:06.26, start: 0.000000, bitrate: 809 kb/s
[14] => Stream #0.0(und): Video: h264, yuv420p, 480x360, 30 tbr, 600 tbn, 1200 tbc
[15] => Stream #0.1(und): Audio: aac, 44100 Hz, mono, s16
[16] => Output #0, ogg, to 'out.ogv':
[17] => Stream #0.0(und): Video: libtheora, yuv420p, 640x320, q=2-31, 200 kb/s, 90k tbn, 30 tbc
[18] => Stream #0.1(und): Audio: vorbis, 44100 Hz, mono, s16, 64 kb/s
[19] => Stream mapping:
[20] => Stream #0.0 -> #0.0
[21] => Stream #0.1 -> #0.1
[22] => Press [q] to stop encodingIt seems right, right ?
But the movie is only about 1 second long.
Why is that ?I do not have access to ffmpeg2theora, so please dont suggest that :)
-
Translating Return To Ringworld
17 août 2016, par Multimedia Mike — Game HackingAs 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
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 :
- Translating volumes of text to Spanish
- 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 :
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 !
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 :
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 :
It’s possible to locate and extract the exact image that is overlaid on this scene, though without the colors :
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.
The post Translating Return To Ringworld first appeared on Breaking Eggs And Making Omelettes.
-
Change AVI creation date with ffmpeg ?
1er novembre 2016, par brockAs far as I can tell the following ffmpeg command should copy all existing metadata in the input file to the output file and modify the specified field in the output file :
ffmpeg -i VID_20130502_220104.avi -metadata creation_time="2013-05-02 22:01:04" -codec copy VID_20130502_220104-2.avi
Instead, it seems to strip all metadata from the output file. Here is the output of a few commands. I am going nuts. I think this should work, but why is it not ?
Command to edit the creation time :
ffmpeg -i VID_20130502_220104.avi -metadata creation_time="2013-05-02 22:01:04" -codec copy VID_20130502_220104-2.avi
ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'VID_20130502_220104.avi':
Metadata:
encoder :
maker : NIKON
model : COOLPIX S4300
creation_time : 2011-01-01 00:00:00
Duration: 00:01:30.50, start: 0.000000, bitrate: 32135 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
[avi @ 000000000032ad40] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
Last message repeated 1 times
Output #0, avi, to 'VID_20130502_220104-2.avi':
Metadata:
creation_time : 2013-05-02 22:01:04
maker : NIKON
model : COOLPIX S4300
ISFT : Lavf57.41.100
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, q=2-31, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, 352 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 891 fps=0.0 q=-1.0 size= 116171kB time=00:00:29.69 bitrate=32043.1kbits/s speed=59.4x
frame= 1739 fps=1739 q=-1.0 size= 227191kB time=00:00:57.96 bitrate=32107.5kbits/s speed= 58x
frame= 2609 fps=1739 q=-1.0 size= 340940kB time=00:01:26.96 bitrate=32115.9kbits/s speed= 58x
frame= 2715 fps=1734 q=-1.0 Lsize= 355018kB time=00:01:30.49 bitrate=32136.3kbits/s speed=57.8x
video:350984kB audio:3897kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.038597%Command to inspect the output file metadata with ffmpeg :
ffmpeg -i VID_20130502_220104-2.avi
ffmpeg version 3.1.5 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 28.100 / 55. 28.100
libavcodec 57. 48.101 / 57. 48.101
libavformat 57. 41.100 / 57. 41.100
libavdevice 57. 0.101 / 57. 0.101
libavfilter 6. 47.100 / 6. 47.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'VID_20130502_220104-2.avi':
Metadata:
encoder : Lavf57.41.100
Duration: 00:01:30.50, start: 0.000000, bitrate: 32136 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1280x720, 31782 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, 1 channels, s16, 352 kb/s
At least one output file must be specifiedCommand to inspect the input file metadata with exiftool :
exiftool.exe VID_20130502_220104.avi
ExifTool Version Number : 10.30
File Name : VID_20130502_220104.avi
Directory : .
File Size : 347 MB
File Modification Date/Time : 2013:05:13 16:33:52-04:00
File Access Date/Time : 2015:11:10 23:08:25-05:00
File Creation Date/Time : 2015:11:10 23:08:25-05:00
File Permissions : rw-rw-rw-
File Type : AVI
File Type Extension : avi
MIME Type : video/x-msvideo
Frame Rate : 30
Max Data Rate : 488.3 kB/s
Frame Count : 2715
Stream Count : 2
Stream Type : Video
Video Codec : mjpg
Video Frame Rate : 30
Video Frame Count : 2715
Quality : 10000
Sample Size : Variable
Image Width : 1280
Image Height : 720
Planes : 1
Bit Depth : 24
Compression : MJPG
Image Length : 2764800
Pixels Per Meter X : 0
Pixels Per Meter Y : 0
Num Colors : Use BitDepth
Num Important Colors : All
Audio Codec :
Audio Sample Rate : 22050
Audio Sample Count : 1995256
Encoding : Microsoft PCM
Num Channels : 1
Sample Rate : 22050
Avg Bytes Per Sec : 44100
Bits Per Sample : 16
Maker Note Type : NIKON
Maker Note Version : 0.1.0.0
Make : NIKON
Model : COOLPIX S4300
Software : V1.0
Equipment : NIKON DIGITAL CAMERA
Orientation : Horizontal (normal)
Exposure Time : 1/15
F Number : 3.5
Exposure Compensation : 0
Max Aperture Value : 3.2
Metering Mode : Multi-segment
Focal Length : 4.6 mm
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Date/Time Original : 2011:01:01 00:00:00
Create Date : 2011:01:01 00:00:00
Focus Mode : AF-S
Digital Zoom : 1
Color Mode : COLOR
Sharpness : AUTO
White Balance : NORMAL
Noise Reduction : OFF
Thumbnail Image : (Binary data 3082 bytes, use -b option to extract)
Aperture : 3.5
Duration : 0:01:30
Image Size : 1280x720
Megapixels : 0.922
Shutter Speed : 1/15
Focal Length : 4.6 mmCommand to inspect the output file metadata with exiftool :
exiftool.exe VID_20130502_220104-2.avi
ExifTool Version Number : 10.30
File Name : VID_20130502_220104-2.avi
Directory : .
File Size : 347 MB
File Modification Date/Time : 2016:11:01 00:17:38-04:00
File Access Date/Time : 2016:11:01 00:17:36-04:00
File Creation Date/Time : 2016:11:01 00:15:18-04:00
File Permissions : rw-rw-rw-
File Type : AVI
File Type Extension : avi
MIME Type : video/x-msvideo
Frame Rate : 30
Max Data Rate : 3923 kB/s
Frame Count : 2715
Stream Count : 2
Stream Type : Video
Video Codec : MJPG
Video Frame Rate : 30
Video Frame Count : 2715
Quality : Default
Sample Size : Variable
Image Width : 1280
Image Height : 720
Planes : 1
Bit Depth : 24
Compression : MJPG
Image Length : 2764800
Pixels Per Meter X : 0
Pixels Per Meter Y : 0
Num Colors : Use BitDepth
Num Important Colors : All
Audio Codec : .
Audio Sample Rate : 22050
Audio Sample Count : 1995256
Encoding : Microsoft PCM
Num Channels : 1
Sample Rate : 22050
Avg Bytes Per Sec : 44100
Bits Per Sample : 16
Software : Lavf57.41.100
Duration : 0:01:30
Image Size : 1280x720
Megapixels : 0.922