Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (69)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Des sites réalisés avec MediaSPIP

    2 mai 2011, par

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

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

  • Iphone Streaming and playing Audio Problem

    20 août 2011, par KayKay

    I am trying to make an app that plays audio stream using ffmpeg, libmms.
    I can open mms server, get stream, and decode audio frame to raw frame using suitable codec.
    However I don't know how to do next.
    I think I must use AudioToolbox/AudioToolbox.h and make audioqueue.
    but however when I give audioqueuebuffer decode buffer's memory and play, Only plays the white noise.
    Here is my code.

    What am i missing ?
    Any comment and hint is very appreciated.
    Thanks very much.

    while(av_read_frame(pFormatCtx, &pkt)>=0)
    {
       int pkt_decoded_len = 0;
       int frame_decoded_len;
       int decode_buff_remain=AVCODEC_MAX_AUDIO_FRAME_SIZE * 5;
       if(pkt.stream_index==audiostream)
       {
           frame_decoded_len=decode_buff_remain;
           int16_t *decode_buff_ptr = decode_buffer;
           int decoded_tot_len=0;
           pkt_decoded_len = avcodec_decode_audio2(pCodecCtx, decode_buff_ptr, &frame_decoded_len,
                                                   pkt.data, pkt.size);
           if (pkt_decoded_len <0) break;
           AudioQueueAllocateBuffer(audioQueue, kBufferSize, &buffers[i]);
           AQOutputCallback(self, audioQueue, buffers[i], pkt_decoded_len);

           if(i == 1){
               AudioQueueSetParameter(audioQueue, kAudioQueueParam_Volume, 1.0);
               AudioQueueStart(audioQueue, NULL);
           }
           i++;
       }
    }


    void AQOutputCallback(void *inData, AudioQueueRef inAQ, AudioQueueBufferRef inBuffer, int copySize)
    {
       mmsDemoViewController *staticApp = (mmsDemoViewController *)inData;
       [staticApp handleBufferCompleteForQueue:inAQ buffer:inBuffer size:copySize];
    }

    - (void)handleBufferCompleteForQueue:(AudioQueueRef)inAQ
                             buffer:(AudioQueueBufferRef)inBuffer
                               size:(int)copySize
    {
       inBuffer->mAudioDataByteSize = inBuffer->mAudioDataBytesCapacity;
       memcpy((char*)inBuffer->mAudioData, (const char*)decode_buffer, copySize);

       AudioQueueEnqueueBuffer(inAQ, inBuffer, 0, NULL);
    }
  • iPhone ffmpeg dev using libav to decode from AMR to ACC codec

    10 octobre 2011, par VictorT

    It seems to be that, the AMR support of AudioQueue has been disappeared since iOS 4.3 was released. I can't use audio frame received from RSTP server with old way :

    audioFormat.mFormatID = kAudioFormatAMR;
    int err = AudioQueueNewOutput(&audioFormat, MyAudioQueueOutputCallback, self, NULL, kCFRunLoopCommonModes, 0, &audioQueue);

    As a result I received an error in last string.

    Maybe someone know how to decode AMR AVPacket into raw buffer and encode it with AAC or MP3 using LIBAV ?

    I've tried to use

    avcodec_decode_audio3

    It works and I can get raw buffer but when I'm trying to encode it with

    avcodec_encode_audio

    I get 0 as result

    This is my method to encode buffer :

    - (AVPacket) encodeRawFrame:(const short *) in_buffer withSize:(unsigned int) in_buf_byte_size
    {
       AVPacket res;
       AVCodec *codec;
       AVCodecContext *c= NULL;
       int count, out_size, outbuf_size, frame_byte_size;
       uint8_t *outbuf;

       avcodec_init();
       avcodec_register_all();

       printf("Audio encoding\n");

       codec = avcodec_find_encoder(CODEC_ID_AAC);
       if (!codec) {
           fprintf(stderr, "codec not found\n");
           return res;
       }

       c= avcodec_alloc_context();

       c->bit_rate = 64000;
       c->sample_rate = 24000;
       c->channels = 2;

       if (avcodec_open(c, codec) < 0)
       {
           fprintf(stderr, "could not open codec\n");
       }
       else
       {
           frame_byte_size=c->frame_size*2*2;
           count = in_buf_byte_size/frame_byte_size;

           fprintf(stderr, "Number of frames: %d\n", count);

           outbuf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
           outbuf = (uint8_t*) malloc(outbuf_size);

           out_size = avcodec_encode_audio(c, outbuf, outbuf_size, &in_buffer[frame_byte_size*i]);
           if(out_size >= 0)
           {
               res.size = outbuf_size;
               res.data = malloc(outbuf_size);                
           }

           free(outbuf);
       }


       avcodec_close(c);
       av_free(c);
       return res;
    }

    After encoding "out_size" is always 0 and result buffer is empty.

    Thanks.

  • How to make ffmpeg remux an iPhone MOV (HEVC) that works on Apple products ?

    21 janvier 2024, par Mikael Finstad

    I want to remux a HEVC file (without encoding). I have tried most options, even removing audio, but I cannot get an output file that plays smoothly with Apple products.

    



    First I AirDrop any MOV from an iPhone recorded with the camera in HEVC.

    



    Then run :

    



    ffmpeg -i IMG_4605.MOV -c copy out.mov


    



    Then if I send out.mov back to the iPhone and try to play it back, it plays back with glitches while seeking, like this : (original to the right)

    



    Result
