Recherche avancée

Médias (39)

Mot : - Tags -/audio

Autres articles (87)

  • Les statuts des instances de mutualisation

    13 mars 2010, par

    Pour des raisons de compatibilité générale du plugin de gestion de mutualisations avec les fonctions originales de SPIP, les statuts des instances sont les mêmes que pour tout autre objets (articles...), seuls leurs noms dans l’interface change quelque peu.
    Les différents statuts possibles sont : prepa (demandé) qui correspond à une instance demandée par un utilisateur. Si le site a déjà été créé par le passé, il est passé en mode désactivé. publie (validé) qui correspond à une instance validée par un (...)

  • Supporting all media types

    13 avril 2011, par

    Unlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)

  • Participer à sa traduction

    10 avril 2011

    Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
    Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
    Actuellement MediaSPIP n’est disponible qu’en français et (...)

Sur d’autres sites (7668)

  • using X264 and librtmp to send live camera frame, but the flash can't show

    9 mai 2016, par brian_wang

    I am using X264 and librtmp to send my live camera frame, all the things seems right. but my web test flash can’t show the correct video. Sometimes it seems correct, but when I re-click play button, it doesn’t show any picture on the flash.

    Here is my X264 config code

    x264_param_default_preset(&x264param, "ultrafast", "zerolatency");
    x264param.i_threads = 2;
    x264param.i_width = width;
    x264param.i_height = height;
    x264param.i_log_level = X264_LOG_DEBUG;
    x264param.i_fps_num = x264param.i_timebase_num= fps;
    x264param.i_fps_den = x264param.i_timebase_den=1;
    x264param.i_frame_total = 0;

    x264param.i_frame_reference =1;
    //x264param.i_frame_reference = 2;
    x264param.i_keyint_min = 25;
    x264param.i_keyint_max = fps*3;
    x264param.i_scenecut_threshold = 40;

    x264param.b_deblocking_filter = 1;
    x264param.b_cabac = 0;
    x264param.analyse.i_trellis = 0;
    x264param.analyse.b_chroma_me = 1;

    x264param.vui.i_sar_width = 0;
    x264param.vui.i_sar_height = 0;
    x264param.i_bframe_bias = 0;
    x264param.b_interlaced= 0;
    x264param.analyse.i_subpel_refine = 6; /* 0..5 -> 1..6 */
    x264param.analyse.i_me_method = X264_ME_DIA;//X264_ME_HEX?X264_ME_DIA
    x264param.analyse.i_me_range = 16;
    x264param.analyse.i_direct_mv_pred = X264_DIRECT_PRED_AUTO;
    x264param.i_deblocking_filter_alphac0 = 0;
    x264param.i_deblocking_filter_beta = 0;
    //x264param.analyse.intra = X264_ANALYSE_I4x4;
    x264param.analyse.intra = X264_ANALYSE_I4x4;//  | X264_ANALYSE_PSUB16x16 | X264_ANALYSE_BSUB16x16;
    x264param.analyse.inter = X264_ANALYSE_I4x4 | X264_ANALYSE_PSUB16x16 | X264_ANALYSE_BSUB16x16;
    //edit 2014-7-28
    x264param.analyse.b_transform_8x8 = 1;
    //x264param.analyse.b_transform_8x8 = 0;
    x264param.analyse.b_fast_pskip = 1;
    x264param.i_bframe = 0;
    //x264param.b_intra_refresh
    x264param.analyse.b_weighted_bipred = 0;

    //// Intra refres:
    x264param.i_keyint_max = 250;
    x264param.b_intra_refresh = 0;
    ////Rate control:
    //x264param.rc.i_rc_method = X264_RC_CRF;

    //Rate Control
    x264param.rc.f_ip_factor = 1.4f;
    x264param.rc.f_pb_factor = 1.3f;
    x264param.rc.f_qcompress = 1.0;
    x264param.rc.i_qp_min = 20;//20;
    x264param.rc.i_qp_max = 32;
    x264param.rc.i_qp_step = 1;

    switch (0)
    {
    case 0: /* 1 PASS ABR */
       x264param.rc.i_rc_method = X264_RC_ABR;
       x264param.rc.i_bitrate = 300; // max = 5000
       x264param.rc.b_mb_tree = 0;
       break;
    case 1: /* 1 PASS CQ */
       x264param.rc.i_rc_method = X264_RC_CQP;
       x264param.rc.i_qp_constant = 26;//10 - 51
       break;
    }

    //For streaming:
    x264param.b_repeat_headers = 1;
    x264param.b_annexb = 1;
    x264_param_apply_profile(&x264param, "baseline");
    encoder = x264_encoder_open(&x264param);
    x264_picture_init( &pic_in );
    x264_picture_alloc(&pic_in, X264_CSP_I420, width, height);

    pic_in.img.i_csp = X264_CSP_I420|X264_CSP_VFLIP;
    pic_in.img.i_plane = 3;
    pic_in.i_type = X264_TYPE_AUTO;

    Sending To RTMP :

    sws_scale(convertCtx,&a,&scribe,0,height, pic_in.img.plane, pic_in.img.i_stride);
    int i_nal;
    int i_frame_size = x264_encoder_encode( encoder, &nal, &i_nal, &pic_in, &pic_out );
    if(i_frame_size <= 0){
       printf("\t!!!FAILED encode frame \n");
    }else{
       for (int i = 0,last=0; i < i_nal;i++)  
       {
           fwrite(nal[i].p_payload, 1, i_frame_size-last, fpw1);
           if (nal[i].i_type == NAL_SPS) {
               sps_len = nal[i].i_payload-4;
               sps  = new unsigned char[sps_len];
               memcpy(sps,nal[i].p_payload+4,sps_len);
           } else if (nal[i].i_type == NAL_PPS) {
               pps_len = nal[i].i_payload-4;
               pps  = new unsigned char[sps_len];
               memcpy(pps,nal[i].p_payload+4,pps_len);
               send_video_sps_pps();
               free(sps);
               free(pps);
           } else {
               send_rtmp_video(nal[i].p_payload,i_frame_size-last);
               break;
           }
           last += nal[i].i_payload;
       }
    }

    Send PPS and SPS

    void send_video_sps_pps(){
    if(rtmp!= NULL){
       RTMPPacket * packet;
       unsigned char * body;
       int i;

       packet = (RTMPPacket *)malloc(RTMP_HEAD_SIZE+1024);
       memset(packet,0,RTMP_HEAD_SIZE);

       packet->m_body = (char *)packet + RTMP_HEAD_SIZE;
       body = (unsigned char *)packet->m_body;
       i = 0;
       body[i++] = 0x17;
       body[i++] = 0x00;

       body[i++] = 0x00;
       body[i++] = 0x00;
       body[i++] = 0x00;

       /*AVCDecoderConfigurationRecord*/
       body[i++] = 0x01;
       body[i++] = sps[1];
       body[i++] = sps[2];
       body[i++] = sps[3];
       body[i++] = 0xff;

       /*sps*/
       body[i++]   = 0xe1;
       body[i++] = (sps_len >> 8) & 0xff;
       body[i++] = sps_len & 0xff;
       memcpy(&body[i],sps,sps_len);
       i +=  sps_len;

       /*pps*/
       body[i++]   = 0x01;
       body[i++] = (pps_len >> 8) & 0xff;
       body[i++] = (pps_len) & 0xff;
       memcpy(&body[i],pps,pps_len);
       i +=  pps_len;

       packet->m_packetType = RTMP_PACKET_TYPE_VIDEO;
       packet->m_nBodySize = i;
       packet->m_nChannel = 0x04;
       packet->m_nTimeStamp = 0;
       packet->m_hasAbsTimestamp = 0;
       packet->m_headerType = RTMP_PACKET_SIZE_MEDIUM;
       packet->m_nInfoField2 = rtmp->m_stream_id;

       RTMP_SendPacket(rtmp,packet,TRUE);
       free(packet);  
       rtmp_start_time = GetTickCount();
    }else{
       std::cout<<"RTMP is not ready"<code>

    Send video Frame

    void send_rtmp_video(unsigned char * buf,int len){
    RTMPPacket * packet;
    long timeoffset = GetTickCount() - rtmp_start_time;

    int type = buf[0]&0x1f;

    packet = (RTMPPacket *)malloc(RTMP_HEAD_SIZE+len+9);
    memset(packet,0,RTMP_HEAD_SIZE);

    packet->m_body = (char *)packet + RTMP_HEAD_SIZE;
    packet->m_nBodySize = len + 9;

    /*send video packet*/
    unsigned char *body = (unsigned char *)packet->m_body;
    memset(body,0,len+9);

    /*key frame*/
    body[0] = 0x27;
    if (type == NAL_SLICE_IDR) {
       body[0] = 0x17;
    }

    body[1] = 0x01;   /*nal unit*/
    body[2] = 0x00;
    body[3] = 0x00;
    body[4] = 0x00;

    body[5] = (len >> 24) & 0xff;
    body[6] = (len >> 16) & 0xff;
    body[7] = (len >>  8) & 0xff;
    body[8] = (len ) & 0xff;

    /*copy data*/
    memcpy(&body[9],buf,len);

    packet->m_hasAbsTimestamp = 0;
    packet->m_packetType = RTMP_PACKET_TYPE_VIDEO;
    if(rtmp != NULL){
       packet->m_nInfoField2 = rtmp->m_stream_id;
    }
    packet->m_nChannel = 0x04;
    packet->m_headerType = RTMP_PACKET_SIZE_LARGE;
    packet->m_nTimeStamp = timeoffset;

    if(rtmp != NULL){
       RTMP_SendPacket(rtmp,packet,TRUE);
    }
    free(packet);

    }

  • What is the best equalizer setting you can suggest guys ?

    7 mars 2018, par Asit Rout

    I have been working with ffmpeg and need some help with equalizer setting. Currently I am using

    f=40 w=40 g=5 t=1           |   f=130 w=140 g=4 t=1     |
    f=500 w=600 g=2 t=1         |   f=1400 w=1200 g=2 t=1   |
    f=3000 w=2000 g=1 t=1       |   f=5500 w=3000 g=0 t=1   |
    f=9500 t=1 w=5000 g=8 t=1   |   f=14000 w=4000 g=10 t=1

    Any comments and suggestions will be really helpful.

  • How to keep transparency when scale webm file with ffmpeg

    5 octobre 2022, par Sonia Kidman

    I'm using ffmpeg to scale my WEBM file, by using below command : 
ffmpeg -i in.webm -c:v libvpx -vf scale=100:100 out.webm
The output has correct resolution as I expected but the problem is transparency become black background.

    



    Could someone give me a solution for this.

    



    Thank you so much.

    



    Below is the log of the operation :

    



    ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument '56'.
Reading option '-i' ... matched as input url with argument 'in.webm'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libvpx'.
Reading option '-vf' ... matched as option 'vf' (set video filters) with argument 'scale=320:240'.
Reading option 'out.webm' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 56.
Successfully parsed a group of options.
Parsing a group of options: input url in.webm.
Successfully parsed a group of options.
Opening an input file: in.webm.
[NULL @ 000002387e6322a0] Opening 'in.webm' for reading
[file @ 000002387e632ea0] Setting default whitelist 'file,crypto'
Probing matroska,webm score:100 size:2048
Probing mp3 score:1 size:2048
[matroska,webm @ 000002387e6322a0] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
[matroska,webm @ 000002387e6322a0] Before avformat_find_stream_info() pos: 634 bytes read:32768 seeks:0 nb_streams:1
[matroska,webm @ 000002387e6322a0] All info found
[matroska,webm @ 000002387e6322a0] stream 0: start_time: 0.000 duration: -9223372036854776.000
[matroska,webm @ 000002387e6322a0] format: start_time: 0.000 duration: 0.400 bitrate=1432 kb/s
[matroska,webm @ 000002387e6322a0] After avformat_find_stream_info() pos: 34843 bytes read:65536 seeks:0 frames:1
Input #0, matroska,webm, from 'in.webm':
  Metadata:
    ENCODER         : Lavf57.83.100
  Duration: 00:00:00.40, start: 0.000000, bitrate: 1432 kb/s
    Stream #0:0, 1, 1/1000: Video: vp8, 1 reference frame, yuv420p(progressive), 640x480, 0/1, SAR 1:1 DAR 4:3, 10 fps, 10 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1
      ENCODER         : Lavc57.107.100 libvpx
      DURATION        : 00:00:00.400000000
Successfully opened the file.
Parsing a group of options: output url out.webm.
Applying option c:v (codec name) with argument libvpx.
Applying option vf (set video filters) with argument scale=320:240.
Successfully parsed a group of options.
Opening an output file: out.webm.
[file @ 000002387e658b40] Setting default whitelist 'file,crypto'
Successfully opened the file.
detected 4 logical cores
Stream mapping:
  Stream #0:0 -> #0:0 (vp8 (native) -> vp8 (libvpx))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per stream)
    Last message repeated 4 times
[Parsed_scale_0 @ 000002387e718a60] Setting 'w' to value '320'
[Parsed_scale_0 @ 000002387e718a60] Setting 'h' to value '240'
[Parsed_scale_0 @ 000002387e718a60] Setting 'flags' to value 'bicubic'
[Parsed_scale_0 @ 000002387e718a60] w:320 h:240 flags:'bicubic' interl:0
[graph 0 input from stream 0:0 @ 000002387e743b00] Setting 'video_size' to value '640x480'
[graph 0 input from stream 0:0 @ 000002387e743b00] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 000002387e743b00] Setting 'time_base' to value '1/1000'
[graph 0 input from stream 0:0 @ 000002387e743b00] Setting 'pixel_aspect' to value '1/1'
[graph 0 input from stream 0:0 @ 000002387e743b00] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 000002387e743b00] Setting 'frame_rate' to value '10/1'
[graph 0 input from stream 0:0 @ 000002387e743b00] w:640 h:480 pixfmt:yuv420p tb:1/1000 fr:10/1 sar:1/1 sws_param:flags=2
[format @ 000002387e7fe1e0] compat: called with args=[yuv420p|yuva420p]
[format @ 000002387e7fe1e0] Setting 'pix_fmts' to value 'yuv420p|yuva420p'
[AVFilterGraph @ 000002387e634e60] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
[Parsed_scale_0 @ 000002387e718a60] w:640 h:480 fmt:yuv420p sar:1/1 -> w:320 h:240 fmt:yuv420p sar:1/1 flags:0x4
[libvpx @ 000002387e657fe0] v1.6.1
[libvpx @ 000002387e657fe0] --prefix=/Users/kyle/software/libvpx/win64/libvpx-1.6.1-win64 --target=x86_64-win64-gcc
[libvpx @ 000002387e657fe0] vpx_codec_enc_cfg
[libvpx @ 000002387e657fe0] generic settings
  g_usage:                      0
  g_threads:                    0
  g_profile:                    0
  g_w:                          320
  g_h:                          240
  g_bit_depth:                  8
  g_input_bit_depth:            8
  g_timebase:                   {1/30}
  g_error_resilient:            0
  g_pass:                       0
  g_lag_in_frames:              0
