Recherche avancée

Médias (0)

Mot : - Tags -/serveur

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

Autres articles (50)

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

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (6129)

  • How can I stream very long H.264 videos over HTTP without long startup times ? (or : MOOV atom too large)

    5 octobre 2012, par michael

    I want to stream videos of public meetings that are often 10 hours long. Users will generally be starting at some point in the middle of the video and jumping around frequently.

    H.264 in an MP4 container seems like the current best option for encoding streaming video (right ?). But these are large files — about 1.3GB for one file — and the metadata (MOOV atom) at the beginning of the file is itself about 40MB. If I understand correctly, clients need to download the full metadata before they're able to seek within the remainder of the file. Obviously, having to download 40MB before you can start streaming is unacceptable.

    (My tests of streaming have been with VLC and the HTML5 tag in Chrome.)

    I'm encoding the file using avconv, and am currently providing no additional settings beyond telling it which encoders to use (x264 and libfaac). I then move the metadata to the beginning of the file using qt-faststart.

    Is there a way to make the MOOV atom smaller ?

    If not, are there other strategies to use (e.g. is splitting long videos into several files something that's frequently done ? it seems like a real pain in terms of users seeking around the whole day's video) ?

    Or should I be using a different codec or container ?

    thanks !

    Here's a breakdown of the file header structure, from AtomicParsley :

    Atom ftyp @ 0 of size: 32, ends @ 32
    Atom moov @ 32 of size: 40157673, ends @ 40157705
        Atom mvhd @ 40 of size: 108, ends @ 148
        Atom iods @ 148 of size: 24, ends @ 172
        Atom trak @ 172 of size: 20156304, ends @ 20156476
            Atom tkhd @ 180 of size: 92, ends @ 272
            Atom edts @ 272 of size: 36, ends @ 308
                Atom elst @ 280 of size: 28, ends @ 308
            Atom mdia @ 308 of size: 20156168, ends @ 20156476
                Atom mdhd @ 316 of size: 32, ends @ 348
                Atom hdlr @ 348 of size: 45, ends @ 393
                Atom minf @ 393 of size: 20156083, ends @ 20156476
                    Atom vmhd @ 401 of size: 20, ends @ 421
                    Atom dinf @ 421 of size: 36, ends @ 457
                        Atom dref @ 429 of size: 28, ends @ 457
                    Atom stbl @ 457 of size: 20156019, ends @ 20156476
                        Atom stsd @ 465 of size: 147, ends @ 612
                            Atom avc1 @ 481 of size: 131, ends @ 612
                                Atom avcC @ 567 of size: 45, ends @ 612
                        Atom stts @ 612 of size: 6115608, ends @ 6116220
                        Atom stss @ 6116220 of size: 16960, ends @ 6133180
                        Atom ctts @ 6133180 of size: 5683824, ends @ 11817004
                        Atom stsc @ 11817004 of size: 28, ends @ 11817032
                        Atom stsz @ 11817032 of size: 4169724, ends @ 15986756
                        Atom stco @ 15986756 of size: 4169720, ends @ 20156476
        Atom trak @ 20156476 of size: 20001133, ends @ 40157609
            Atom tkhd @ 20156484 of size: 92, ends @ 20156576
            Atom mdia @ 20156576 of size: 20001033, ends @ 40157609
                Atom mdhd @ 20156584 of size: 32, ends @ 20156616
                Atom hdlr @ 20156616 of size: 45, ends @ 20156661
                Atom minf @ 20156661 of size: 20000948, ends @ 40157609
                    Atom smhd @ 20156669 of size: 16, ends @ 20156685
                    Atom dinf @ 20156685 of size: 36, ends @ 20156721
                        Atom dref @ 20156693 of size: 28, ends @ 20156721
                    Atom stbl @ 20156721 of size: 20000888, ends @ 40157609
                        Atom stsd @ 20156729 of size: 96, ends @ 20156825
                            Atom mp4a @ 20156745 of size: 80, ends @ 20156825
                                Atom esds @ 20156781 of size: 44, ends @ 20156825
                        Atom stts @ 20156825 of size: 9348168, ends @ 29504993
                        Atom stsc @ 29504993 of size: 28, ends @ 29505021
                        Atom stsz @ 29505021 of size: 5326296, ends @ 34831317
                        Atom stco @ 34831317 of size: 5326292, ends @ 40157609
        Atom udta @ 40157609 of size: 96, ends @ 40157705
            Atom meta @ 40157617 of size: 88, ends @ 40157705
                Atom hdlr @ 40157629 of size: 33, ends @ 40157662
                Atom ilst @ 40157662 of size: 43, ends @ 40157705
                    Atom ©too @ 40157670 of size: 35, ends @ 40157705
                        Atom data @ 40157678 of size: 27, ends @ 40157705
    Atom free @ 40157705 of size: 8, ends @ 40157713
    Atom mdat @ 40157713 of size: 1320096566, ends @ 1360254279
  • The New Samples Regime

    1er décembre 2011, par Multimedia Mike — General

    A little while ago, I got a big head over the fact that I owned and controlled the feared and revered MPlayer samples archive. This is the repository that retains more than a decade of multimedia samples.

    Conflict
    Where once there was one multimedia project (FFmpeg), there are now 2 (also Libav). There were various political and technical snafus regarding the previous infrastructure. I volunteered to take over hosting the vast samples archive (53 GB at the time) at samples.mplayerhq.hu (s.mphq for this post).

    However, a brand new server is online at samples.libav.org (s.libav for this post).

    Policies
    The server at s.libav will be the authoritative samples repository going forward. Why does s.libav receive the honor ? Mostly by virtue of having more advanced features. My simple (yet bandwidth-rich) web hosting plan does not provide for rsync or anonymous FTP services, both of which have traditionally been essential for the samples server. In the course of hosting s.mphq for the past few months, a few more discrepancies have come to light– apparently, the symlinks weren’t properly replicated. And perhaps most unusual is that if a directory contains a README file, it won’t be displayed in the directory listing (which frustrated me greatly when I couldn’t find this README file that I carefully and lovingly crafted years ago).

    The s.mphq archive will continue to exist — nay, must exist — going forward since there are years’ worth of web links pointing into it. I’ll likely set up a mirroring script that periodically (daily) rsyncs from s.libav to my local machine and then uses lftp (the best facility I have available) to mirror the files up to s.mphq.

    Also, since we’re starting fresh with a new upload directory, I think we need to be far more ruthless about policing its content. This means making sure that anything that is uploaded has an accompanying file which explains why it’s there and ideally links the sample to a bug report somewhere. No explanation = sample terminated.

    RSS
    I think it would be nifty to have an RSS feed that shows the latest samples to appear in the repository. I figure that I can use the Unix ‘find’ command on my local repository in concert with something like PyRSS2Gen to accomplish this goal.

    Monetization
    In the few months that I have been managing the repository, I have had numerous requests for permission to leech the entire collection in one recursive web-suck. These requests often from commercial organizations who wish to test their multimedia product on a large corpus of diverse samples. Personally, I believe the archive makes a rather poor corpus for such an endeavor, but so be it. Go ahead ; hosting this archive barely makes a dent in my fairly low-end web hosting plan. However, at least one person indicated that it might be easier to mail a hard drive to me, have me copy it, and send it back.

    This got me thinking about monetization opportunities. Perhaps, I should provide a service to send HDs filled with samples for the cost of the HD, shipping, and a small donation to the multimedia projects. I immediately realized that that is precisely the point at which the vast multimedia samples archive — with all of its media of questionable fair use status — would officially run afoul of copyright laws.

    Which brings me to…

    Clean Up
    I think we need to clean up some samples, starting with the ones that were marked not-readable in the old repository. Apparently, some ‘samples’ were, e.g., full anime videos and were responsible for a large bandwidth burden when linked from various sources.

    We multimedia nerds are a hoarding lot, never willing to throw anything away. This will probably the most challenging proposal to implement.

  • Assigning of dts values to encoded packets

    24 mars, par Alex

    I have a dump of H264-encoded data, which I need to put in mp4 container. I verified the validity of the encoded data by using mp4box utility against it. The mp4 file created by mp4box contained a proper 17 seconds long video. It is interesting that if I try ffmpeg to achieve the same, the resulting video is 34 seconds long and rather crappy (probably ffmpeg tries to decode video and then encode it, which results in the loss of video quality ?) Anyway, for my project I can't use command line approach and need to come up wit a programmatic way to embed the data in the mp4 container.

    



    Below is the code I use (I removed error checking for brevity. During execution all the calls succeed) :

    



    AVFormatContext* pInputFormatContext = avformat_alloc_context();
