Recherche avancée

Médias (0)

Mot : - Tags -/navigation

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

Autres articles (51)

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

  • Revision 34657 : lister les plugins non utilises (le glob() est pourri, qui fait mieux)

    23 janvier 2010, par fil@… — Log

    lister les plugins non utilises (le glob() est pourri, qui fait mieux)

  • Death of A Micro Center

    21 septembre 2012, par Multimedia Mike — History

    The Micro Center computer store located in Santa Clara, CA, USA closed recently :



    I liked Micro Center. I have liked Micro Center ever since I first visited their Denver, CO location 10 years ago. I would sometimes drive an hour in each direction just to visit that shop. I was excited to see that they had a location in the Bay Area when I moved here a few years ago (despite the preponderance of Fry’s stores).

    Now this location is gone. I wonder how much of the “we couldn’t come to favorable terms on a lease” was true (vs. an excuse to close a retail store at a time when more business is moving online, particularly in the heart of Silicon Valley). But that’s not what I wanted to discuss. I came here to discuss…

    The Micro Center Window Logos

    The craziest part about shopping the Santa Clara Micro Center location was the logos they displayed on the window outside. Every time I saw it, it made me sentimental for a time when some of these logos were current, or when some of these companies were still in business. Some of the logos on their front window were for companies I’ve never heard of. It reminds me of the nearby 7-11 convenience stores when I was growing up– their walls were decorated with people sporting embarrassingly 1970s styles long after the 1970s had transpired.

    I thought I would record what those front window logos were and try to pinpoint when the store launched exactly (assuming the logos have been their since the initial opening and never changed).



    Click for larger image

    Here we have Lotus, Hewlett Packard/HP, Corel, Fuji, Power Macintosh, NEC, and Fujitsu. Lotus was purchased by IBM in 1995 and still seems to be maintained as a separate brand. The Power Macintosh was introduced as a brand in 1994. Corel’s logo has seen a few mutations over the years but I don’t know when this one fell out of favor.

    Fuji (vs. Fujitsu) appears to refer to Fujifilm, though this logo is also obsolete.



    Click for larger image

    Hayes– I specifically remember reading the Slashdot post accouncing that Hayes is dead (followed by many comments reminiscing about the Hayes command set). Here is the post, from early 1999.

    From Googling, it doesn’t appear IBM still has a presence in the consumer computing space (though they do have something pertaining to software for consumer products). Then there’s the good old rainbow Apple logo, something that went away in 1997. I suspect 1997 was also the last hurrah of the name ‘Macintosh’ (though I remember mistakenly referring to Apple computer products as Macintoshes well into the mid-2000s and inadvertently angering some Apple enthusiasts).



    Click for larger image

    As for the next segment, obviously, both Sony and Toshiba are still very much alive. Iomega was acquired by EMC in 2008 but is still maintained as a separate brand. USRobotics is still around and making — what else ? — 56K modems (and their current logo is slightly different than the one seen here).

    Targus seems to be a case maker (“Leading Provider of Cases, Bags and Accessories for Laptops and Tablets”). I wonder if that’s just their current business or if they had more areas long ago ? It seems strange that they would get brand billing like this.

    Finally, searching for information about Practical Peripherals only produces sites about how they’re long dead (like this history lesson). It’s unclear when they died.

    The interior of this store was also decorated with more technology company logos near the ceiling (I didn’t really register that fact until I had visited many times). Regrettably, I now won’t be able to see how up to date those logos were.

    Based on the data points above, it’s safe to conclude that the store opened between 1995 or 1996 (again, assuming the logos were placed at opening and never changed).

    Epilogue

    Here’s one more curious item still visible from the outside :



    “See the world’s fastest PC !” Featuring an Intel Core 2 Extreme ? That CPU dates back to 2007 and was succeeded by Nehalem in late 2008. So even that sign, which is presumably easier and cleaner to replace than the window logos, was absurdly out of date.

  • Ffmpeg set output format C++

    7 septembre 2022, par Turgut

    I made a program that encodes a video and I want to specify the format as h264 but I can't figure out how to do it. It automatically sets the format to mpeg4 and I can't change it. I got my code from ffmpegs official examples muxing.c and slightly edited it to fit my code (I haven't changed much especially did not touch the parts where it sets the format)

    


    Here is my code so for (I have trimmed down the code slightly, removing redundant parts)

    


    video_encoder.cpp :

    


    
video_encoder::video_encoder(int w, int h, float fps, unsigned int duration) 
 :width(w), height(h), STREAM_FRAME_RATE(fps), STREAM_DURATION(duration)
{
    std::string as_str = "./output/video.mp4";

    char* filename = const_cast(as_str.c_str());
    enc_inf.video_st, enc_inf.audio_st = (struct OutputStream) { 0 };
    enc_inf.video_st.next_pts = 1; 
    enc_inf.audio_st.next_pts = 1;
    enc_inf.encode_audio, enc_inf.encode_video = 0;
    int ret;
    int i;

    /* allocate the output media context */
    avformat_alloc_output_context2(&enc_inf.oc, NULL, NULL, filename);

    if (!enc_inf.oc) {
        std::cout << "FAILED" << std::endl;
        avformat_alloc_output_context2(&enc_inf.oc, NULL, "mpeg", filename);
    }

    enc_inf.fmt = enc_inf.oc->oformat;

    /* Add the audio and video streams using the default format codecs
     * and initialize the codecs. */
    if (enc_inf.fmt->video_codec != AV_CODEC_ID_NONE) {
        add_stream(&enc_inf.video_st, enc_inf.oc, &video_codec, enc_inf.fmt->video_codec);
        enc_inf.have_video = 1;
        enc_inf.encode_video = 1;
    }
    if (enc_inf.fmt->audio_codec != AV_CODEC_ID_NONE) {
        add_stream(&enc_inf.audio_st, enc_inf.oc, &audio_codec, enc_inf.fmt->audio_codec);
        enc_inf.have_audio = 1;
        enc_inf.encode_audio = 1;
    }

    /* Now that all the parameters are set, we can open the audio and
     * video codecs and allocate the necessary encode buffers. */
    if (enc_inf.have_video)
        open_video(enc_inf.oc, video_codec, &enc_inf.video_st, opt);

    if (enc_inf.have_audio)
        open_audio(enc_inf.oc, audio_codec, &enc_inf.audio_st, opt);
    av_dump_format(enc_inf.oc, 0, filename, 1);

    /* open the output file, if needed */
    if (!(enc_inf.fmt->flags & AVFMT_NOFILE)) {
        ret = avio_open(&enc_inf.oc->pb, filename, AVIO_FLAG_WRITE);
        if (ret < 0) {
            //VI_ERROR("Could not open '%s': %s\n", filename, ret);
            //return 1;
        }
    }

    /* Write the stream header, if any. */
    ret = avformat_write_header(enc_inf.oc, &opt);
    if (ret < 0) {
        VI_ERROR("Error occurred when opening output file:");
        //return 1;
    }
    
    //return 0;
}


/* Add an output stream. */
void video_encoder::add_stream(OutputStream *ost, AVFormatContext *oc,
                       const AVCodec **codec,
                       enum AVCodecID codec_id)
{
    AVCodecContext *c;
    int i;

    /* find the encoder */
    *codec = avcodec_find_encoder(codec_id);
    
    if (!(*codec)) {
        fprintf(stderr, "Could not find encoder for '%s'\n",
                avcodec_get_name(codec_id));
        exit(1);
    }

    ost->tmp_pkt = av_packet_alloc();

    if (!ost->tmp_pkt) {
        fprintf(stderr, "Could not allocate AVPacket\n");
        exit(1);
    }

    ost->st = avformat_new_stream(oc, NULL);
    if (!ost->st) {
        fprintf(stderr, "Could not allocate stream\n");
        exit(1);
    }
    ost->st->id = oc->nb_streams-1;
    c = avcodec_alloc_context3(*codec);
    if (!c) {
        fprintf(stderr, "Could not alloc an encoding context\n");
        exit(1);
    }
    ost->enc = c;


    switch ((*codec)->type) {
    case AVMEDIA_TYPE_AUDIO:
        ...
        break;
    case AVMEDIA_TYPE_VIDEO:
        c->codec_id = codec_id;

        c->bit_rate = 10000;
        /* Resolution must be a multiple of two. */
        c->width    = width;
        c->height   = height;
        /* 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. */
        ost->st->time_base = (AVRational){ 1, STREAM_FRAME_RATE }; // *frame_rate
        c->time_base       = ost->st->time_base;

        c->gop_size      = 7; /* emit one intra frame every twelve frames at most */
        //c->codec_id      = AV_CODEC_ID_H264;
        c->pix_fmt       = STREAM_PIX_FMT;
        //if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) 
        //    c->max_b_frames = 2;
        if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
            /* Needed to avoid using macroblocks in which some coeffs overflow.
             * This does not happen with normal video, it just happens here as
             * the motion of the chroma plane does not match the luma plane. */
            c->mb_decision = 2;
        }

        if ((*codec)->pix_fmts){
            //c->pix_fmt = (*codec)->pix_fmts[0];
            std::cout << "NEW FORMAT : " << c->pix_fmt << std::endl;
        }

        break;
    }
     

    /* Some formats want stream headers to be separate. */
    if (oc->oformat->flags & AVFMT_GLOBALHEADER)
        c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
}


    


    video_encoder.h

    


    
