
Recherche avancée
Médias (1)
-
The pirate bay depuis la Belgique
1er avril 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Image
Autres articles (80)
-
Organiser par catégorie
17 mai 2013, parDans 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, parUtilité
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 (...) -
XMP PHP
13 mai 2011, parDixit Wikipedia, XMP signifie :
Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)
Sur d’autres sites (6046)
-
How to Match ASS Subtitle Font Size with Flutter Text Size for a 1080p Video ?
16 décembre 2024, par Mostafa FathiI’m working on a project where I need to synchronize the font size of ASS subtitles with the text size a user sees in a Flutter application. The goal is to ensure that the text size in a 1080p video matches what the user sees in the app.


What I've Tried :


- 

- Calculating font size using height ratio (PlayResY/DeviceHeight) :




- 

- I used the formula :




FontSize_ASS = FontSize_Flutter * (PlayResY / DeviceHeight)



- 

- While the result seemed logical, the final output in the video was smaller than expected.




- 

- Adding a scaling factor :




- 

- I introduced a scaling factor (around 3.0) to address the size discrepancy.
- This improved the result but still felt inconsistent and lacked precision.






- 

- Using force_style in FFmpeg :




- 

- I applied the force_style parameter to control the font size in FFmpeg directly.




ffmpeg -i input.mp4 -vf "subtitles=subtitle.ass:force_style='FontSize=90'" -c:a copy output.mp4



- 

- While it produced better results, it’s not an ideal solution as it bypasses the calculations in the ASS file.




- 

- Aligning
PlayResX
andPlayResY
in the ASS file :
I ensured that these parameters matched the target video resolution (1920×1080) :




PlayResX: 1920
PlayResY: 1080



- 

- Despite this adjustment, the font size didn’t align perfectly with the Flutter app text size.




- 

- Reading font metrics from the font file dynamically :
To improve precision, I wrote a function in Flutter that reads font metrics (units per EM, ascender, and descender) from the TTF font file and calculates a more accurate scaling factor :