avformat_open_input(&pInputFormatContext, "Data.264", NULL, NULL);
avformat_find_stream_info(pInputFormatContext, NULL);
AVRational* pTime_base = &pInputFormatContext->streams[0]->time_base;

int nFrameRate = pInputFormatContext->streams[0]->r_frame_rate.num / pFormatCtx->streams[0]->r_frame_rate.den;
int nWidth = pInputFormatContext->streams[0]->codecpar->width;
int nHeight = pInputFormatContext->streams[0]->codecpar->height;
// nWidth = 1920, nHeight = 1080, nFrameRate = 25

// Create output objects
AVFormatContext* pOutputFormatContext = NULL;
avformat_alloc_output_context2(&pOutputFormatContext, NULL, NULL, "Destination.mp4");

AVCodec* pVideoCodec = avcodec_find_encoder(pOutputFormatContext->oformat->video_codec/*AV_CODEC_ID_264*/);
AVStream* pOutputStream = avformat_new_stream(pOutputFormatContext, NULL);
pOutputStream->id = pOutputFormatContext->nb_streams - 1;
AVCodecContext* pCodecContext = avcodec_alloc_context3(pVideoCodec);

switch (pVideoCodec->type) {
case AVMEDIA_TYPE_VIDEO:
  pCodecContext->codec_id = codec_id;
  pCodecContext->bit_rate = 400000;
  /* Resolution must be a multiple of two. */
  pCodecContext->width = nFrameWidth;
  pCodecContext->height = nFrameHeight;
  /* timebase: This is the fundamental unit of time (in seconds) in terms
  * of which frame timestamps are represented. For fixed-fps content,
  * timebase should be 1/framerate and timestamp increments should be
  * identical to 1. */
  pOutputStream->time_base.num = 1;
  pOutputStream->time_base.den = nFrameRate;
  pCodecContext->time_base = pOutputStream->time_base;
  pCodecContext->gop_size = 12; /* emit one intra frame every twelve frames at most */
  pCodecContext->pix_fmt = STREAM_PIX_FMT;
  break;
default:
  break;
}