[libvpx @ 000002387e657fe0] rate control settings
  rc_dropframe_thresh:          0
  rc_resize_allowed:            0
  rc_resize_up_thresh:          60
  rc_resize_down_thresh:        30
  rc_end_usage:                 0
  rc_twopass_stats_in:          0000000000000000(0)
  rc_target_bitrate:            256
[libvpx @ 000002387e657fe0] quantizer settings
  rc_min_quantizer:             4
  rc_max_quantizer:             63
[libvpx @ 000002387e657fe0] bitrate tolerance
  rc_undershoot_pct:            100
  rc_overshoot_pct:             100
[libvpx @ 000002387e657fe0] decoder buffer model
  rc_buf_sz:                    6000
  rc_buf_initial_sz:            4000
  rc_buf_optimal_sz:            5000
[libvpx @ 000002387e657fe0] 2 pass rate control settings
  rc_2pass_vbr_bias_pct:        50
  rc_2pass_vbr_minsection_pct:  0
  rc_2pass_vbr_maxsection_pct:  400
[libvpx @ 000002387e657fe0] keyframing settings
  kf_mode:                      1
  kf_min_dist:                  0
  kf_max_dist:                  128
[libvpx @ 000002387e657fe0] 
[libvpx @ 000002387e657fe0] vpx_codec_enc_cfg
[libvpx @ 000002387e657fe0] generic settings
  g_usage:                      0
  g_threads:                    0
  g_profile:                    0
  g_w:                          320
  g_h:                          240
  g_bit_depth:                  8
  g_input_bit_depth:            8
  g_timebase:                   {1/10}
  g_error_resilient:            0
  g_pass:                       0
  g_lag_in_frames:              25
