Recherche avancée

Médias (91)

Autres articles (62)

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Keeping control of your media in your hands

    13 avril 2011, par

    The vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
    While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
    MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
    MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (10143)

  • Probe function in ffmpeg

    14 octobre 2014, par eejs

    I am trying to write a demuxer for STL subtitle format(FFmpeg). I am having trouble understanding how the probe function is referenced in ffmpeg.
    I have the following code for my probe :

    #include "avformat.h"
    #include "internal.h"
    #include "subtitles.h"
    #include "libavutil/intreadwrite.h"

    typedef struct {
       FFDemuxSubtitlesQueue q;
    } STLContext;

    static int stl_probe(AVProbeData *p)
    {
       char c;
       const unsigned char *ptr = p->buf;
       av_log(0,100,"printing the probe function");
       while(*ptr=='\r' || *ptr=='\n' || *ptr=='$' || (ptr[0]=='/' && ptr[1]=='/'))
           ptr+=ff_subtitles_next_line(ptr);
       if (sscanf(ptr, "%*d:%*d:%*d:%*d , %*d:%*d:%*d:%*d , %c", &c) == 1)
           return AVPROBE_SCORE_MAX;
        return 0;

    }
    static int64_t get_pts(char **buf, int *duration)
    {
           int hh1, mm1, ss1, ms1;
           int hh2, mm2, ss2, ms2;
           int len=0;
           if (sscanf(*buf, "%2d:%2d:%2d:%2d , %2d:%2d:%2d:%2d , %n",
                      &hh1, &mm1, &ss1, &ms1,
                      &hh2, &mm2, &ss2, &ms2, &len) >= 8 && len>0) {
               int64_t start = (hh1*3600LL + mm1*60LL + ss1) * 100LL + ms1;
               int64_t end   = (hh2*3600LL + mm2*60LL + ss2) * 100LL + ms2;
               *duration = end - start;
               *buf+=len;
               return start;
            }
           return AV_NOPTS_VALUE;
    }

    static int stl_read_header(AVFormatContext *s)
    {
       STLContext *stl = s->priv_data;
       AVStream *st = avformat_new_stream(s, NULL);

       if (!st)
           return AVERROR(ENOMEM);
       avpriv_set_pts_info(st, 64, 1, 100);
       st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
       st->codec->codec_id   = AV_CODEC_ID_TEXT;

       while (!avio_feof(s->pb)) {
           char line[4096];
           char *p = line;
           const int64_t pos = avio_tell(s->pb);
           int len = ff_get_line(s->pb, line, sizeof(line));
           int64_t pts_start;
           int duration;
           if (!len)
               break;

           line[strcspn(line, "\r\n")] = 0;

           pts_start = get_pts(&p , &duration);
           if (pts_start != AV_NOPTS_VALUE) {
               AVPacket *sub;

               sub = ff_subtitles_queue_insert(&stl->q, p, strlen(p), 0);
               if (!sub)
                   return AVERROR(ENOMEM);
               sub->pos = pos;
               sub->pts = pts_start;
               sub->duration = duration;
           }
       }

       ff_subtitles_queue_finalize(&stl->q);
       return 0;

    }
    static int stl_read_packet(AVFormatContext *s, AVPacket *pkt)
    {
       STLContext *stl = s->priv_data;
       return ff_subtitles_queue_read_packet(&stl->q, pkt);
    }

    static int stl_read_seek(AVFormatContext *s, int stream_index,
                                int64_t min_ts, int64_t ts, int64_t max_ts, int flags)
    {
       STLContext *stl = s->priv_data;
       return ff_subtitles_queue_seek(&stl->q, s, stream_index,
                                      min_ts, ts, max_ts, flags);
    }

    static int stl_read_close(AVFormatContext *s)
    {
       STLContext *stl = s->priv_data;
       ff_subtitles_queue_clean(&stl->q);
       return 0;
    }

    AVInputFormat ff_stl_demuxer = {
       .name           = "stl",
       .long_name      = NULL_IF_CONFIG_SMALL("STL subtitles"),
       .priv_data_size = sizeof(STLContext),
       .read_probe     = stl_probe,
       .read_header    = stl_read_header,
       .read_packet    = stl_read_packet,
       .read_seek2     = stl_read_seek,
       .read_close     = stl_read_close,
       .extensions     = "stl",
    };

    Output of ./ffmpeg -f stl -i Test.stl Test.srt

    ffmpeg version N-66838-g9071bab Copyright (c) 2000-2014 the FFmpeg developers
     built on Oct 14 2014 12:28:54 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
     configuration:
     libavutil      54. 10.100 / 54. 10.100
     libavcodec     56.  4.101 / 56.  4.101
     libavformat    56.  9.100 / 56.  9.100
     libavdevice    56.  1.100 / 56.  1.100
     libavfilter     5.  1.105 /  5.  1.105
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
    Input #0, stl, from '/home/eejya/SubtitleTesting/UK_FINAL_240511.stl':
     Duration: N/A, bitrate: N/A
       Stream #0:0: Subtitle: text
    Output #0, srt, to '/home/eejya/SubtitleTesting/UkTest.srt':
     Metadata:
       encoder         : Lavf56.9.100
       Stream #0:0: Subtitle: subrip (srt)
       Metadata:
         encoder         : Lavc56.4.101 srt
    Stream mapping:
     Stream #0:0 -> #0:0 (text (native) -> subrip (srt))
    Press [q] to stop, [?] for help
    size=      10kB time=00:27:10.06 bitrate=   0.0kbits/s    
    video:0kB audio:0kB subtitle:4kB other streams:0kB global headers:0kB muxing overhead: 121.594238%

    when I run the command

    ./ffmpeg -i Test.stl Test.srt

    I don’t see any output printed by av_log and it says that the probe score is very less which may lead to mis-detection. That would mean only the extension is being checked.So, either my probe function is not being called or the buffer isn’t being read.
    How do I check whether my probe function is being called or not ?
    Also does the low score warning imply that the function is being called ?

  • Converting DAV to MP4 and OGG

    27 mars 2015, par mackowiakp

    I want to prepare WEB page containing films from security camera recorders. Each recorder transmit video files in DAV format so each film is converted to MP4 format by script, using such syntax :

    ffmpeg -y -i movie.dav -vcodec libx264 -crf 24 movie.mp4

    So I included in HTMLv5 code such entry :

    <video width="320" height="240">
     <source src="movie.mp4" type="video/mp4">
    </source></video>

    It works correctly with Chrome but not with Firefox. For proper work in FF it is necessary add link to OGG file. So correct HTMLv5 syntax for both browsers should look like this :

    <video width="320" height="240">
     <source src="movie.mp4" type="video/mp4">
     <source src="movie.ogg" type="video/ogg">
    </source></source></video>

    Can anybody help me to pass correct ffmpeg syntax to create OGG file ?

    Output from console after using -movflags +faststart options

    [maciek@piotr MMM]$ ../ffmpeg-2.4.2-64bit-static/ffmpeg -movflags +faststart -y -i   04.24.23-04.24.38\[M\]\[@0\]\[0\].dav -vcodec libx264 -crf 24 10.mp4
    ffmpeg version 2.4.2-   http://johnvansickle.com/ffmpeg/    Copyright (c) 2000-2014 the FFmpeg developers
     built on Oct  9 2014 07:24:56 with gcc 4.8 (Debian 4.8.3-11)
     configuration: --enable-gpl --enable-version3 --disable-shared --disable-debug --enable-runtime-cpudetect --enable-libmp3lame --enable-libx264 --enable-libx265 --enable- libwebp --enable-libspeex --enable-libvorbis --enable-libvpx --enable-libfreetype --enable-fontconfig --enable-libxvid --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-gray --enable-libopenjpeg --enable-libopus --disable-ffserver --enable-libass --enable-gnutls --cc=gcc-4.8
     libavutil      54.  7.100 / 54.  7.100
     libavcodec     56.  1.100 / 56.  1.100
     libavformat    56.  4.101 / 56.  4.101
     libavdevice    56.  0.100 / 56.  0.100
     libavfilter     5.  1.100 /  5.  1.100
     libswscale      3.  0.100 /  3.  0.100
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  0.100 / 53.  0.100
    Option movflags not found.
  • Ffmpeg, avconv and sameq

    25 avril 2015, par xiaose

    Earlier I wrote so :

    ffmpeg -i input.mp4 -sameq output.mp3

    ...and thus receive audio from video file. Ffmpeg just taken out or converted audio to mp3 with an appropriate quality. All thanks to key : -sameq [use same quantizer as source]

    Now in Ubuntu instead of ffmpeg we have libav and there (in man for avcomv) I see no -sameq key. Well, here is a question : what I have to do now ?..

    What I have to do now to get converted audio file with the same quality as in original ?

    PS. -sameq : Use same quantizer as source (implies VBR).

    $ man ffmpeg | col -b > ./man_ffmpeg

    this man_ffmpeg is there : http://pastebin.com/qYxz1M1E

    FFMPEG(1)
    NAME
      ffmpeg - ffmpeg video converter
    SYNOPSIS
      ffmpeg [[infile options][-i infile]]... {[outfile options] outfile}...
    ...
    ...
    ...
    -sameq
      Use same quantizer as source (implies VBR).
    ...
    ...
    ...
    SEE ALSO
      avplay(1), avprobe(1), avserver(1) and the Libav HTML documentation
    AUTHORS
      The Libav developers
    2014-02-06
    FFMPEG(1)