
Recherche avancée
Autres articles (28)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ; -
Création définitive du canal
12 mars 2010, parLorsque votre demande est validée, vous pouvez alors procéder à la création proprement dite du canal. Chaque canal est un site à part entière placé sous votre responsabilité. Les administrateurs de la plateforme n’y ont aucun accès.
A la validation, vous recevez un email vous invitant donc à créer votre canal.
Pour ce faire il vous suffit de vous rendre à son adresse, dans notre exemple "http://votre_sous_domaine.mediaspip.net".
A ce moment là un mot de passe vous est demandé, il vous suffit d’y (...)
Sur d’autres sites (4349)
-
What is “interoperable TTML” ?
19 septembre 2012, par silviaI’ve just tried to come to terms with the latest state of TTML, the Timed Text Markup Language.
TTML has been specified by the W3C Timed Text Working Group and released as a RECommendation v1.0 in November 2010. Since then, several organisations have tried to adopt it as their caption file format. This includes the SMPTE, the EBU (European Broadcasting Union), and Microsoft.
Both, Microsoft and the EBU actually looked at TTML in detail and decided that in order to make it usable for their use cases, a restriction of its functionalities is needed.
EBU-TT
The EBU released EBU-TT, which restricts the set of valid attributes and feature. “The EBU-TT format is intended to constrain the features provided by TTML, especially to make EBU-TT more suitable for the use with broadcast video and web video applications.” (see EBU-TT).
In addition, EBU-specific namespaces were introduce to extend TTML with EBU-specific data types, e.g. ebuttdt:frameRateMultiplierType or ebuttdt:smpteTimingType. Similarly, a bunch of metadata elements were introduced, e.g. ebuttm:documentMetadata, ebuttm:documentEbuttVersion, or ebuttm:documentIdentifier.
The use of namespaces as an extensibility mechanism will ascertain that EBU-TT files continue to be valid TTML files. However, any vanilla TTML parser will not know what to do with these custom extensions and will drop them on the floor.
Simple Delivery Profile
With the intention to make TTML ready for “internet delivery of Captions originated in the United States”, Microsoft proposed a “Simple Delivery Profile for Closed Captions (US)” (see Simple Profile). The Simple Profile is also a restriction of TTML.
Unfortunately, the Microsoft profile is not the same as the EBU-TT profile : for example, it contains the “set” element, which is not conformant in EBU-TT. Similarly, the supported style features are different, e.g. Simple Profile supports “display-region”, while EBU-TT does not. On the other hand, EBU-TT supports monospace, sans-serif and serif fonts, while the Simple profile does not.
Thus files created for the Simple Delivery Profile will not work on players that expect EBU-TT and the reverse.
Fortunately, the Simple Delivery Profile does not introduce any new namespaces and new features, so at least it is an explicit subpart of TTML and not both a restriction and extension like EBU-TT.
SMPTE-TT
SMPTE also created a version of the TTML standard called SMPTE-TT. SMPTE did not decide on a subset of TTML for their purposes – it was simply adopted as a complete set. “This Standard provides a framework for timed text to be supported for content delivered via broadband means,…” (see SMPTE-TT).
However, SMPTE extended TTML in SMPTE-TT with an ability to store a binary blob with captions in another format. This allows using SMPTE-TT as a transport format for any caption format and is deemed to help with “backwards compatibility”.
Now, instead of specifying a profile, SMPTE decided to define how to convert CEA-608 captions to SMPTE-TT. Even if it’s not called a “profile”, that’s actually what it is. It even has its own namespace : “m608 :”.
Conclusion
With all these different versions of TTML, I ask myself what a video player that claims support for TTML will do to get something working. The only chance it has is to implement all the extensions defined in all the different profiles. I pity the player that has to deal with a SMPTE-TT file that has a binary blob in it and is expected to be able to decode this.
Now, what is a caption author supposed to do when creating TTML ? They obviously cannot expect all players to be able to play back all TTML versions. Should they create different files depending on what platform they are targeting, i.e. a EBU-TT version, a SMPTE-TT version, a vanilla TTML version, and a Simple Delivery Profile version ? Should they by throwing all the features of all the versions into one TTML file and hope that the players will pick out the right things that they require and drop the rest on the floor ?
Maybe the best way to progress would be to make a list of the “safe” features : those features that every TTML profile supports. That may be the best way to get an “interoperable TTML” file. Here’s me hoping that this minimal set of features doesn’t just end up being the usual (starttime, endtime, text) triple.
UPDATE :
I just found out that UltraViolet have their own profile of SMPTE-TT called CFF-TT (see UltraViolet FAQ and spec). They are making some SMPTE-TT fields optional, but introduce a new @forcedDisplayMode attribute under their own namespace “cff :”.
-
How to overlay multiple landscape regions from a single input to a new portrait video ? FFmpeg
27 août 2023, par 3V1LXDI have an electron program that selects multiple regions of a landscape video and lets you rearrange them in a portrait canvas. I'm having trouble building the proper ffmpeg command to create the video. I have this somewhat working. I can export 2 layers, but i can't export if i only have 1 layer or if i have 3 or more layers selected.


