
Recherche avancée
Autres articles (5)
-
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
MediaSPIP Init et Diogène : types de publications de MediaSPIP
11 novembre 2010, parÀ l’installation d’un site MediaSPIP, le plugin MediaSPIP Init réalise certaines opérations dont la principale consiste à créer quatre rubriques principales dans le site et de créer cinq templates de formulaire pour Diogène.
Ces quatre rubriques principales (aussi appelées secteurs) sont : Medias ; Sites ; Editos ; Actualités ;
Pour chacune de ces rubriques est créé un template de formulaire spécifique éponyme. Pour la rubrique "Medias" un second template "catégorie" est créé permettant d’ajouter (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)
Sur d’autres sites (4165)
-
How to correctly calculate which segments are ready to be downloaded using MPEG-DASH
24 avril 2019, par igal kWhat i’m trying to do ?
Write a simple MPEG-DASH client using the
SegmentTemplate
pattern to calculate which segments are ready to be downloaded for a live source.A picture taken using
chrome
’s debugging tools at a momentX
showing anmpd
request(8af651fd747.....mpd
) and the actual segments fetched respectfully to that request.Given the following
MPD
<mpd availabilitystarttime="2019-04-24T06:43:32Z" maxsegmentduration="PT4.096S" minbuffertime="PT4.096S" minimumupdateperiod="PT15.835S" profiles="urn:mpeg:dash:profile:isoff-live:2011" publishtime="2019-04-24T11:14:01Z" suggestedpresentationdelay="PT11.878S" timeshiftbufferdepth="PT65.536S" type="dynamic" xmlns="urn:mpeg:dash:schema:mpd:2011">
<location>https://content-aaps1.uplynk.com/channel/8af651fd7473474f86a05ffb0a1c8972.mpd?rmt=wv&amp;cid=8af651fd7473474f86a05ffb0a1c8972&amp;oid=600e5c27541344a1bf3818617ad712ce&amp;prettydash=1&amp;exp=1556091088&amp;rn=4138683939&amp;tc=1&amp;ct=c&amp;sig=5fb7f0c18f3f1d2ad4fdee53c02c1e1ed904bc5e8474f4ebf886d209ff7f21c9&amp;pbs=05b6594bcf4b4728ac1094976a80194d</location>
<period start="PT2826.240S">
<adaptationset maxframerate="30" maxheight="720" maxwidth="1280" mimetype="video/mp4" segmentalignment="true" startwithsap="1">
<representation bandwidth="2604473" codecs="avc1.64001e" framerate="30" height="360" scantype="progressive" width="640">
<baseurl>https://x-default-stgec.uplynk.com/aapm/slices/8c1/600e5c27541344a1bf3818617ad712ce/8c1027496a964b049f1bd5895f8f0412/</baseurl>
<segmenttemplate duration="368640" initialization="https://x-default-stgec.uplynk.com/aapm/slices/8c1/600e5c27541344a1bf3818617ad712ce/8c1027496a964b049f1bd5895f8f0412/$RepresentationID$_init.mp4?pbs=05b6594bcf4b4728ac1094976a80194d&amp;_jt=l&amp;chid=8af651fd7473474f86a05ffb0a1c8972" media="$RepresentationID$$Number%08d$.m4f?pbs=05b6594bcf4b4728ac1094976a80194d&amp;_jt=l&amp;chid=8af651fd7473474f86a05ffb0a1c8972" presentationtimeoffset="254361599" startnumber="690" timescale="90000"></segmenttemplate>
</representation>
</adaptationset>
</period>
<utctiming schemeiduri="urn:mpeg:dash:utc:http-iso:2014" value="https://content-aaps1.uplynk.com/misc/utcservertime"></utctiming>
</mpd>I see that the next segment request should be #3955
What i have tried so far
period.end = 1556104456;
period.start = 2826;
availability_start_time = 1556088212;
max_segment_duration = 4;
time_shift_buffer_depth = 65So, first of all, i read DASH-IF-IOP 4.3 section
4.3.4.2
page #82 and implemented the following code :int k1 = 1;
int period_duration = period.end - (period.start + data_.availability_start_time);
int k2 = ceil((float)period_duration / (float)data_.max_segment_duration);
double duration = ((float)representation.duration / (float)representation.timeScale);
size_t live_edge = std::min(
(int)floor((float)((data_.publish_time - data_.availability_start_time - period.start) / duration)), k2);
size_t oldest = std::max(k1, (int)floor((float)((data_.publish_time - data_.availability_start_time - period.start -
data_.time_shift_buffer_depth) /
duration)));after calculating everything :
k1=1
, k2=3355
,live_edge=3272
andoldest=3256
Also tried using
ffmpeg
’sdashdec.c
for min_segment :
if (c->is_live && pls->fragment_duration)
{
num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time) - c->time_shift_buffer_depth) * pls->fragment_timescale) / pls->fragment_duration;
}for max_segment :
num = pls->first_seq_no + (((get_current_time_in_sec() - c->availability_start_time)) * pls->fragment_timescale) / pls->fragment_duration;
after a small modification :
size_t pmax = (((data_.publish_time - data_.availability_start_time))) / duration;
size_t pmin = ((data_.publish_time - data_.availability_start_time) - data_.time_shift_buffer_depth) / duration;pmin=3946
pmax=3961
in the ffmpeg example, i had to manually remove the
first_seq_no
variable because it looked like i doubled added theSegmentTemplate@StartNumber
.even after succeeding in this task, how do i exactly build the request list of
Segment(NOW)
---->Segment(LIVE_EDGE)
-
Input area 0:0:1280:675 not within the padded area 0:0:1280:674 or zero-sized
7 septembre 2020, par ottpeterI'm setting a padding to a list of videos. When resolution was 854x480, it worked, when I switched to 1280x720 it does not work. Most likely this is because of odd numbers, as stated in this question : FFmpeg pad filter calculating wrong width


