Recherche avancée

Médias (0)

Mot : - Tags -/auteurs

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (100)

  • 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 (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (7805)

  • streaming H.264 over RTP with libavformat

    16 avril 2012, par Jacob Peddicord

    I've been trying over the past week to implement H.264 streaming over RTP, using x264 as an encoder and libavformat to pack and send the stream. Problem is, as far as I can tell it's not working correctly.

    Right now I'm just encoding random data (x264_picture_alloc) and extracting NAL frames from libx264. This is fairly simple :

    x264_picture_t pic_out;
    x264_nal_t* nals;
    int num_nals;
    int frame_size = x264_encoder_encode(this->encoder, &nals, &num_nals, this->pic_in, &pic_out);

    if (frame_size <= 0)
    {
       return frame_size;
    }

    // push NALs into the queue
    for (int i = 0; i < num_nals; i++)
    {
       // create a NAL storage unit
       NAL nal;
       nal.size = nals[i].i_payload;
       nal.payload = new uint8_t[nal.size];
       memcpy(nal.payload, nals[i].p_payload, nal.size);

       // push the storage into the NAL queue
       {
           // lock and push the NAL to the queue
           boost::mutex::scoped_lock lock(this->nal_lock);
           this->nal_queue.push(nal);
       }
    }

    nal_queue is used for safely passing frames over to a Streamer class which will then send the frames out. Right now it's not threaded, as I'm just testing to try to get this to work. Before encoding individual frames, I've made sure to initialize the encoder.

    But I don't believe x264 is the issue, as I can see frame data in the NALs it returns back.
    Streaming the data is accomplished with libavformat, which is first initialized in a Streamer class :

    Streamer::Streamer(Encoder* encoder, string rtp_address, int rtp_port, int width, int height, int fps, int bitrate)
    {
       this->encoder = encoder;

       // initalize the AV context
       this->ctx = avformat_alloc_context();
       if (!this->ctx)
       {
           throw runtime_error("Couldn't initalize AVFormat output context");
       }

       // get the output format
       this->fmt = av_guess_format("rtp", NULL, NULL);
       if (!this->fmt)
       {
           throw runtime_error("Unsuitable output format");
       }
       this->ctx->oformat = this->fmt;

       // try to open the RTP stream
       snprintf(this->ctx->filename, sizeof(this->ctx->filename), "rtp://%s:%d", rtp_address.c_str(), rtp_port);
       if (url_fopen(&(this->ctx->pb), this->ctx->filename, URL_WRONLY) < 0)
       {
           throw runtime_error("Couldn't open RTP output stream");
       }

       // add an H.264 stream
       this->stream = av_new_stream(this->ctx, 1);
       if (!this->stream)
       {
           throw runtime_error("Couldn't allocate H.264 stream");
       }

       // initalize codec
       AVCodecContext* c = this->stream->codec;
       c->codec_id = CODEC_ID_H264;
       c->codec_type = AVMEDIA_TYPE_VIDEO;
       c->bit_rate = bitrate;
       c->width = width;
       c->height = height;
       c->time_base.den = fps;
       c->time_base.num = 1;

       // write the header
       av_write_header(this->ctx);
    }

    This is where things seem to go wrong. av_write_header above seems to do absolutely nothing ; I've used wireshark to verify this. For reference, I use Streamer streamer(&enc, "10.89.6.3", 49990, 800, 600, 30, 40000); to initialize the Streamer instance, with enc being a reference to an Encoder object used to handle x264 previously.

    Now when I want to stream out a NAL, I use this :

    // grab a NAL
    NAL nal = this->encoder->nal_pop();
    cout << "NAL popped with size " << nal.size << endl;

    // initalize a packet
    AVPacket p;
    av_init_packet(&p);
    p.data = nal.payload;
    p.size = nal.size;
    p.stream_index = this->stream->index;

    // send it out
    av_write_frame(this->ctx, &p);

    At this point, I can see RTP data appearing over the network, and it looks like the frames I've been sending, even including a little copyright blob from x264. But, no player I've used has been able to make any sense of the data. VLC quits wanting an SDP description, which apparently isn't required.

    I then tried to play it through gst-launch :

    gst-launch udpsrc port=49990 ! rtph264depay ! decodebin ! xvimagesink

    This will sit waiting for UDP data, but when it is received, I get :

    ERROR : element /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0 : No RTP
    format was negotiated. Additional debug info :
    gstbasertpdepayload.c(372) : gst_base_rtp_depayload_chain () :
    /GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0 : Input buffers
    need to have RTP caps set on them. This is usually achieved by setting
    the 'caps' property of the upstream source element (often udpsrc or
    appsrc), or by putting a capsfilter element before the depayloader and
    setting the 'caps' property on that. Also see
    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/gst/rtp/README

    As I'm not using GStreamer to stream itself, I'm not quite sure what it means with RTP caps. But, it makes me wonder if I'm not sending enough information over RTP to describe the stream. I'm pretty new to video and I feel like there's some key thing I'm missing here. Any hints ?

  • Creating atom into a video file [closed]

    12 mars 2013, par Popa Ovidiu-Razvan

    I need to play video on a web site.
    I use FFMPEG into a program to convert any file that I receive into a mp4 file. (so all my files to be mp4).
    so far so good.
    I also use qr-faststart to move the atom to the begin of the file.
    also this working.

    but the problem is that I receive files with no atom.. :(
    the error is like this
    "encountered non-QT top-level atom (is this a QuickTime file ?)"
    "last atom in the file vas not a moov atom"

    so ... how can I fix this...
    How can I create an atom ... or any solution ?
    Razvan

  • No audio encoded with ffmpeg using webm/libvorbis

    15 mars 2013, par Craig Lillard

    Having issues getting audio to encode to webm. Tried many different methods and it just ain't happenin. The commands are printed below before each pass.

    I have tried moving the audio commands around, trying different bitrates, different audio commands and have tried it on a couple of different files as well that both have audio.

    Encoding these files to MP4 using x264 causes no problems and works just fine and the audio plays, so it appears to be an issue just with webm. As you can see below, it is a 2-pass encode.

    Thanks for any help you can provide !

    Craig

    Webm LG PASS 1...........................




       webm_pass1: /usr/bin/ffmpeg -i /home/thedirectory/video613268.mov  -codec:v libvpx -quality good -vf 'scale=640:360 [scaled];movie=/home/thedirectory/watermarks/w640X360.png [logo];[scaled][logo] overlay' -cpu-used 0 -b:v 500k -aspect 16:9 -qmin 10 -qmax 42 -maxrate:v 500k -bufsize:v 1000k -r:v 25/1 -force_fps -threads 0 -an -acodec libvorbis -ac 2 -ab 96k -ar 44100 -pass 1 -f webm -y /dev/null



       ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers
         built on Mar 11 2013 14:48:26 with gcc 4.6.2 20111027 (Red Hat 4.6.2-2)
         configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab --enable-libvorbis --enable-libvpx
         libavutil      51. 35.100 / 51. 35.100
         libavcodec     53. 61.100 / 53. 61.100
         libavformat    53. 32.100 / 53. 32.100
         libavdevice    53.  4.100 / 53.  4.100
         libavfilter     2. 61.100 /  2. 61.100
         libswscale      2.  1.100 /  2.  1.100
         libswresample   0.  6.100 /  0.  6.100
         libpostproc    52.  0.100 / 52.  0.100
       Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/thedirectory/video613268.mov':
         Metadata:
           major_brand     : qt  
           minor_version   : 537199360
           compatible_brands: qt  
           creation_time   : 2013-02-23 20:04:32
         Duration: 00:00:21.02, start: 0.000000, bitrate: 114326 kb/s
           Stream #0:0(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj422p, 1920x1080 [SAR 72:72 DAR 16:9], 112786 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc
           Metadata:
             creation_time   : 2013-02-23 20:04:32
             handler_name    : ?Gestionnaire d?alias Apple
           Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s
           Metadata:
             creation_time   : 2013-02-23 20:04:32
             handler_name    : ?Gestionnaire d?alias Apple
       Incompatible pixel format 'yuvj422p' for codec 'libvpx', auto-selecting format 'yuv420p'
       [buffer @ 0x1f675a0] w:1920 h:1080 pixfmt:yuvj422p tb:1/1000000 sar:1/1 sws_param:
       [movie @ 0x1f799c0] seek_point:0 format_name:(null) file_name:/home/thedirectory/watermarks/w640X360.png stream_index:0
       [overlay @ 0x1f7c2c0] auto-inserting filter 'auto-inserted scale 0' between the filter 'Parsed_movie_1' and the filter 'Parsed_overlay_2'
       [scale @ 0x1f78d40] w:1920 h:1080 fmt:yuvj422p -> w:640 h:360 fmt:yuv420p flags:0x4
       [scale @ 0x1f7cde0] w:640 h:360 fmt:rgba -> w:640 h:360 fmt:yuva420p flags:0x4
       [overlay @ 0x1f7c2c0] main w:640 h:360 fmt:yuv420p overlay x:0 y:0 w:640 h:360 fmt:yuva420p
       [overlay @ 0x1f7c2c0] main_tb:1/1000000 overlay_tb:1/25 -> tb:1/1000000 exact:1
       [libvpx @ 0x1f77ce0] v1.0.0
       Output #0, webm, to '/dev/null':
         Metadata:
           major_brand     : qt  
           minor_version   : 537199360
           compatible_brands: qt  
           creation_time   : 2013-02-23 20:04:32
           encoder         : Lavf53.32.100
           Stream #0:0(eng): Video: vp8, yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=10-42, pass 1, 500 kb/s, 1k tbn, 25 tbc
           Metadata:
             creation_time   : 2013-02-23 20:04:32
             handler_name    : ?Gestionnaire d?alias Apple
       Stream mapping:
         Stream #0:0 -> #0:0 (mjpeg -> libvpx)
       Press [q] to stop, [?] for help
       frame=  527 fps= 21 q=0.0 Lsize=       0kB time=00:00:00.00 bitrate=   0.0kbits/s dup=0 drop=103    
       video:0kB audio:0kB global headers:0kB muxing overhead -nan%
       Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)
       Webm LG PASS 2.......................




       webm_pass2: /usr/bin/ffmpeg -i /home/thedirectory/video613268.mov -codec:v libvpx -quality good -vf 'scale=640:360 [scaled];movie=/home/thedirectory/watermarks/w640X360.png [logo];[scaled][logo] overlay' -cpu-used 0 -b:v 500k  -aspect 16:9  -qmin 10 -qmax 42 -maxrate:v 500k -bufsize:v 1000k -r:v 24/1 -force_fps -threads 0 -an -acodec libvorbis -ac 2 -ab 96k -ar 44100 -pass 2 -f webm -y /media/amazons3/webmlg/video613268.mov.webm



       ffmpeg version 0.10.2 Copyright (c) 2000-2012 the FFmpeg developers
         built on Mar 11 2013 14:48:26 with gcc 4.6.2 20111027 (Red Hat 4.6.2-2)
         configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include --disable-avisynth --extra-cflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --enable-avfilter --enable-libfaac --enable-libgsm --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-gpl --enable-nonfree --enable-postproc --enable-pthreads --enable-shared --enable-swscale --enable-vdpau --enable-version3 --enable-x11grab --enable-libvorbis --enable-libvpx
         libavutil      51. 35.100 / 51. 35.100
         libavcodec     53. 61.100 / 53. 61.100
         libavformat    53. 32.100 / 53. 32.100
         libavdevice    53.  4.100 / 53.  4.100
         libavfilter     2. 61.100 /  2. 61.100
         libswscale      2.  1.100 /  2.  1.100
         libswresample   0.  6.100 /  0.  6.100
         libpostproc    52.  0.100 / 52.  0.100
       Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/thedirectory/video613268.mov':
         Metadata:
           major_brand     : qt  
           minor_version   : 537199360
           compatible_brands: qt  
           creation_time   : 2013-02-23 20:04:32
         Duration: 00:00:21.02, start: 0.000000, bitrate: 114326 kb/s
           Stream #0:0(eng): Video: mjpeg (jpeg / 0x6765706A), yuvj422p, 1920x1080 [SAR 72:72 DAR 16:9], 112786 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 2997 tbc
           Metadata:
             creation_time   : 2013-02-23 20:04:32
             handler_name    : ?Gestionnaire d?alias Apple
           Stream #0:1(eng): Audio: pcm_s16be (twos / 0x736F7774), 48000 Hz, 2 channels, s16, 1536 kb/s
           Metadata:
             creation_time   : 2013-02-23 20:04:32
             handler_name    : ?Gestionnaire d?alias Apple
       Incompatible pixel format 'yuvj422p' for codec 'libvpx', auto-selecting format 'yuv420p'
       [buffer @ 0x1f2a5a0] w:1920 h:1080 pixfmt:yuvj422p tb:1/1000000 sar:1/1 sws_param:
       [movie @ 0x1f3bec0] seek_point:0 format_name:(null) file_name:/home/thedirectory/watermarks/w640X360.png stream_index:0
       [overlay @ 0x1f3f2c0] auto-inserting filter 'auto-inserted scale 0' between the filter 'Parsed_movie_1' and the filter 'Parsed_overlay_2'
       [scale @ 0x1f3c8a0] w:1920 h:1080 fmt:yuvj422p -> w:640 h:360 fmt:yuv420p flags:0x4
       [scale @ 0x1f3fde0] w:640 h:360 fmt:rgba -> w:640 h:360 fmt:yuva420p flags:0x4
       [overlay @ 0x1f3f2c0] main w:640 h:360 fmt:yuv420p overlay x:0 y:0 w:640 h:360 fmt:yuva420p
       [overlay @ 0x1f3f2c0] main_tb:1/1000000 overlay_tb:1/25 -> tb:1/1000000 exact:1
       [libvpx @ 0x1f3ace0] v1.0.0
       Output #0, webm, to '/media/amazons3/webmlg/video613268.mov.webm':
         Metadata:
           major_brand     : qt  
           minor_version   : 537199360
           compatible_brands: qt  
           creation_time   : 2013-02-23 20:04:32
           encoder         : Lavf53.32.100
           Stream #0:0(eng): Video: vp8, yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=10-42, pass 2, 500 kb/s, 1k tbn, 24 tbc
           Metadata:
             creation_time   : 2013-02-23 20:04:32
             handler_name    : ?Gestionnaire d?alias Apple
       Stream mapping:
         Stream #0:0 -> #0:0 (mjpeg -> libvpx)
       Press [q] to stop, [?] for help
       frame=  506 fps=  7 q=0.0 Lsize=    1610kB time=00:00:21.08 bitrate= 625.8kbits/s dup=0 drop=124    
       video:1389kB audio:0kB global headers:0kB muxing overhead 15.952140%