[libvpx @ 000002387e657fe0] rate control settings
  rc_dropframe_thresh:          0
  rc_resize_allowed:            0
  rc_resize_up_thresh:          60
  rc_resize_down_thresh:        30
  rc_end_usage:                 0
  rc_twopass_stats_in:          0000000000000000(0)
  rc_target_bitrate:            200
[libvpx @ 000002387e657fe0] quantizer settings
  rc_min_quantizer:             4
  rc_max_quantizer:             63
[libvpx @ 000002387e657fe0] bitrate tolerance
  rc_undershoot_pct:            100
  rc_overshoot_pct:             100
[libvpx @ 000002387e657fe0] decoder buffer model
  rc_buf_sz:                    6000
  rc_buf_initial_sz:            4000
  rc_buf_optimal_sz:            5000
[libvpx @ 000002387e657fe0] 2 pass rate control settings
  rc_2pass_vbr_bias_pct:        50
  rc_2pass_vbr_minsection_pct:  0
  rc_2pass_vbr_maxsection_pct:  400
[libvpx @ 000002387e657fe0] keyframing settings
  kf_mode:                      1
  kf_min_dist:                  0
  kf_max_dist:                  128
[libvpx @ 000002387e657fe0] 
[libvpx @ 000002387e657fe0] vpx_codec_control
[libvpx @ 000002387e657fe0]   VP8E_SET_CPUUSED:             1
[libvpx @ 000002387e657fe0]   VP8E_SET_ARNR_MAXFRAMES:      0
[libvpx @ 000002387e657fe0]   VP8E_SET_ARNR_STRENGTH:       3
[libvpx @ 000002387e657fe0]   VP8E_SET_ARNR_TYPE:           3
[libvpx @ 000002387e657fe0]   VP8E_SET_NOISE_SENSITIVITY:   0
[libvpx @ 000002387e657fe0]   VP8E_SET_TOKEN_PARTITIONS:    0
[libvpx @ 000002387e657fe0]   VP8E_SET_STATIC_THRESHOLD:    0
[libvpx @ 000002387e657fe0] Using deadline: 1000000
Output #0, webm, to 'out.webm':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0, 0, 1/1000: Video: vp8 (libvpx), 1 reference frame, yuv420p, 320x240 [SAR 1:1 DAR 4:3], 0/1, q=-1--1, 200 kb/s, 10 fps, 1k tbn, 10 tbc (default)
    Metadata:
      alpha_mode      : 1
      DURATION        : 00:00:00.400000000
      encoder         : Lavc57.107.100 libvpx
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
Clipping frame in rate conversion by 0.000008
[webm @ 000002387e656880] get_metadata_duration returned: 400000
[webm @ 000002387e656880] Write early duration from metadata = 400
[webm @ 000002387e656880] Writing block at offset 3, size 11223, pts 0, dts 0, duration 100, keyframe 1
[webm @ 000002387e656880] Writing block at offset 11233, size 1288, pts 100, dts 100, duration 100, keyframe 0
[webm @ 000002387e656880] Writing block at offset 12528, size 1504, pts 200, dts 200, duration 100, keyframe 0
[webm @ 000002387e656880] Writing block at offset 14039, size 2481, pts 300, dts 300, duration 100, keyframe 0
[out_0_0 @ 000002387e743d60] EOF on sink link out_0_0:default.
No more output streams to write to, finishing.
[webm @ 000002387e656880] end duration = 400
[webm @ 000002387e656880] stream 0 end duration = 400
frame=    4 fps=0.0 q=0.0 Lsize=      17kB time=00:00:00.30 bitrate= 457.8kbits/s speed=4.45x    
video:16kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.413191%
Input file #0 (in.webm):
  Input stream #0:0 (video): 4 packets read (34992 bytes); 4 frames decoded; 
  Total: 4 packets (34992 bytes) demuxed
Output file #0 (out.webm):
  Output stream #0:0 (video): 4 frames encoded; 4 packets muxed (16496 bytes); 
  Total: 4 packets (16496 bytes) muxed
4 frames successfully decoded, 0 decoding errors
[AVIOContext @ 000002387e698c20] Statistics: 14 seeks, 10 writeouts
[AVIOContext @ 000002387cc773e0] Statistics: 71649 bytes read, 0 seeks