Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (101)

  • Multilang : améliorer l’interface pour les blocs multilingues

    18 février 2011, par

    Multilang est un plugin supplémentaire qui n’est pas activé par défaut lors de l’initialisation de MediaSPIP.
    Après son activation, une préconfiguration est mise en place automatiquement par MediaSPIP init permettant à la nouvelle fonctionnalité d’être automatiquement opérationnelle. Il n’est donc pas obligatoire de passer par une étape de configuration pour cela.

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

Sur d’autres sites (11106)

  • opencv Mat convert to AVFrame

    2 août 2014, par Godspped

    I have an image in OpenCV which I can view and save correctly, I want to take this image and pass it to FFMPEG so I can encode it, but when I save the jpg output from ffpmeg I get a empty image, which probably means I am not copying the data correctly over to AVFrame.

    What am I doing wrong...

    Any help is greatly appreciated.

    This is how I set up the final_frame and yuv422 frame

    final_frame = avcodec_alloc_frame();
    int num_bytes = avpicture_get_size(PIX_FMT_BGR24, 1600, 720);
    final_frame1_buffer = (uint8_t *)av_malloc(num_bytes*sizeof(uint8_t));
    avpicture_fill((AVPicture*)final_frame, final_frame1_buffer, PIX_FMT_BGR24, 1600, 720);

    yuv422_final_frame = avcodec_alloc_frame();
    int yuv422_num_bytes = avpicture_get_size( PIX_FMT_YUV422P, 1600, 720 );
    final_frame2_buffer = (uint8_t *)av_malloc(yuv422_num_bytes*sizeof(uint8_t));
    avpicture_fill((AVPicture*)yuv422_final_frame, final_frame2_buffer, PIX_FMT_YUVJ422P, 1600, 720);

    I have attached the code below

    cv::imshow("output image", im3);   <---------- Image shows correctly
    cv::Mat rgb_frame;
    cv::cvtColor( im3 , rgb_frame, CV_BGR2RGB ) ;
    if (final_sws_ctx == NULL)
    {
       final_sws_ctx = sws_getContext(1600, 720,
       AV_PIX_FMT_BGR24, 1600, 720,
       AV_PIX_FMT_YUVJ422P, SWS_FAST_BILINEAR, 0, 0, 0);
    }

    imwrite( "rgbjpeg.jpg", rgb_frame );  <----- Image Saves correctly here too

    avpicture_fill((AVPicture*)final_frame, rgb_frame.data, PIX_FMT_RGB24, 1600, 720);
    sws_scale(final_sws_ctx, final_frame->data,
             final_frame->linesize,
             0, 720,
             yuv422_final_frame->data,
             yuv422_final_frame->linesize);

    AVPacket encode_packet;
    int got_output = 0;
    av_init_packet(&encode_packet);
    encode_packet.data = NULL;
    encode_packet.size = 0;
    int ret = avcodec_encode_video2(final_codec_context,
                                   &encode_packet,
                                   yuv422_final_frame,
                                   &got_output);

    if (got_output ) {
       CString temp;

       temp.Format( "test%u.jpg", counter);
       FILE* outputFile = fopen(temp, "wb");
       printf("Write frame (size=%5d)\n", encode_packet.size);
       fwrite(encode_packet.data, 1, encode_packet.size, outputFile);
       av_free_packet(&encode_packet);
       fclose(outputFile);

       counter++;  
    }
  • Ffmpeg : Audio/Video mixing but no sound

    14 janvier 2014, par user2914878

    I'm trying to add an audio file to a video file generated from images with FFmpeg.

    The command i am using on a Debian distrib is this one

    ffmpeg -r 1 -i edit%0d.jpg outputName.mp4 -i Test.mp3

    The video file is created but the audio is not working .

    Output : :

    > ffmpeg version 0.8.9-6:0.8.9-1, Copyright (c) 2000-2013 the Libav developers
     built on Nov  3 2013 00:54:50 with gcc 4.7.2
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    [image2 @ 0x2283b20] max_analyze_duration reached
    Input #0, image2, from 'edit%0d.jpg':
     Duration: 00:00:24.00, start: 0.000000, bitrate: N/A
       Stream #0.0: Video: mjpeg, yuvj420p, 800x600 [PAR 1:1 DAR 4:3], 1 fps, 1 tbr, 1 tbn, 1 tbc
    [mp3 @ 0x22d8840] max_analyze_duration reached
    [mp3 @ 0x22d8840] Estimating duration from bitrate, this may be inaccurate
    Input #1, mp3, from 'Test.mp3':
     Duration: 00:00:46.04, start: 0.000000, bitrate: 128 kb/s
       Stream #1.0: Audio: mp3, 16000 Hz, mono, s16, 128 kb/s
    [buffer @ 0x2287480] w:800 h:600 pixfmt:yuvj420p
    [libx264 @ 0x22d7d20] using SAR=1/1
    [libx264 @ 0x22d7d20] using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.2 AVX
    [libx264 @ 0x22d7d20] profile Main, level 3.1
    [libx264 @ 0x22d7d20] 264 - core 123 r2189 35cf912 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=0 b_adapt=1 b_bias=0 direct=1 weightb=0 open_gop=1 weightp=2 keyint=250 keyint_min=1 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.25 aq=1:1.00
    Output #0, mp4, to '6953289.mp4':
     Metadata:
       encoder         : Lavf53.21.1
       Stream #0.0: Video: libx264, yuvj420p, 800x600 [PAR 1:1 DAR 4:3], q=-1--1, 1 tbn, 1 tbc
    Stream mapping:
     Stream #0.0 -> #0.0
    Press ctrl-c to stop encoding
    frame=   24 fps= 16 q=17.0 Lsize=    1247kB time=23.00 bitrate= 444.1kbits/s
    video:1246kB audio:0kB global headers:0kB muxing overhead 0.079555%
    frame I:1     Avg QP:14.91  size: 65650
    [libx264 @ 0x22d7d20] frame P:23    Avg QP:14.94  size: 52587
    [libx264 @ 0x22d7d20] mb I  I16..4: 11.8%  0.0% 88.2%
    [libx264 @ 0x22d7d20] mb P  I16..4: 29.8%  0.0% 60.5%  P16..4:  6.8%  0.2%  0.3%  0.0%  0.0%    skip: 2.4%
    [libx264 @ 0x22d7d20] coded y,uvDC,uvAC intra: 73.2% 58.6% 49.7% inter: 9.2% 8.0% 1.2%
    [libx264 @ 0x22d7d20] i16 v,h,dc,p: 56% 24%  6% 14%
    [libx264 @ 0x22d7d20] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 22% 12%  7%  7%  7%  7%  7%  7%
    [libx264 @ 0x22d7d20] i8c dc,h,v,p: 60% 17% 13%  9%
    [libx264 @ 0x22d7d20] Weighted P-Frames: Y:17.4% UV:17.4%
    [libx264 @ 0x22d7d20] ref P L0: 12.9%  8.0% 66.4% 12.8%
    [libx264 @ 0x22d7d20] kb/s:425.05

    On Windows it is working fine, i tried multiple scenarios but i can't seem to find the issue, maybe a codec problem ?

    Thank you !

    Update :

    I manage to fix it this way :

    ffmpeg -r 1 -i edit%0d.jpg -i Test.mp3 -ar 44100 -strict experimental
  • How to set FFmpeg decode framerate when decoding audio from microphone ?

    2 septembre 2020, par Sang

    I use FFmpeg to capture audio data from a microphone on Windows. The main code snippet is while(av_read_frame()){/*...*/}. The program will get frames in a default rate, feels about 4 frames per second. But I want to set this rate to 30 frames per second.

    


    I tried this : g_codecCtx->framerate = av_make_q(30, 1);, but it doesn't work. I also use g_codecCtx->sample_rate = 16000; and g_codecCtx->channels = 1; to set the sample rate and the channel, yet I don't know whether it really make sense.

    


    Do you know how to change the rate of reading frames ? Thanks very much.