Original

    



    When I try to drag the file into a new iMovie project and try to play it back, it freezes the whole iMovie app and needs a force quit.

    



    Doing the same with the original causes no issues, so obviously there is something wrong with the way ffmpeg remuxes it, or something wrong with Apple's software.

    



    ffmpeg -i IMG_4605.MOV 
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'IMG_4605.MOV':
  Metadata:
    major_brand     : qt  
    minor_version   : 0
    compatible_brands: qt  
    creation_time   : 2019-12-29T10:20:56.000000Z
    com.apple.quicktime.location.ISO6709: +01.3602+103.9897+024.438/
    com.apple.quicktime.make: Apple
    com.apple.quicktime.model: iPhone 11
    com.apple.quicktime.software: 13.3
    com.apple.quicktime.creationdate: 2019-12-29T18:20:56+0800
  Duration: 00:00:09.00, start: 0.000000, bitrate: 24882 kb/s
    Stream #0:0(und): Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 3840x2160, 24659 kb/s, 29.99 fps, 29.97 tbr, 600 tbn, 600 tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2019-12-29T10:20:56.000000Z
      handler_name    : Core Media Video
      encoder         : HEVC
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      creation_time   : 2019-12-29T10:20:56.000000Z
      handler_name    : Core Media Audio
    Stream #0:2(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2019-12-29T10:20:56.000000Z
      handler_name    : Core Media Metadata
    Stream #0:3(und): Data: none (mebx / 0x7862656D), 0 kb/s (default)
    Metadata:
      creation_time   : 2019-12-29T10:20:56.000000Z
      handler_name    : Core Media Metadata
    Stream #0:4(und): Data: none (mebx / 0x7862656D), 17 kb/s (default)
    Metadata:
      creation_time   : 2019-12-29T10:20:56.000000Z
      handler_name    : Core Media Metadata


    



    ffmpeg -i out.mov
ffmpeg version 4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.2.2_2 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'out.mov':
  Metadata:
    major_brand     : qt  
    minor_version   : 512
    compatible_brands: qt  
    encoder         : Lavf58.29.100
  Duration: 00:00:09.00, start: 0.000000, bitrate: 24860 kb/s
    Stream #0:0: Video: hevc (Main) (hvc1 / 0x31637668), yuv420p(tv, bt709), 3840x2160, 24659 kb/s, 29.99 fps, 29.97 tbr, 19200 tbn, 19200 tbc (default)
    Metadata:
      rotate          : 90
      handler_name    : Core Media Video
      encoder         : HEVC
    Side data:
      displaymatrix: rotation of -90.00 degrees
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 192 kb/s (default)
    Metadata:
      handler_name    : Core Media Audio


    



    If I open out.mov in QuickTime and do a trim and export it, then it it still "broken", so I'm thinking there's nothing wrong with the actual muxing into MOV, because QuickTime is passing the error on.

    



    I noticed that out.mov has different parameters 19200 tbn, 19200 tbc (vs original 600 tbn, 600 tbc). However, if I force set these to 600 with -video_track_timescale 600 the output file is still broken.

    



    Anyone got some insights ?