Recherche avancée

Médias (91)

Autres articles (110)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Mise à jour de la version 0.1 vers 0.2

    24 juin 2013, par

    Explications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
    Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...)

Sur d’autres sites (16362)

  • ffmpeg - How to (programmatically) copy a stream's side data ?

    25 mars 2021, par waldenCalms

    My app is a tag editor (eg ID3) written in Swift for macOS. I'm using ffmpeg as my library to perform the tag editing. When the user is done editing, the app should save the changes to (essentially) a modified copy of the original file. I'm able to copy everything I need (from input -> output file) EXCEPT "side data".

    


    In other words, I'm doing the programmatic equivalent of :

    


    ffmpeg -i input.mp3 -metadata key1=value1 -metadata key2=value2 -codec copy output.mp3


    


    So, output.mp3 must be identical to input.mp3, except for the few metadata changes made by the user.

    


    What I have working so far

    


    I'm able to copy the audio stream and all associated metadata (tags), as is, from input.mp3 to output.mp3.

    


    The problem

    


    My input.mp3 happens to have some side data (see below), which does not get copied over to output.mp3. How to copy side data ? To be honest, I don't even know what side data is, and the documentation is not very helpful.

    


    ffprobe gives the following output (snippet) for the input.mp3's side data that looks like :

    


    Side data:
      replaygain: track gain - -9.200000, track peak - unknown, album gain - unknown, album peak - unknown,


    


    I want THIS ^ to get copied over to output.mp3, but it does not :(

    


    Relevant code snippet (format context initialization code omitted for conciseness)

    


    let inAudioStream = inFormatContext!.pointee.streams.advanced(by: Int(audio_stream_index)).pointee!.pointee&#xA;var outAudioStream = outFormatContext!.pointee.streams.advanced(by: Int(audio_stream_index)).pointee!.pointee&#xA;            &#xA;/* Free existing side data*/&#xA;            &#xA;for i in 0..* Copy side data if present */&#xA;            &#xA;if let srcSideData = inAudioStream.side_data {&#xA;                &#xA;    let rawPtr: UnsafeMutableRawPointer? = av_mallocz_array(Int(inAudioStream.nb_side_data),&#xA;                                                            MemoryLayout<avpacketsidedata>.size)&#xA;                &#xA;    outAudioStream.side_data = UnsafeMutablePointer<avpacketsidedata>(OpaquePointer(rawPtr))&#xA;    outAudioStream.nb_side_data = inAudioStream.nb_side_data&#xA;                &#xA;    for i in 0..(OpaquePointer(data))&#xA;    }&#xA;}&#xA;            &#xA;status = avformat_write_header(outFormatContext, nil)&#xA;</avpacketsidedata></avpacketsidedata>

    &#xA;

    I got this logic from this page. Is this ^ the right way to copy a stream's side data to the corresponding stream in the output file ? If not, how to do it ?

    &#xA;

    I have also tried the following functions with no luck :

    &#xA;

    av_stream_new_side_data(...)&#xA;av_stream_add_side_data(...)&#xA;

    &#xA;

    Please ask for details if required, and I will provide them. Thanks very much !

    &#xA;

  • ffmpeg - pts drift after seek with codec copy

    24 mars 2021, par Andrey Rikunov

    There are two ffmpeg commands. First one is used to seek and copy video chunk. Second one is used to transcode video chunk applying select filter for exact frames match.

    &#xA;

    Here is how :

    &#xA;

      &#xA;
    1. ffmpeg -ss  -to  -copyts -i <input /> -map 0:v:0 -c copy chunk.mp4
    2. &#xA;

    3. ffmpeg -copyts -i chunk.mp4 -vf &#x27;select=between(pts\,\,)&#x27; transcoded_cunk.mp4
    4. &#xA;

    &#xA;

    It works fine most of the times. But for some inputs there is a little pts drift in downloaded chunk so missing frames is possible. In other words pts of the same packets (compared by hash) are shifted by several points (in my case 0,0002 sec) between input and chunked output.

    &#xA;

    What is the possible reason for such pts drift ?

    &#xA;

    UPDATE 1 : That's because ffmpeg set timescale=1000 in mvhd atom so edit list media time to start from looses precision. Is it possible to force mvhd timescale ?

    &#xA;

    UPDATE 2 : It's not possible to change mvhd timescale because ffmpeg uses constant (MOV_TIMESCALE 1000) :

    &#xA;

    https://github.com/FFmpeg/FFmpeg/blob/82bd02a2c73bb5e6b7cf5e5eba486e279f1a7358/libavformat/movenc.c#L3498

    &#xA;

    UPDATE 3 : same issue discussed earlier

    &#xA;

  • ffmpeg audio/video sync problems when uploading to WhatsApp

    11 janvier 2021, par Luke Collins

    (Note : I have looked at related questions such as this one, but the solutions there didn't work for me since presumably their output files wouldn't play correctly in mpv, whereas mine do.)

    &#xA;

    I want to send a scene from a film to my friend on WhatsApp. I run

    &#xA;

    &#xA;

    ffmpeg -i film.mp4 -ss 00:25:30 -t 00:03:00 -c: copy out.mp4

    &#xA;

    &#xA;

    to extract the clip, which produces the file out.mp4 which plays fine when I play it with mpv.

    &#xA;

    If instead, I play the file in my browser (firefox), the first frame is static for a couple of seconds while audio plays, until the video starts and the video and audio are both in sync. (In other words, it seems the file has additional unnecessary audio information appended to the beginning of the file, which starts before my desired clip when played in firefox).

    &#xA;

    Diagrammatically, I suspect the video contains the following information :

    &#xA;

    enter image description here

    &#xA;

    and firefox plays it in this way :

    &#xA;

    enter image description here

    &#xA;

    What's worse is that when I upload it to WhatsApp, it misaligns the audio with the video, instead playing it this way :

    &#xA;

    enter image description here

    &#xA;

    How can I fix this so that the video has no additional video/audio information ?

    &#xA;

    I appreciate any help with this.

    &#xA;