
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (57)
-
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 (...) -
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
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 (5786)
-
Add logo or watermark to Converted video using ffmpeg and PHP
27 mars 2022, par Medicare AdvisorsWe are converting videos to MP4 using FFMPEG.


We did a lot of research, however we cannot figure out how to add the company logo as a logo or a water mark to the converted video


PHP code


<?php 
$uploads_dir = 'original/';
$file_name = basename($_FILES['file']['name']);
$output_name = explode('.', $file_name)[0];
$uploaded_file = $uploads_dir . $file_name;
$convert_status = ['mp4' => 0, 'webm' => 0];

if(isset($_POST['submit'])) {
 if(move_uploaded_file($_FILES['file']['tmp_name'], $uploaded_file)) {
 // Make sure to get the correct path to ffmpeg
 // Run $ where ffmpeg to get the path
 $ffmpeg = '/bin/ffmpeg';
 
 // MP4
 $video_mp4 = $output_name . '.mp4';
 exec($ffmpeg . ' -i "' . $uploaded_file . '" -vcodec h264 -acodec libfdk_aac "./converted/' . $video_mp4 . '" -y 1>convert.txt 2>&1', $output, $convert_status['mp4']);

 // Debug
 // echo '<pre>' . print_r($output, 1) . ' </pre>';

 

 // Debug
 // echo '<pre>' . print_r($output, 1) . ' </pre>';
 }
}
?>



The logo we want to add is on : https://propeview.com/wp-content/uploads/2021/08/logo-whiteb.png


-
Remuxing mp4 on the fly with FFmpeg API
25 octobre 2015, par VadymMy goal is to stream out mpegts. As input, I take an mp4 file stream. That is, video producer writes mp4 file into a stream that I try to work with. The video may be anywhere from one minute to ten minutes. Because producer writes bytes into stream, the originally written mp4 header is not complete (first 32 bytes prior to ftyp are 0x00 because it doesn’t know yet various offsets... which are written post-recording, I think) :
This is how the header of typical mp4 looks like :
00 00 00 18 66 74 79 70 69 73 6f 6d 00 00 00 00 ....ftypisom....
69 73 6f 6d 33 67 70 34 00 01 bb 8c 6d 64 61 74 isom3gp4..»ŒmdatThis is how the header of "in progress" mp4 looks like :
00 00 00 00 66 74 79 70 69 73 6f 6d 00 00 00 00 ....ftypisom....
69 73 6f 6d 33 67 70 34 00 00 00 18 3f 3f 3f 3f isom3gp4....????
6d 64 61 74 mdatIt is my guess but I assume that once the producer completes recording, it updates the header by writing all the necessary offsets.
I have run into two issues while trying to make this work :
- I created a custom AVIO with read function that does not support seeking. In my driver program, I decided to stream in a properly formatted mp4 file. I am able to detect its input format. When I try to open it, I see that my custom read function gets executed within avformat_open_input until the entire file is read in.
My code sample :
av_register_all();
AVFormatContext* pCtx = avformat_alloc_context();
pCtx->pb = avio_alloc_context(
pBuffer, // internal buffer
iBufSize, // internal buffer size
0, // bWriteable (1=true,0=false)
stream, // user data ; will be passed to our callback functions
read_stream, // read callback function
NULL, // write callback function (not used in this example)
NULL // seek callback function
);
pCtx->pb->seekable = 0;
pCtx->pb->write_flag = 0;
pCtx->iformat = av_find_input_format( "mp4" );
pCtx->flags |= AVFMT_FLAG_CUSTOM_IO;
avformat_open_input( &pCtx, "", pCtx->iformat, NULL );Obviously, this does not work as I need (I expectations were wrong). Once I substitute the file of finite size by a stream of varies length, I cannot have avformat_open_input wait around for the stream to finish before attempting to do further processing.
As such, I need to find a way to open input without attempt to read it and only read when I execute av_read_frame. Is this at all possible to do by using custom AVIO. That is, prepare/open input -> read initial input data into input buffer -> read frame/packet from input buffer -> write packet to output -> repeat read input data until the end of stream.
I did scavenge google and only saw two alternatives : providing custom URLProtocol and using AVFMT_NOFILE.
Custom URLProtocol
This sounds like a little backwards way for what I’m trying to accomplish. I understand that it is best used when there is a file source available. Whereas I am trying to read from a byte stream. Also, another reason I think it doesn’t fit my needs is that custom URLProtocol needs to be compiled into ffmpeg lib, correct ? Or is there a way to manually register it during runtime ?AVFMT NOFILE
This seems like something that should actually work best for me. The flag itself says that there is no underlying source file and assumes that I will handle all the reading and provisioning of input data. The trouble is that I haven’t seen any online code snippets so far but my assumption is as follows :I am really hoping to get some suggestions of food for brain from anyone because I am a newbie to ffmpeg and digital media and my second issue expects that I can stream output while ingesting input.
-
As I mentioned above, I have a handle on the mp4 file bytestream as it would be written to the hard disk. The format is mp4 (h.264 and aac). I need to remux it to mpegts prior to streaming it out. This shouldn’t be difficult because mp4 and mpegts are simply containers. From what I learned so far, mp4 file looks the following :
[header info containing format versions]
mdat
[stream data, in my case h.264 and aac streams]
[some trailer separator]
[trailer data]
If that is correct, I should be able to get the handle on h.264 and aac interleaved data by simply starting to read the stream after "mdat" identifier, correct ?
If that is true and I decide to go with AVFMT_NOFILE approach of managing input data, I can just ingest stream data (into AVFormatContext buffer) -> av_read_frame -> process it -> populate AVFormatContext with more data -> av_read_frame -> and so on until the end of stream.
I know, this is a mouthful and a dump of my thoughts but I would appreciate any discussion, pointers, thoughts !
-
ffmpeg change metadata inside video file
26 novembre 2020, par virtualsetsHello I have problems to change timecode insdie metadata of a video file "mov"


