Recherche avancée

Médias (2)

Mot : - Tags -/rotation

Autres articles (15)

  • Encoding and processing into web-friendly formats

    13 avril 2011, par

    MediaSPIP automatically converts uploaded files to internet-compatible formats.
    Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
    Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
    Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
    All uploaded files are stored online in their original format, so you can (...)

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

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

Sur d’autres sites (3637)

  • libavcodec : how to encode raw video (YUV420P) frame to the valid bitmap for saving to the ".bmp" file ?

    26 octobre 2020, par Joe Dudinski

    I'm trying to save random video frames into the '.bmp' files by encoding raw video (YUV420P) into AV_CODEC_ID_BMP format using libavcodec, but result is broken image, contains 3 RGB channels :

    


    Resulting bmp
image

    


    Blue channel :
image

    


    Green channel :
image

    


    Red channel :
image

    


    Original YUV image :
image

    


    My code to get current yuv frame and encode it is into BMP :

    


    int __create_bmp(AVPacket *pkt, AVCodecContext *video_dec_ctx, int video_stream_idx) {
    int err = 0;
    int got_frame = 0;
    static int vfnum = 0; //current v.frame num

    if (pkt->stream_index == video_stream_idx) {

        fprintf(stderr, "AVCodecContext codec: (name: %s), ID %d\n",
                video_dec_ctx->codec->name, video_dec_ctx->codec_id);

        /* decode video frame */
        AVFrame *frame = av_frame_alloc();

        // !!! 'avcodec_decode_video2' IS DEPRECATED !!!
        err = avcodec_decode_video2(video_dec_ctx, frame, got_frame, pkt);
        if (err < 0) {
            fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(err));
            return err;
        }
        if(got_frame == 0) return 1;

        // !!! this dbg func save mjpeg YUV420P into '.jpg' file FINE !!!
        __encode_image_frame(frame);

        AVCodec *bmpc = avcodec_find_encoder(AV_CODEC_ID_BMP);
        if(bmpc == NULL){
            fprintf(stderr, "'AV_CODEC_ID_BMP' encoder NOT FOUND!.\n");
            exit(-1);
        }
        AVCodecContext *__bmpcc = avcodec_alloc_context3(bmpc);
        __bmpcc->width = frame->width;
        __bmpcc->height = frame->height;
        __bmpcc->pix_fmt = AV_PIX_FMT_BGR24;
        __bmpcc->time_base = (AVRational){1,1};

        err = avcodec_open2(__bmpcc, bmpc, NULL);
        if(err == 0){
            fprintf(stderr, "avcodec_open2 success.\n");
        }else{
            fprintf(stderr, "avcodec_open2 ERROR!\n");
        }

        err = avcodec_send_frame(__bmpcc, frame);
        if(err == 0){
            fprintf(stderr, "avcodec_send_frame success.\n");
        }
        else{
            fprintf(stderr, "avcodec_send_frame ERROR! (code: %d)\n",err);
        }

        AVPacket *bmp_pkt = av_packet_alloc();
        err = avcodec_receive_packet(__bmpcc, bmp_pkt);
        if(err == 0){
            fprintf(stderr, "avcodec_receive_packet success.\n");
        }
        else{
            fprintf(stderr, "avcodec_receive_packet ERROR! (code: %d)\n",err);
        }
        av_frame_unref(frame);

        /* write to bitmap file */
        char outimg[2048] = {0};
        snprintf(outimg, 2048,"out-%06d.bmp", vfnum);
        FILE *outf = fopen(outimg, "wb");
        vfnum++;
        if (!outf) {
            fprintf(stderr, "Could not open destination file %s\n", outimg);
        }else{
            fwrite(bmp_pkt->data, 1, bmp_pkt->size , outf);
            fclose(outf);
        }
        av_packet_unref(bmp_pkt);
        return 0;
    }
    return 1;
}


    


    Does anyone know how to do this correctly ?

    


  • Start of video is not labeled as "0" in QuickTime Video from GoPro

    26 mars 2020, par John Terragnoli

    I’m trying to combine four GoPro videos into a single video, and then rotate it 90 degrees. However, the time scales on the bottom of the videos are all wrong. The videos are 17 minutes and 42 second. But the beginning time is labeled as 5:15:20:32 and the ending time is 5:33:01:32. It just looks really weird and I’d like to fix it. After I use ffmpeg to rotate and concatenate the videos, the problem persists. Could it possibly be fixed with Exiftool ?

    ffmpeg -safe 0 -f concat -i list.txt -vcodec copy -acodec copy merged_videos.MP4

    ffmpeg -i input.mov -vf "transpose=1" output.mov

    Here is the exiftool information on one of the videos :

    File Name                       : GOPR3023.MP4
    Directory                       : .
    File Size                       : 3.7 GB
    File Modification Date/Time     : 2018:04:12 14:56:16-05:00
    File Access Date/Time           : 2020:03:25 12:17:18-05:00
    File Inode Change Date/Time     : 2020:03:25 17:57:04-05:00
    File Permissions                : rwxrwxrwx
    File Type                       : MP4
    File Type Extension             : mp4
    MIME Type                       : video/mp4
    Major Brand                     : MP4 v1 [ISO 14496-1:ch13]
    Minor Version                   : 2013.10.18
    Compatible Brands               : mp41
    Movie Data Size                 : 4001979951
    Movie Data Offset               : 28
    Movie Header Version            : 0
    Create Date                     : 2018:04:12 14:38:32
    Modify Date                     : 2018:04:12 14:38:32
    Time Scale                      : 60000
    Duration                        : 0:17:42
    Preferred Rate                  : 1
    Preferred Volume                : 100.00%
    Preview Time                    : 0 s
    Preview Duration                : 0 s
    Poster Time                     : 0 s
    Selection Time                  : 0 s
    Selection Duration              : 0 s
    Current Time                    : 0 s
    Next Track ID                   : 6
    Firmware Version                : HD5.03.02.51.00
    Lens Serial Number              : NAH6092300301117
    Camera Serial Number Hash       : 34676f2cdf49b86a1514817a93377bf7
    Track Header Version            : 0
    Track Create Date               : 2018:04:12 14:38:32
    Track Modify Date               : 2018:04:12 14:38:32
    Track ID                        : 1
    Track Duration                  : 0:17:42
    Track Layer                     : 0
    Track Volume                    : 0.00%
    Image Width                     : 1920
    Image Height                    : 1080
    Graphics Mode                   : srcCopy
    Op Color                        : 0 0 0
    Compressor ID                   : avc1
    Source Image Width              : 1920
    Source Image Height             : 1080
    X Resolution                    : 72
    Y Resolution                    : 72
    Compressor Name                 : GoPro AVC encoder
    Bit Depth                       : 24
    Color Representation            : nclx 1 1 1
    Video Frame Rate                : 59.94
    Time Code                       : 3
    Balance                         : 0
    Audio Format                    : mp4a
    Audio Channels                  : 2
    Audio Bits Per Sample           : 16
    Audio Sample Rate               : 48000
    Text Font                       : Unknown (21)
    Text Face                       : Plain
    Text Size                       : 10
    Text Color                      : 0 0 0
    Background Color                : 65535 65535 65535
    Font Name                       : Helvetica
    Other Format                    : tmcd
    Warning                         : [minor] The ExtractEmbedded option may find more tags in the movie data
    Matrix Structure                : 1 0 0 0 1 0 0 0 1
    Media Header Version            : 0
    Media Create Date               : 2018:04:12 14:38:32
    Media Modify Date               : 2018:04:12 14:38:32
    Media Time Scale                : 60000
    Media Duration                  : 0:17:42
    Handler Class                   : Media Handler
    Handler Type                    : NRT Metadata
    Handler Description             : GoPro SOS
    Gen Media Version               : 0
    Gen Flags                       : 0 0 0
    Gen Graphics Mode               : srcCopy
    Gen Op Color                    : 0 0 0
    Gen Balance                     : 0
    Meta Format                     : fdsc
    Image Size                      : 1920x1080
    Megapixels                      : 2.1
    Avg Bitrate                     : 30.1 Mbps
    Rotation                        : 0

    Part 2
    There is a pretty obvious "stutter" at the 17:42 mark where the two clips are combined. I’ve tried using ffmpeg and iMovie, but both give the same results. The GoPro broke up the event into multiple clips on it’s own so it seems weird that there would be any information missing. Is there any way to get rid of this stutter ?

    Thanks !

  • "Format" or style the output of showwaves/showwavespic in ffmpeg

    9 avril 2020, par flomei

    I'm trying to get my head wrapped around ffmpeg and its functions and filters.

    



    showwaves and showwavespic already create nice output, but I'm looking to style it even more. Lots of audioplayers for example create a "waveform" like the following, which would be a job for showwavespic, I think. (I think soundcloud for example does create a form like this with actual data.)
pretty waveform

    



    I wonder if I can use ffmpeg to create something like this directly from my raw input data. I thought I might need to split my audio track into X parts, calculate the average distance from the Y-axis and then create a bar. But I'm not sure if I can manage to do that with ffmpeg or if I need to build more of a toolchain for that.

    



    If I could create the output of showwaves to look like that above, that would be great. On the other hand I'd already be happy if I could just increase the stroke width of the showwaves output.

    



    Didn't found anything about the in the documentation or I looked at the wrong places, because I don't yet get the big picture of ffmpeg.