Recherche avancée

Médias (1)

Mot : - Tags -/Rennes

Autres articles (57)

  • XMP PHP

    13 mai 2011, par

    Dixit 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, par

    Talk 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, par

    Le 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 Advisors

    We 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

    


    &lt;?php &#xA;$uploads_dir = &#x27;original/&#x27;;&#xA;$file_name = basename($_FILES[&#x27;file&#x27;][&#x27;name&#x27;]);&#xA;$output_name = explode(&#x27;.&#x27;, $file_name)[0];&#xA;$uploaded_file = $uploads_dir . $file_name;&#xA;$convert_status = [&#x27;mp4&#x27; => 0, &#x27;webm&#x27; => 0];&#xA;&#xA;if(isset($_POST[&#x27;submit&#x27;])) {&#xA;  if(move_uploaded_file($_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;], $uploaded_file)) {&#xA;    // Make sure to get the correct path to ffmpeg&#xA;    // Run $ where ffmpeg to get the path&#xA;    $ffmpeg = &#x27;/bin/ffmpeg&#x27;;&#xA;    &#xA;    // MP4&#xA;    $video_mp4 = $output_name . &#x27;.mp4&#x27;;&#xA;    exec($ffmpeg . &#x27; -i "&#x27; . $uploaded_file . &#x27;" -vcodec h264 -acodec libfdk_aac "./converted/&#x27; . $video_mp4 . &#x27;" -y 1>convert.txt 2>&amp;1&#x27;, $output, $convert_status[&#x27;mp4&#x27;]);&#xA;&#xA;    // Debug&#xA;    // echo &#x27;<pre>&#x27; . print_r($output, 1) . &#x27; </pre>&#x27;;&#xA;&#xA;   &#xA;&#xA;    // Debug&#xA;    // echo &#x27;<pre>&#x27; . print_r($output, 1) . &#x27; </pre>&#x27;;&#xA;  }&#xA;}&#xA;?>&#xA;

    &#xA;

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

    &#xA;

  • Remuxing mp4 on the fly with FFmpeg API

    25 octobre 2015, par Vadym

    My 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..»Œmdat

    This 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                                             mdat

    It 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 :

    1. 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( &amp;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.

    1. 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 virtualsets

    Hello I have problems to change timecode insdie metadata of a video file "mov"

    &#xA;

    ruta=r"E:\Brutos-sin-eliminar\inma-ruben-22-2-2020\multicam\\"&#xA;nombre=r"A019_02230134_C186.mov"&#xA;comand="ffmpeg -i " &#x2B; nombre &#x2B; " -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"&#x2B; " convert_" &#x2B; nombre&#xA;&#xA;os.popen(comand)&#xA;

    &#xA;

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

    &#xA;

    The console give me

    &#xA;

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

    &#xA;

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

    &#xA;

    Reggards

    &#xA;