typedef struct OutputStream {
    AVStream *st;
    AVCodecContext *enc;

    /* pts of the next frame that will be generated */
    int64_t next_pts;
    int samples_count;

    AVFrame *frame;
    AVFrame *tmp_frame;

    AVPacket *tmp_pkt;

    float t, tincr, tincr2;

    struct SwsContext *sws_ctx;
    struct SwrContext *swr_ctx;
} OutputStream;

class video_encoder{
    private:
        typedef struct {
            OutputStream video_st, audio_st;
            const AVOutputFormat *fmt;
            AVFormatContext *oc;
            int have_video, have_audio, encode_video, encode_audio;
            std::string name;
        } encode_info;
    public:
        encode_info enc_inf;
        video_encoder(int w, int h, float fps, unsigned int duration);
        ~video_encoder();  
        ...
    private:
        ...
        void add_stream(OutputStream *ost, AVFormatContext *oc,
                       const AVCodec **codec,
                       enum AVCodecID codec_id);


    


    I'm thinking that the example sets the codec at avformat_alloc_output_context2(&enc_inf.oc, NULL, NULL, filename) but I'm not quite sure how to set it to h264.

    


    I've tried something like this avformat_alloc_output_context2(&enc_inf.oc, enc_inf.fmt, "h264", filename)

    


    But it just gives a seg fault. What am I supposed to do ?

    


    Edit : I've tried adding these two lines to video_encoder::video_encoder by deleting avformat_alloc_output_context2(&enc_inf.oc, NULL, NULL, filename); :

    


    
    video_codec = avcodec_find_encoder(AV_CODEC_ID_H264);
    enc_inf.video_st.enc = avcodec_alloc_context3(video_codec);



    


    But it resulted in these errors :
It says this every frame (A bunch of times)

    


    [mpeg @ 0x56057c465480] buffer underflow st=0 bufi=26822 size=31816


    


    Says this once when the frame encoding loop is over :

    


    [mpeg @ 0x5565ac4a04c0] start time for stream 0 is not set in estimate_timings_from_pts
[mpeg @ 0x5565ac4a04c0] stream 0 : no TS found at start of file, duration not set
[mpeg @ 0x5565ac4a04c0] Could not find codec parameters for stream 0 (Video: mpeg2video, none): unspecified size
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options