
Recherche avancée
Médias (91)
-
Chuck D with Fine Arts Militia - No Meaning No
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Paul Westerberg - Looking Up in Heaven
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Le Tigre - Fake French
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Thievery Corporation - DC 3000
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Dan the Automator - Relaxation Spa Treatment
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Gilberto Gil - Oslodum
15 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (69)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Les statuts des instances de mutualisation
13 mars 2010, parPour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)
Sur d’autres sites (15104)
-
Font Size Mismatch When Using Fallback Fonts in FFmpeg ASS Subtitles
6 janvier, par Mostafa FathiI’m facing an issue with font size mismatch in ASS subtitles rendered by FFmpeg when combining English text with Arabic or Persian characters.


Steps to Reproduce :


1.Subtitle File :
Here’s an example of the ASS subtitle file :


[Script Info]
Title: Generated ASS
ScriptType: v4.00+
WrapStyle: 2
ScaledBorderAndShadow: yes
YCbCr Matrix: none
PlayResX: 1920
PlayResY: 1080

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default, ABeeZee, 40, &H00FFFFFF, &H000000FF, &H00000000, &H00000000, -1, 0, 0, 0, 100, 100, 0, 0, 1, 1, 0, 2, 10, 10, 10, 1

[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,0:00:01.00,0:00:05.00,Default,,0,0,0,,Hello! This is English text.
Dialogue: 0,0:00:05.00,0:00:10.00,Default,,0,0,0,,سلام! This is mixed Arabic/English text.



- 

- Command Used :




ffmpeg -i input.mp4 -vf "ass=subtitle.ass" output.mp4



- 

- Screenshots :
Below are two screenshots of the issue :




• Text rendered with the main font (ABeeZee) is correct.




• Text rendered with the fallback font (Cinema) appears larger/smaller in size.




- 

- Debug Logs :




[Parsed_ass_0 @ 0xb4000079f04f8210] libass API version: 0x1701000
[Parsed_ass_0 @ 0xb4000079f04f8210] 
[Parsed_ass_0 @ 0xb4000079f04f8210] libass source: commit: 0.17.1-0-ge8ad72accd3a84268275a9385beb701c9284e5b3
[Parsed_ass_0 @ 0xb4000079f04f8210] 
[Parsed_ass_0 @ 0xb4000079f04f8210] Shaper: FriBidi 1.0.13 (SIMPLE) HarfBuzz-ng 8.0.1 (COMPLEX)
[Parsed_ass_0 @ 0xb4000079f04f8210] 
[Parsed_ass_0 @ 0xb4000079f04f8210] Using font provider fontconfig
[Parsed_ass_0 @ 0xb4000079f04f8210] 
[Parsed_ass_0 @ 0xb4000079f04f8210] Added subtitle file: '/data/***/ass_file.ass' (4 styles, 29 events)
[Parsed_ass_0 @ 0xb4000079f04f8210] 
[Parsed_ass_0 @ 0xb4000079f04f8210] fontselect: (ABeeZee, 400, 0) -> /data/***/ABeeZee_regular.ttf, 0, ABeeZee-Regular
[Parsed_ass_0 @ 0xb4000079f04f8210] 
[Parsed_ass_0 @ 0xb4000079f04f8210] Glyph 0x633 not found, selecting one more font for (ABeeZee, 400, 0)
[Parsed_ass_0 @ 0xb4000079f04f8210] 
[Parsed_ass_0 @ 0xb4000079f04f8210] fontselect: (ABeeZee, 400, 0) -> /data/***/Cinema.ttf, 0, Cinema



Question :


How can I ensure that text rendered with fallback fonts has the same size as the main font ? Are there specific settings in FFmpeg or the ASS subtitle format that can address this issue ? Alternatively, is there a way to manually adjust the scaling of fallback fonts in FFmpeg ?


-
Slicing an AVI file
7 novembre 2014, par Peter LurI am trying to upload only a certain part of an AVI file on the server without having to upload the whole file first.
If I set the slice to the beginning (byte : 0), I can read the resulting file no problem even if I slice it in any size. However if the slice start anywhere but not at byte 0, the file become unreadable. I guess this has something to do with the avi header/index being messed up. I was wondering maybe I could use ffmpeg to move the header or something ?
HTML Source
<code class="echappe-js"><script type="text/javascript"><br />
<br />
window.BlobBuilder = window.MozBlobBuilder || window.WebKitBlobBuilder || window.BlobBuilder;<br />
<br />
function sendRequest() {<br />
var blob = document.getElementById('fileToUpload').files[0];<br />
<br />
<br />
//Slicing parameters<br />
<br />
<br />
//#1: Starting at byte:0 = WORKING WELL<br />
var start = 0;<br />
var end = 1048576; // 1MB chunk sizes.<br />
<br />
<br />
//#2: Slicing the video file somewhere else (FAIL)<br />
<br />
/*<br />
var start = 1048576*3;<br />
var end = 1048576*4;<br />
*/<br />
<br />
<br />
var chunk = blob.slice(start, end, 'video/avi');<br />
uploadFile(chunk);<br />
<br />
}<br />
<br />
function fileSelected() {<br />
var file = document.getElementById('fileToUpload').files[0];<br />
if (file) {<br />
var fileSize = 0;<br />
if (file.size > 1024 * 1024)<br />
fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';<br />
else<br />
fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB';<br />
<br />
document.getElementById('fileName').innerHTML = 'Name: ' + file.name;<br />
document.getElementById('fileSize').innerHTML = 'Size: ' + fileSize;<br />
document.getElementById('fileType').innerHTML = 'Type: ' + file.type;<br />
}<br />
}<br />
<br />
function uploadFile(blobFile) {<br />
//var file = document.getElementById('fileToUpload').files[0]; <br />
var fd = new FormData();<br />
fd.append("fileToUpload", blobFile);<br />
<br />
var xhr = new XMLHttpRequest();<br />
xhr.upload.addEventListener("progress", uploadProgress, false);<br />
xhr.addEventListener("load", uploadComplete, false);<br />
xhr.addEventListener("error", uploadFailed, false);<br />
xhr.addEventListener("abort", uploadCanceled, false);<br />
xhr.open("POST", "upload.php");<br />
xhr.onload = function(e) {<br />
//alert("loaded!");<br />
};<br />
<br />
xhr.send(fd);<br />
//alert("oen over");<br />
}<br />
<br />
function uploadProgress(evt) {<br />
if (evt.lengthComputable) {<br />
var percentComplete = Math.round(evt.loaded * 100 / evt.total);<br />
document.getElementById('progressNumber').innerHTML = percentComplete.toString() + '%';<br />
}<br />
else {<br />
document.getElementById('progressNumber').innerHTML = 'unable to compute';<br />
}<br />
}<br />
<br />
function uploadComplete(evt) {<br />
/* This event is raised when the server send back a response */<br />
//alert(evt.target.responseText);<br />
}<br />
<br />
function uploadFailed(evt) {<br />
alert("There was an error attempting to upload the file.");<br />
}<br />
<br />
function uploadCanceled(evt) {<br />
xhr.abort();<br />
xhr = null;<br />
//alert("The upload has been canceled by the user or the browser dropped the connection.");<br />
}<br />
</script>PHP Source (upload.php)
<?php
$tmp_name = $_FILES['fileToUpload']['tmp_name'];
$size = $_FILES['fileToUpload']['size'];
$name = $_FILES['fileToUpload']['name'];
$target_file = basename($name);
$complete = "complete.avi";
$com = fopen($complete, "ab");
// Open temp file
$out = fopen($target_file, "wb");
if ( $out ) {
// Read binary input stream and append it to temp file
$in = fopen($tmp_name, "rb");
if ( $in ) {
while ( $buff = fread( $in, 1048576 ) ) {
fwrite($out, $buff);
fwrite($com, $buff);
}
}
fclose($in);
fclose($out);
}
fclose($com);
?> -
Save frame as image during video stream using ffmpeg, in C
30 avril 2017, par George T.I’m using the Parrot SDK3 to retrieve the video stream from a Bebop2 drone. From it I need to "extract" a frame and save it as an image.
The whole code can be found here, but I shall try to include the (what I understand as) important parts here.
Where the video is sent to mplayer. I assume from this that the video format is h624.
if (videoOut != NULL)
{
if (codec.type == ARCONTROLLER_STREAM_CODEC_TYPE_H264)
{
if (DISPLAY_WITH_MPLAYER)
{
fwrite(codec.parameters.h264parameters.spsBuffer, codec.parameters.h264parameters.spsSize, 1, videoOut);
fwrite(codec.parameters.h264parameters.ppsBuffer, codec.parameters.h264parameters.ppsSize, 1, videoOut);
fflush (videoOut);
}
}
}Where the frame is received and written to videoOut, to be displayed
eARCONTROLLER_ERROR didReceiveFrameCallback (ARCONTROLLER_Frame_t *frame, void *customData)
{
if (videoOut != NULL)
{
if (frame != NULL)
{
if (DISPLAY_WITH_MPLAYER)
{
fwrite(frame->data, frame->used, 1, videoOut);
fflush (videoOut);
}
}
}
return ARCONTROLLER_OK;
}The idea I had in mind is to
fwrite(frame->data, frame->used, 1, videoOut);
to a different file but that just creates a corrupted file, probably because of encoding. In what way can I get this frame and store it to a separate image ? The preferable image filetype .png, .jpg or .gifAny help will be greatly appreciated ! Thanks in advance !