This was my original code (bash script creating the filter complex parts) :


# Resolution
RES_X=1280
RES_Y=720
...
FILTER_COMPLEX_LIST="${FILTER_COMPLEX_LIST}[$i:v]scale=$RES_X:$RES_Y:force_original_aspect_ratio=1,pad=width=$RES_X:height=$RES_Y:x='if(lt(in_w,$RES_X),($RES_X-in_w)/2,0)':0,setsar=1[v$i];"



I changed the calculation of pad width and pad height, but the error is the same.


FILTER_COMPLEX_LIST="${FILTER_COMPLEX_LIST}[$i:v]scale=$RES_X:$RES_Y:force_original_aspect_ratio=1,pad=width=ceil($RES_X/2)*2:height=ceil($RES_Y/2)*2:x='if(lt(in_w,$RES_X),($RES_X-in_w)/2,0)':0,setsar=1$



This is the error :




[Parsed_pad_19 @ 0x558b4fe3bb40] Input area 0:0:1280:675 not within
the padded area 0:0:1280:674 or zero-sized [Parsed_pad_19 @
0x558b4fe3bb40] Failed to configure input pad on Parsed_pad_19 Error
configuring complex filters. Invalid argument




I don't understand why padded area is not
padded area 0:0:1280:720
in the first place.
Where should I add the ceil() or floor() function to make this work ?

-
How do I use ffmpeg in my renderer process in electron ?
16 juillet 2023, par InfinibyteI'm trying to use ffmpeg in my renderer process in my electron app. I expose the modules in my preload.js file like this :


const { contextBridge, ipcRenderer } = require('electron');
const ffmpegStatic = require('ffmpeg-static');
const ffmpeg = require('fluent-ffmpeg');
// make ffmpeg available as a function in the renderer process
contextBridge.exposeInMainWorld('ffmpeg', () => ffmpeg(ffmpegStatic.path));



And I try to acces it in my renderer.js file like this :


video.addEventListener('change', (event) => {
 const file = event.target.files[0];
 const filePath = file.path;
 const fileName = file.name;
 const fileExt = fileName.split('.').pop();
 const newFileName = fileName.replace(fileExt, 'mp4');
 const newFilePath = filePath.replace(fileName, newFileName);

 // Run FFmpeg
 ffmpeg()

 // Input file
 .input(filePath)

 // Audio bit rate
 .outputOptions('-ab', '192k')

 // Output file
 .saveToFile(newFilePath)

 // Log the percentage of work completed
 .on('progress', (progress) => {
 if (progress.percent) {
 console.log(`Processing: ${Math.floor(progress.percent)}% done`);
 }
 })

 // The callback that is run when FFmpeg is finished
 .on('end', () => {
 console.log('FFmpeg has finished.');
 })

 // The callback that is run when FFmpeg encountered an error
 .on('error', (error) => {
 console.error(error);
 });
});



But then I get following error in the console : Uncaught TypeError : ffmpeg(...).input is not a function at HTMLInputElement.
I really don't know how to fix this, can anyone help me ?


I tried writing it differently and defining ffmpeg in my rendere.js but nothing worked...