/* copy the stream parameters to the muxer */
avcodec_parameters_from_context(pOutputStream->codecpar, pCodecContext);

avio_open(&pOutputFormatContext->pb, "Destination.mp4", AVIO_FLAG_WRITE);

// Start writing
AVDictionary* pDict = NULL;
avformat_write_header(pOutputFormatContext, &pDict);

// Process packets
AVPacket packet;
int64_t nCurrentDts = 0;
int64_t nDuration = 0;
int nReadResult = 0;

while (nReadResult == 0)
{
  nReadResult = av_read_frame(m_pInputFormatContext, &packet);
// At this point, packet.dts == AV_NOPTS_VALUE. 
// The duration field of the packet contains valid data

  packet.flags |= AV_PKT_FLAG_KEY;
  nDuration = packet.duration;
  packet.dts = nCurrentDts;
  packet.dts = av_rescale_q(nCurrentDts, pOutputFormatContext->streams[0]->codec->time_base, pOutputFormatContext->streams[0]->time_base);
  av_interleaved_write_frame(pOutputFormatContext, &packet);
  nCurrentDts += nDuration;
  nDuration += packet.duration;
  av_free_packet(&packet);
}

av_write_trailer(pOutputFormatContext);


    



    The properties for the Destination.mp4 file I receive indicate it is about 1 hour long with frame rate 0. I am sure the culprit is in the way I calculate dts values for each packet and use av_rescale_q(), but I do not have sufficient understanding of the avformat library to figure out the proper way to do it. Any help will be appreciated !