ruta=r"E:\Brutos-sin-eliminar\inma-ruben-22-2-2020\multicam\\"
nombre=r"A019_02230134_C186.mov"
comand="ffmpeg -i " + nombre + " -ss 0 -map 0 -acodec copy -vcodec copy -timecode 01:20:10:00 -metadata:s:2:0 timecode=01:20:10:00 -metadata:s:1:0 timecode=01:20:10:00 -metadata:s:0:2 -metadata:s:0:2 timecode=01:10:10:00"+ " convert_" + nombre

os.popen(comand)



I need to put muy own timecode to the file but this command not works.


The console give me


mov @ 00000225287fdc00] You requested a copy of the original timecode track so timecode metadata are now ignored
Output #0, mov, to 'convert_A019_02230134_C186.mov':
 Metadata:
 major_brand : qt 
 minor_version : 537199360
 compatible_brands: qt 
 com.blackmagic-design.camera.windowedSensor: 1
 com.apple.proapps.manufacturer: Blackmagic Design
 com.blackmagic-design.camera.uuid: 3cf1dd9e-e307-47ff-864e-5487fea3fa47
 com.blackmagic-design.camera.projectFPS: 25
 com.apple.proapps.shootingRate: 50
 com.blackmagic-design.camera.cameraType: Blackmagic Pocket Cinema Camera 4K
 com.blackmagic-design.camera.shutterAngle: 180°
 com.blackmagic-design.camera.shutterMode: Angle
 com.blackmagic-design.camera.iso: 3200
 com.blackmagic-design.camera.whiteBalanceKelvin: 3000
 com.blackmagic-design.camera.whiteBalanceTint: -44
 com.apple.proapps.customgamma: com.blackmagic-design.camera.filmlog
 com.blackmagic-design.camera.look.LUTName: Blackmagic Pocket 4K Film to Extended Video.cube
 com.blackmagic-design.camera.guides.aspectRatio: 2:1
 com.blackmagic-design.camera.guides.safeArea: 90
 com.blackmagic-design.camera.firmware: 6.6
 com.apple.proapps.clipID: A019_02230134_C186
 com.apple.proapps.reel: 19
 com.apple.proapps.scene: 1
 com.apple.proapps.shot: 99
 com.apple.proapps.isGood: 0
 com.blackmagic-design.camera.environment: interior
 com.blackmagic-design.camera.dayNight: day
 com.apple.proapps.cameraName: A
 com.blackmagic-design.camera.colorScience: Blackmagic Pocket Cinema Camera 4K, Color Science Gen 4
 com.blackmagic-design.camera.dateRecorded: 2020:02:23
 timecode : 01:20:10:00
 encoder : Lavf58.11.101
 Stream #0:0(eng): Video: prores (apcn / 0x6E637061), yuv422p10le(bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 122315 kb/s, 25 fps, 25 tbr, 12800 tbn, 25 tbc (default)
 Metadata:
 creation_time : 01:10:10:00
 handler_name : ?Apple Alias Data Handler
 encoder : Apple ProRes 422
 timecode : 01:10:10:00
 Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s (default)
 Metadata:
 creation_time : 2020-02-23T00:34:02.000000Z
 handler_name : ?Apple Alias Data Handler
 timecode : 01:20:10:00
 Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
 Metadata:
 creation_time : 2020-02-23T00:34:02.000000Z
 handler_name : ?Apple Alias Data Handler
 timecode : 01:20:10:00
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
 Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame= 467 fps=0.0 q=-1.0 Lsize= 281452kB time=00:00:18.64 bitrate=123693.3kbits/s speed=71.1x 
video:278913kB audio:2531kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.002533%



I dont understand why not modificate the mov file... when open the metadata it is oringinal.


Reggards