Future readFontMetrics(
 String fontFilePath, 
 double originalFontSize,
) async {
 final fontData = await File(fontFilePath).readAsBytes();
 final fontBytes = fontData.buffer.asUint8List();
 final byteData = ByteData.sublistView(fontBytes);

 int numTables = readUInt16BE(byteData, 4);
 int offsetTableStart = 12;
 Map> tables = {};

 for (int i = 0; i < numTables; i++) {
 int recordOffset = offsetTableStart + i * 16;
 String tag =
 utf8.decode(fontBytes.sublist(recordOffset, recordOffset + 4));
 int offset = readUInt32BE(byteData, recordOffset + 8);
 int length = readUInt32BE(byteData, recordOffset + 12);

 tables[tag] = {
 'offset': offset,
 'length': length,
 };
 }

 if (!tables.containsKey('head') || !tables.containsKey('hhea'){
 print('Required tables not found in the font file.');
 return null;
 }

 int headOffset = tables['head']!['offset']!;
 int unitsPerEm = readUInt16BE(byteData, headOffset + 18);

 int hheaOffset = tables['hhea']!['offset']!;
 int ascender = readInt16BE(byteData, hheaOffset + 4);
 int descender = readInt16BE(byteData, hheaOffset + 6);

 print('unitsPerEm: $unitsPerEm');
 print('ascender: $ascender');
 print('descender: $descender');

 int nominalSize = unitsPerEm;
 int realDimensionSize = ascender - descender;
 double scaleFactor = realDimensionSize / nominalSize;
 double realFontSize = originalFontSize * scaleFactor;

 print('Scale Factor: $scaleFactor');
 print('Real Font Size: $realFontSize');

 return realFontSize;
}



- 

- This function dynamically reads the font properties (ascender, descender, and unitsPerEM) and calculates a scale factor to get the real font size. Despite this effort, discrepancies persist when mapping it to the ASS font size.




Question :
How can I ensure that the font size in the ASS file accurately reflects the size the user sees in Flutter ? Is there a reliable method to calculate or align the sizes correctly across both systems ? Any insights or suggestions would be greatly appreciated.


Thank you ! 🙏


-
FFMPEG conversion from MOV to MP4 Issue : Only 1st second is converted
24 avril 2012, par Jeffi'm trying to convert an MOV file to MP4.
I've tried so many options but the output file still only 1 second length.This is one of the FFMPEG comand I used :
ffmpeg -i NY_BTS1PastryHQnew.mov -f mp4 -vcodec copy -acodec copy
output.mp4The output.mp4 is only 1sec long.
The output of the FFMPEG is :ffmpeg version git-2012-02-22-534a82a Copyright (c) 2000-2012 the FFmpeg developers
built on Feb 22 2012 14:44:38 with gcc 4.4.5
configuration: --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab
libavutil 51. 40.100 / 51. 40.100
libavcodec 54. 4.100 / 54. 4.100
libavformat 54. 1.100 / 54. 1.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 62.101 / 2. 62.101
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 7.100 / 0. 7.100
libpostproc 52. 0.100 / 52. 0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'NY_BTS1PastryHQnew.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
creation_time : 2011-06-17 01:38:11
encoder : Lavf54.1.100
Duration: 00:00:01.45, start: 0.000000, bitrate: 225 kb/s
Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 277 kb/s, 25 fps, 25 tbr, 2500 tbn, 5k tbc
Metadata:
creation_time : 2011-06-17 01:38:11
handler_name :
DataHandler
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 122 kb/s
Metadata:
creation_time : 2011-06-17 01:38:11
handler_name :
DataHandler
File 'output.mp4' already exists. Overwrite ? [y/N] y
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
creation_time : 2011-06-17 01:38:11
encoder : Lavf54.1.100
Stream #0:0(eng): Video: h264 (![0][0][0] / 0x0021), yuv420p, 1280x720, q=2-31, 277 kb/s, 25 fps, 2500 tbn, 2500 tbc
Metadata:
creation_time : 2011-06-17 01:38:11
handler_name :
DataHandler
Stream #0:1(eng): Audio: aac (@[0][0][0] / 0x0040), 48000 Hz, stereo, 122 kb/s
Metadata:
creation_time : 2011-06-17 01:38:11
handler_name :
DataHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 12 fps= 0 q=-1.0 Lsize= 40kB time=00:00:00.40 bitrate= 814.6kbits/s
video:16kB audio:22kB global headers:0kB muxing overhead 4.766554%I can't see any error, do you have a clue ?
Thanks
-
ffmpeg on fb0 from Nexus Galaxy error : "could not get frame filename number 2"
3 mars 2012, par user848106I use ffmpeg to convert fb0 files from Androids and produce screenshots. For some reason this does not work with the Nexus Galaxy.
I get this error :
[image2 @ 0000000001E0E350] Could not get frame filename number 2 from pattern '
image.png'
av_interleaved_write_frame(): Invalid argumentHere is the process :
C:\dev\scripts>adb pull /dev/graphics/fb0
3292 KB/s (16777216 bytes in 4.976s)
C:\dev\scripts>ffmpeg -vframes 1 -vcodec rawvideo -f rawvideo -pix
_fmt rgb32 -s 720x1080 -i fb0 -f image2 -vcodec png image.png
ffmpeg version N-36635-gceb0dd9 Copyright (c) 2000-2012 the FFmpeg developers
built on Jan 9 2012 17:45:55 with gcc 4.6.2
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope
ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en
able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger -
-enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben
c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-
libxvid --enable-zlib
libavutil 51. 34.100 / 51. 34.100
libavcodec 53. 54.100 / 53. 54.100
libavformat 53. 29.100 / 53. 29.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 58.100 / 2. 58.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 6.100 / 0. 6.100
libpostproc 51. 2.100 / 51. 2.100
[rawvideo @ 000000000037D5A0] Estimating duration from bitrate, this may be inac
curate
Input #0, rawvideo, from 'fb0':
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 720x1080, 25 tbr, 25
tbn, 25 tbc
[buffer @ 000000000037D420] w:720 h:1080 pixfmt:bgra tb:1/1000000 sar:0/1 sws_pa
ram:
Output #0, image2, to 'image.png':
Metadata:
encoder : Lavf53.29.100
Stream #0:0: Video: png, bgra, 720x1080, q=2-31, 200 kb/s, 90k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> png)
Press [q] to stop, [?] for help
[image2 @ 0000000001E0E350] Could not get frame filename number 2 from pattern '
image.png'
av_interleaved_write_frame(): Invalid argument