2 regions of video selected


layers [
 { top: 0, left: 658, width: 576, height: 1080 },
 { top: 262, left: 0, width: 576, height: 324 }
]
newPositions [
 { top: 0, left: 0, width: 576, height: 1080 },
 { top: 0, left: 0, width: 576, height: 324 }
]
filtergraph [0]crop=576:1080:658:0,scale=576:1080[v0];[0]crop=576:324:0:262,scale=576:324[v1];[v0][v1]overlay=0:0:0:0[out]

No Error export successful



1 region selected


layers [ { top: 0, left: 650, width: 576, height: 1080 } ]
newPositions [ { top: 0, left: 0, width: 576, height: 1080 } ]
filtergraph [0]crop=576:1080:650:0,scale=576:1080[v0];[v0]overlay=0:0[out]

FFmpeg error: [fc#0 @ 000001dd3b6db0c0] Cannot find a matching stream for unlabeled input pad overlay
Error initializing complex filters: Invalid argument



3 regions of video selected


layers [
 { top: 0, left: 641, width: 576, height: 1080 },
 { top: 250, left: 0, width: 576, height: 324 },
 { top: 756, left: 0, width: 576, height: 324 }
]
newPositions [
 { top: 0, left: 0, width: 576, height: 1080 },
 { top: 0, left: 0, width: 576, height: 324 },
 { top: 756, left: 0, width: 576, height: 324 }
]
filtergraph [0]crop=576:1080:641:0,scale=576:1080[v0];[0]crop=576:324:0:250,scale=576:324[v1];[0]crop=576:324:0:756,scale=576:324[v2];[v0][v1][v2]overlay=0:0:0:0:0:756[out]

FFmpeg error: [AVFilterGraph @ 0000018faf2189c0] More input link labels specified for filter 'overlay' than it has inputs: 3 > 2
[AVFilterGraph @ 0000018faf2189c0] Error linking filters

FFmpeg error: Failed to set value '[0]crop=576:1080:698:0,scale=576:1080[v0];[0]crop=576:324:0:264,scale=576:324[v1];[0]crop=576:324:0:756,scale=576:324[v2];[v0][v1][v2]overlay=0:0:0:0:0:0[out]' for option 'filter_complex': Invalid argument
Error parsing global options: Invalid argument



I can't figure out how to construct the proper overlay command. Here is the js code i'm using from my electron app.


ipcMain.handle('export-video', async (_event, args) => {
 const { videoFile, outputName, layers, newPositions } = args;
 const ffmpegPath = path.join(__dirname, 'bin', 'ffmpeg');
 const outputDir = checkOutputDir();
 
 // use same video for each layer as input
 // crop, scale, and position each layer
 // overlay each layer on top of each other

 // export video
 console.log('layers', layers);
 console.log('newPositions', newPositions);

 let filtergraph = '';

 for (let i = 0; i < layers.length; i++) {
 const { top, left, width, height } = layers[i];
 const { width: newWidth, height: newHeight } = newPositions[i];
 const filter = `[0]crop=${width}:${height}:${left}:${top},scale=${newWidth}:${newHeight}[v${i}];`;
 filtergraph += filter;
 }

 for (let i = 0; i < layers.length; i++) {
 const filter = `[v${i}]`;
 filtergraph += filter;
 }

 filtergraph += `overlay=`;
 for (let i = 0; i < layers.length; i++) {
 const { top: newTop, left: newLeft } = newPositions[i];
 const overlay = `${newLeft}:${newTop}:`;
 filtergraph += overlay;
 }

 filtergraph = filtergraph.slice(0, -1); // remove last comma
 filtergraph += `[out]`;
 
 console.log('filtergraph', filtergraph);

 const ffmpeg = spawn(ffmpegPath, [
 '-i', videoFile,
 '-filter_complex', filtergraph,
 '-map', '[out]',
 '-c:v', 'libx264',
 '-preset', 'ultrafast',
 '-crf', '18',
 '-y',
 path.join(outputDir, `${outputName}`)
 ]); 

 ffmpeg.stdout.on('data', (data) => {
 console.log(`FFmpeg output: ${data}`);
 });

 ffmpeg.stderr.on('data', (data) => {
 console.error(`FFmpeg error: ${data}`);
 });

 ffmpeg.on('close', (code) => {
 console.log(`FFmpeg process exited with code ${code}`);
 // event.reply('ffmpeg-export-done'); // Notify the renderer process
 });
});



Any advice might be helpful, The docs are confusing, Thanks.


Edit
I'm getting closer with this
Output :


layers [
 { top: 0, left: 677, width: 576, height: 1080 },
 { top: 240, left: 0, width: 576, height: 324 }
]
newPositions [
 { top: 0, left: 0, width: 576, height: 1080 },
 { top: 0, left: 0, width: 576, height: 324 }
]
filtergraph [0]crop=576:1080:677:0,scale=576:1080[v0];[0]crop=576:324:0:240,scale=576:324[v1];[0][v0]overlay=0:0[o0];[o0][v1]overlay=0:0[o1]



ipcMain.handle('export-video', async (_event, args) => {
 const { videoFile, outputName, layers, newPositions } = args;
 const ffmpegPath = path.join(__dirname, 'bin', 'ffmpeg');
 const outputDir = checkOutputDir();
 
 // use same video for each layer as input
 // crop, scale, and position each layer
 // overlay each layer on top of each other

 // export video
 console.log('layers', layers);
 console.log('newPositions', newPositions);

 let filtergraph = '';

 for (let i = 0; i < layers.length; i++) {
 const { top, left, width, height } = layers[i];
 const { width: newWidth, height: newHeight } = newPositions[i];
 const filter = `[0]crop=${width}:${height}:${left}:${top},scale=${newWidth}:${newHeight}[v${i}];`;
 filtergraph += filter;
 }

 for (let i = 0; i < layers.length; i++) {
 if (i === 0) {
 filtergraph += `[0][v${i}]overlay=`;
 } else {
 filtergraph += `[o${i-1}][v${i}]overlay=`;
 }
 const { top: newTop, left: newLeft } = newPositions[i];
 let overlay = '';
 if (i !== layers.length - 1) {
 overlay = `${newLeft}:${newTop}[o${i}];`;
 } else {
 overlay = `${newLeft}:${newTop};`;
 }
 filtergraph += overlay;
 }

 filtergraph = filtergraph.slice(0, -1); // remove last comma
 filtergraph += `[o${layers.length-1}]`;
 
 console.log('filtergraph', filtergraph);

 const ffmpeg = spawn(ffmpegPath, [
 '-i', videoFile,
 '-filter_complex', filtergraph,
 '-map', `[o${layers.length-1}]`,
 '-c:v', 'libx264',
 '-preset', 'ultrafast',
 '-crf', '18',
 '-y',
 path.join(outputDir, `${outputName}`)
 ]); 

 ffmpeg.stdout.on('data', (data) => {
 console.log(`FFmpeg output: ${data}`);
 });

 ffmpeg.stderr.on('data', (data) => {
 console.error(`FFmpeg error: ${data}`);
 });

 ffmpeg.on('close', (code) => {
 console.log(`FFmpeg process exited with code ${code}`);
 // event.reply('ffmpeg-export-done'); // Notify the renderer process
 });
});



The problem I'm having now is that its overlaying the regions over the original input and keeping the landscape dimensions instead of making a portrait video.


-
lavfi/vf_libvmaf : convert to framesync2.
31 juillet 2017, par Nicolas Georgelavfi/vf_libvmaf : convert to framesync2.
After this commit, the code compiles, but on my setup it
segfaults before and after. It also prints the very worrying
warning :src/libavfilter/vf_libvmaf.c:161:66 : warning : passing argument 4 of ‘compute_vmaf’ from incompatible pointer type [-Wincompatible-pointer-types]
/tmp/i/include/libvmaf.h:26:8 : note : expected ‘int (*)(float *, float *, float *, int, void *)’ but argument is of type ‘int (*)(float *, float *, float *, int, double *, void *)’==12116== Thread 6 :
==12116== Conditional jump or move depends on uninitialised value(s)
==12116== at 0x526D432 : cons_ (ocval.h:1188)
==12116== by 0x526D432 : GenericIT (ocval.h:1119)
==12116== by 0x526D432 : OC::TranslateForNumPyClassesToArray(OC::Val&) (pickleloader.h:92)
==12116== by 0x5211F5D : loads (pickleloader.h:566)
==12116== by 0x5211F5D : LoadValFromArray (chooseser.h:290)
==12116== by 0x5211F5D : LoadValFromFile (chooseser.h:405)
==12116== by 0x5211F5D : _read_and_assert_model(char const*, OC::Val&, OC::Val&, OC::Val&, OC::Val&, OC::Val&, OC::Val&) (vmaf.cpp:77)
==12116== by 0x5212B0F : VmafRunner::run(Asset, int (*)(float*, float*, float*, int, void*), void*, bool, bool, bool, bool, bool) (vmaf.cpp:149)
==12116== by 0x52165B6 : RunVmaf(char const*, int, int, int (*)(float*, float*, float*, int, void*), void*, char const*, char const*, char const*, bool, bool, bool, bool, bool, char const*) (vmaf.cpp:645)
==12116== by 0x518AFFF : compute_vmaf_score (vf_libvmaf.c:161)
==12116== by 0x518AFFF : call_vmaf (vf_libvmaf.c:170)
==12116== by 0x7967493 : start_thread (pthread_create.c:333)
==12116== by 0x7F69A8E : clone (clone.S:97)
==12116==
==12116== Conditional jump or move depends on uninitialised value(s)
==12116== at 0x526D432 : cons_ (ocval.h:1188)
==12116== by 0x526D432 : GenericIT (ocval.h:1119)
==12116== by 0x526D432 : OC::TranslateForNumPyClassesToArray(OC::Val&) (pickleloader.h:92)
==12116== by 0x526D50D : OC::TranslateForNumPyClassesToArray(OC::Val&) (pickleloader.h:94)
==12116== by 0x5211F5D : loads (pickleloader.h:566)
==12116== by 0x5211F5D : LoadValFromArray (chooseser.h:290)
==12116== by 0x5211F5D : LoadValFromFile (chooseser.h:405)
==12116== by 0x5211F5D : _read_and_assert_model(char const*, OC::Val&, OC::Val&, OC::Val&, OC::Val&, OC::Val&, OC::Val&) (vmaf.cpp:77)
==12116== by 0x5212B0F : VmafRunner::run(Asset, int (*)(float*, float*, float*, int, void*), void*, bool, bool, bool, bool, bool) (vmaf.cpp:149)
==12116== by 0x52165B6 : RunVmaf(char const*, int, int, int (*)(float*, float*, float*, int, void*), void*, char const*, char const*, char const*, bool, bool, bool, bool, bool, char const*) (vmaf.cpp:645)
==12116== by 0x518AFFF : compute_vmaf_score (vf_libvmaf.c:161)
==12116== by 0x518AFFF : call_vmaf (vf_libvmaf.c:170)
==12116== by 0x7967493 : start_thread (pthread_create.c:333)
==12116== by 0x7F69A8E : clone (clone.S:97)
==12116==
==12116== Conditional jump or move depends on uninitialised value(s)
==12116== at 0x526D432 : cons_ (ocval.h:1188)
==12116== by 0x526D432 : GenericIT (ocval.h:1119)
==12116== by 0x526D432 : OC::TranslateForNumPyClassesToArray(OC::Val&) (pickleloader.h:92)
==12116== by 0x526D50D : OC::TranslateForNumPyClassesToArray(OC::Val&) (pickleloader.h:94)
==12116== by 0x526D50D : OC::TranslateForNumPyClassesToArray(OC::Val&) (pickleloader.h:94)
==12116== by 0x5211F5D : loads (pickleloader.h:566)
==12116== by 0x5211F5D : LoadValFromArray (chooseser.h:290)
==12116== by 0x5211F5D : LoadValFromFile (chooseser.h:405)
==12116== by 0x5211F5D : _read_and_assert_model(char const*, OC::Val&, OC::Val&, OC::Val&, OC::Val&, OC::Val&, OC::Val&) (vmaf.cpp:77)
==12116== by 0x5212B0F : VmafRunner::run(Asset, int (*)(float*, float*, float*, int, void*), void*, bool, bool, bool, bool, bool) (vmaf.cpp:149)
==12116== by 0x52165B6 : RunVmaf(char const*, int, int, int (*)(float*, float*, float*, int, void*), void*, char const*, char const*, char const*, bool, bool, bool, bool, bool, char const*) (vmaf.cpp:645)
==12116== by 0x518AFFF : compute_vmaf_score (vf_libvmaf.c:161)
==12116== by 0x518AFFF : call_vmaf (vf_libvmaf.c:170)
==12116== by 0x7967493 : start_thread (pthread_create.c:333)
==12116== by 0x7F69A8E : clone (clone.S:97)
==12116==
==12116== Use of uninitialised value of size 8
==12116== at 0x518AC79 : read_frame_8bit (vf_libvmaf.c:147)
==12116== by 0x52AB5E8 : combo (combo.c:149)
==12116== by 0x5212E95 : VmafRunner::run(Asset, int (*)(float*, float*, float*, int, void*), void*, bool, bool, bool, bool, bool) (vmaf.cpp:278)
==12116== by 0x52165B6 : RunVmaf(char const*, int, int, int (*)(float*, float*, float*, int, void*), void*, char const*, char const*, char const*, bool, bool, bool, bool, bool, char const*) (vmaf.cpp:645)
==12116== by 0x518AFFF : compute_vmaf_score (vf_libvmaf.c:161)
==12116== by 0x518AFFF : call_vmaf (vf_libvmaf.c:170)
==12116== by 0x7967493 : start_thread (pthread_create.c:333)
==12116== by 0x7F69A8E : clone (clone.S:97)
==12116==
==12116== Invalid read of size 4
==12116== at 0x518AC79 : read_frame_8bit (vf_libvmaf.c:147)
==12116== by 0x52AB5E8 : combo (combo.c:149)
==12116== by 0x5212E95 : VmafRunner::run(Asset, int (*)(float*, float*, float*, int, void*), void*, bool, bool, bool, bool, bool) (vmaf.cpp:278)
==12116== by 0x52165B6 : RunVmaf(char const*, int, int, int (*)(float*, float*, float*, int, void*), void*, char const*, char const*, char const*, bool, bool, bool, bool, bool, char const*) (vmaf.cpp:645)
==12116== by 0x518AFFF : compute_vmaf_score (vf_libvmaf.c:161)
==12116== by 0x518AFFF : call_vmaf (vf_libvmaf.c:170)
==12116== by 0x7967493 : start_thread (pthread_create.c:333)
==12116== by 0x7F69A8E : clone (clone.S:97)
==12116== Address 0x40 is not stack'd, malloc'd or (recently) free'd
==12116==
==12116==
==12116== Process terminating with default action of signal 11 (SIGSEGV)
==12116== Access not within mapped region at address 0x40
==12116== at 0x518AC79 : read_frame_8bit (vf_libvmaf.c:147)
==12116== by 0x52AB5E8 : combo (combo.c:149)
==12116== by 0x5212E95 : VmafRunner::run(Asset, int (*)(float*, float*, float*, int, void*), void*, bool, bool, bool, bool, bool) (vmaf.cpp:278)
==12116== by 0x52165B6 : RunVmaf(char const*, int, int, int (*)(float*, float*, float*, int, void*), void*, char const*, char const*, char const*, bool, bool, bool, bool, bool, char const*) (vmaf.cpp:645)
==12116== by 0x518AFFF : compute_vmaf_score (vf_libvmaf.c:161)
==12116== by 0x518AFFF : call_vmaf (vf_libvmaf.c:170)
==12116== by 0x7967493 : start_thread (pthread_create.c:333)
==12116== by 0x7F69A8E : clone (clone.S:97)