Recherche avancée

Médias (2)

Mot : - Tags -/rotation

Autres articles (51)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • Librairies et binaires spécifiques au traitement vidéo et sonore

    31 janvier 2010, par

    Les logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
    Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
    Binaires complémentaires et facultatifs flvtool2 : (...)

Sur d’autres sites (6388)

  • ffmpeg skips frames/packets while playing a file over http

    24 janvier 2020, par coban
    Microsoft Windows [Version 10.0.18362.592]  
    libavutil      56. 31.100 / 56. 31.100
    libavcodec     58. 54.100 / 58. 54.100
    libavformat    58. 29.100 / 58. 29.100
    libavdevice    58.  8.100 / 58.  8.100
    libavfilter     7. 57.100 /  7. 57.100
    libswscale      5.  5.100 /  5.  5.100
    libswresample   3.  5.100 /  3.  5.100
    libpostproc    55.  5.100 / 55.  5.100
    [hls @ 0600cac0] Skip ('#EXT-X-VERSION:3')    0KB sq=    0B f=0/0
    [hls @ 0600cac0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/chunklist_w1481451763.m3u8' for reading
    [hls @ 0600cac0] Skip ('#EXT-X-VERSION:3')    0KB sq=    0B f=0/0
    [hls @ 0600cac0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_0.ts' for reading
    [hls @ 0600cac0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_1.ts' for reading
    Input #0, hls, from 'http://ok2.se:8000/movie/xxxxxxxxxx/67933.m3u8':
    Duration: 02:02:22.46, start: 0.000000, bitrate: N/A
    Program 0
    Metadata: 0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0
     variant_bitrate : 2788912
    Stream #0:0: Data: timed_id3 (ID3  / 0x20334449)
    Metadata:
     variant_bitrate : 2788912
    Stream #0:1: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 720x304 [SAR 1:1 DAR 45:19], 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc
    Metadata:
     variant_bitrate : 2788912
    Stream #0:2: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
    Metadata:
     variant_bitrate : 2788912
    [http @ 060662c0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_2.ts' for reading
    [hls @ 0600cac0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_2.ts' for reading
    [http @ 0606fb40] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_3.ts' for reading
    [hls @ 0600cac0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_3.ts' for reading
    [http @ 0c2442c0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_4.ts' for reading
    [http @ 0606f8c0] Opening 'http://198.144.145.236:1935/ondemand-1/_definst_/mp4:path2/FRENCH.MOVIES/2017.JOHN.WICK.CHAPTER.2.FRN.mp4/media_w1481451763_5.ts' for reading

    I am trying to create an A/V player using ffmpeg library and Delphi. After puzzling and puzzling I found out how to read/decode/sync/display etc...

    I think this behaviour is in some specific situations, because I tested live streams and noticed no problems. In this case this is a video file, while playing my app and ffplay.exe (from ffmpeg not compiled by myself) behaving the same, and skipping packets "every time when the app has to wait while packetqueue is full ?" and loses about 10-30 seconds of audio and video.

    VLC doesn’t seem to have such a like behaviour, while as I understand from VLC credits, they are using ffmpeg or ffmpeg methods imported for decoding/encoding. inspecting vlc source doesn’t make much sense for me because I am a (noob) Delphi programmer. It’s like my main language is Dutch and try to translate form French to German language.

    Please any suggestions how to avoid this, because I think it has to do something with delivery of data from the server and/or read buffer of ffmpeg. If I increase the max size of packetqueue the skipping does happen later and if decrease the size, the skipping happens sooner.

    Including code from my app is not necessary because ffplay.exe has exact the same behavior. You can see debug from ffplay.exe.

  • How to create AVStream with AV_DISPOSITION_TIMED_THUMBNAILS flag

    11 mars 2020, par VGSPB

    I’m try to make audiobook using ffmpeg. m4b format support covers picture for each chapter. ffmpeg load it as well, but I’cant create AVStream with AV_DISPOSITION_TIMED_THUMBNAILS disposition flag.

    int addVideoStream( AVFormatContext *ctx, CoverData *cover) {
       const AVCodec *c = avcodec_find_encoder( AV_CODEC_ID_MJPEG );
       if ( !c )
           return -1;

       int stream_indx = ctx->nb_streams;

       AVStream *stream = avformat_new_stream( ctx, NULL );
       AVCodecContext *img_codec_ctx = avcodec_alloc_context3( c );

       img_codec_ctx->width = cover->width();
       img_codec_ctx->height = cover->height();
       img_codec_ctx->pix_fmt = AV_PIX_FMT_YUVJ420P;

       if ( ctx->oformat->flags & AVFMT_GLOBALHEADER )
           img_codec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

       int res = avcodec_parameters_from_context( stream->codecpar, img_codec_ctx );
       avcodec_free_context( &img_codec_ctx );


       return stream_indx;
    }

    int new_v_stream_index = addVideoStream( out_ctx, img_data );
    AVStream *v_stream = out_ctx->streams[ new_v_stream_index ];
    v_stream->disposition = AV_DISPOSITION_DEFAULT|AV_DISPOSITION_ATTACHED_PIC|AV_DISPOSITION_TIMED_THUMBNAILS;
    int error = avformat_write_header( out_ctx, NULL );

    return error = -22

    if set disposition only

    v_stream->disposition = AV_DISPOSITION_ATTACHED_PIC;

    error = 0, but it is only for one attached picture packet : stream->attached_pic

    where am i wrong ?

  • Metadata when Remuxing MP3 Audiobooks into Apple-friendly MP4 with FFmpeg

    23 août 2022, par Crissov

    Since there is apparently no way to tell iTunes or iOS that MP3s contain an audiobook (or radioplay) by ID3 tag or file extension, I would like to remux them into MPEG-4 Part 14 containers with an .m4b file extension (without converting, i.e. transcoding or reencoding, the audio stream to AAC) and set the proper media type tag (stik = 2 Audiobook).

    



    $ ffmpeg -hide_banner -y \
         -i "infile.mp3" -codec copy -map 0 \
         "outfile.m4b"


    



    When auto-detecting the intended format from the output filename, FFmpeg (version 4.2.1 at the time of writing) toggles its -f ipod compatibility mode for .m4a and .m4b, which means it will apparently not accept MPEG 1/2 Layer 3 audio within an MP4 container :

    



    


    [ipod @ 00000223bd927e40]
    
 Could not find tag for codec mp3 in stream #0, codec not currently supported in container
    
 Could not write header for output file #0 (incorrect codec parameters ?) : Invalid argument

    


    



    I can override that (or change the file extension afterwards when using "outfile.mp4") :

    



    $ ffmpeg -hide_banner -y \
         -i "infile.mp3" -codec copy -map 0 -f mp4 \
         "outfile.m4b"


    



    The near-zero time required for the conversion and FFprobe assure me that the remuxing was successful :

    



    

    Stream #0:0(und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)


    


    



    Custom ID3v2 tag fields and ones without a known MP4 cognate have been dropped, though. I would like to preserve them !

    



    How do I do that with -map_metadata, if it is possible at all ?

    



    How can I use -metadata to add the necessary tag field (atom : stik) which would mark the file as an audiobook 
– phrased more generally :
    
how do I add a manually specified metadata tag field (e.g. MP4 atom or box) with FFmpeg ?

    



    $ ffmpeg -hide_banner -y \
         -i "infile.mp3" -codec copy -map 0 -f mp4 \
         -metadata:s:a:0 language=deu \
         -metadata stik=2
         "outfile.m4b"


    



    FFmpeg documentation

    



    

      

    • -metadata[:metadata_specifier] key=value (output,per-metadata)
      
 Set a metadata key/value pair.
    • 


    • 


    • -map_metadata[:metadata_spec_out] infile[:metadata_spec_in] (output,per-metadata)
      
 Set metadata information of the next output file from infile. Note that those are file indices (zero-based), not filenames. Optional metadata_spec_in/out parameters specify, which metadata to copy. A metadata specifier can have the following forms :
 

        

      • g
        
 global metadata, i.e. metadata that applies to the whole file
      • 


      • s[:stream_spec]
        
 per-stream metadata. stream_spec is a stream specifier as described in the Stream specifiers chapter. In an input metadata specifier, the first matching stream is copied from. In an output metadata specifier, all matching streams are copied to.
      • 


      • c:chapter_index
        
 per-chapter metadata. chapter_index is the zero-based chapter index.
      • 


      • p:program_index
        
 per-program metadata. program_index is the zero-based program index.
      • 


    • 


    
 


    If metadata specifier is omitted, it defaults to global.

    
 


    By default, global metadata is copied from the first input file, per-stream and per-chapter metadata is copied along with streams/chapters. These default mappings are disabled by creating any mapping of the relevant type. A negative file index can be used to create a dummy mapping that just disables automatic copying.

    


    



    PS

    



      

    • Apple does not seem to formally document stik. MPMediaType is slightly different. Pointers to the contrary would be greatly appreciated.
    • 


    • Ideally, I would like to automatically add all *.mp3 files within a subdirectory sorted alphabetically (which share the same encoder settings) as chapters within a single .mp4 container, but that probably deserves a separate question.
    •