Recherche avancée

Médias (0)

Mot : - Tags -/configuration

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

Autres articles (26)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Contribute to documentation

    13 avril 2011

    Documentation is vital to the development of improved technical capabilities.
    MediaSPIP welcomes documentation by users as well as developers - including : critique of existing features and functions articles contributed by developers, administrators, content producers and editors screenshots to illustrate the above translations of existing documentation into other languages
    To contribute, register to the project users’ mailing (...)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

Sur d’autres sites (4460)

  • ffmpeg error loading shared OpenCV libraries

    19 septembre 2017, par chronosynclastic

    I installed FFmpeg 3.3 from a PPA repository following the guide here. I already have OpenCV 3.3 installed on my Ubuntu 16.04 system with all the necessary libraries under /usr/local/lib. However, when I try to run ffmpeg, I get the error :

    ffmpeg: error while loading shared libraries:
    libopencv_core.so.2.4: cannot open shared object file: No such file or directory

    Does FFmpeg only work with OpenCV 2.4 libraries ? I have the corresponding library for OpenCV under /usr/local/lib/libopencv_core.so.3.3 but somehow FFmpeg looks for the version 2.4.

  • Noise when decoding mp3 using libavcodec on iOS

    11 janvier 2014, par Trenskow

    I have this methods. It first sets up an audio input if necessary. Then it reads a frame, and returns the frame converted using an AudioConverterRef (wrapped in an KFInlineConverterUnit class) to my Core Audio graph. At the end of the method it tears down the input, if audio output has stopped.

    - (NSData *)readNextChunk {

       /* Setup audio input */
       if (_formatContext == NULL && self.runLoopActive) {

           static dispatch_once_t onceToken;
           dispatch_once(&onceToken, ^{
               av_register_all();
           });

           avformat_network_init();

           av_init_packet(&_packet);

           _formatContext = avformat_alloc_context();

           [self handleError:avformat_open_input(&_formatContext, [[_url absoluteString] cStringUsingEncoding:NSUTF8StringEncoding], NULL, NULL)];

           [self handleError:avformat_find_stream_info(_formatContext, NULL)];

           _audioStreamIndex = -1;
           for (NSInteger index = 0 ; index < _formatContext->nb_streams ; index++)
               if (_formatContext->streams[index]->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
                   _audioStreamIndex = index;
                   break;
               }

           if (_audioStreamIndex > -1) {

               _codec = avcodec_find_decoder(_formatContext->streams[_audioStreamIndex]->codec->codec_id);

               _codecContext = _formatContext->streams[_audioStreamIndex]->codec;

               [self handleError:avcodec_open2(_codecContext, _codec, NULL)];

           }

           if (self.timeOffset > .0) {
               int64_t timestamp = AV_TIME_BASE * self.timeOffset;
               av_seek_frame(_formatContext, -1, timestamp, AVSEEK_FLAG_ANY);
           }

       }

       /* Read and decode next frame */

       NSData *chunk = nil;        
       AVFrame *frame = avcodec_alloc_frame();
       while (self.runLoopActive && _formatContext != NULL && av_read_frame(_formatContext, &_packet) >= 0) {

           if (_packet.stream_index == _audioStreamIndex) {

               int gotFrame = 0;
               int len = avcodec_decode_audio4(_codecContext, frame, &gotFrame, &_packet);
               [self handleError:len];

               if (gotFrame) {

                   /* Setup a converter for my Audio Graph */
                   AudioStreamBasicDescription inputAudioDescription = [self audioDescriptionForCodecContext];

                   if (!_converter || memcmp(&inputAudioDescription, _converter.inputAudioDescription, sizeof(AudioStreamBasicDescription)) != 0)
                       _converter = [KFInlineConverterUnit newWithInputAudioDescription:inputAudioDescription
                                                                 outputAudioDescription:self.audioDescription];

                   /* Convert frames */
                   if (inputAudioDescription.mFormatFlags & kAudioFormatFlagIsNonInterleaved) {
                       NSMutableArray *buffers = [@[] mutableCopy];
                       for (NSInteger i = 0 ; i < frame->channels ; i++) {
                           [buffers addObject:[NSData dataWithBytes:frame->data[i] length:frame->nb_samples * inputAudioDescription.mBytesPerFrame]];
                       }
                       chunk = [_converter convertBuffer:buffers];
                   } else
                       chunk = [_converter convertBuffer:@[[NSData dataWithBytes:frame->data[0] length:frame->nb_samples * inputAudioDescription.mBytesPerFrame]]];

                   if (_packet.data != NULL)
                       av_free_packet(&_packet);

                   break;

               }

           }

       }

       avcodec_free_frame(&frame);

       /* Tear down if output has stopped */
       if (!self.runLoopActive) {

           avformat_free_context(_formatContext);
           _formatContext = NULL;

           avformat_network_deinit();

       }

       return chunk;

    }

    Basically everything is fine. I am developing this for iOS, and when I test it in the iOS Simulator everything works smoothly. It plays all audio formats with no problems.

    The problem arises, when I run the code on an actual device. Then mp3 files are audible - but VERY distorted. I have tried everything in my mind to make this work, but I cannot figure what's going wrong.

    I can say that the problem does NOT lay in the converter. I've extracted the audio before it hits the decoder, and it sounds the same. So the converter just converts the distorted audio. So I think it might be an MP3 decoder issue.

    Anyone experienced this before ?

  • Streaming converted movie with mp4 container in NodeJS, movie playing very fast

    20 septembre 2016, par Mustafa

    I have used stream-transcoder module to convert a file make it a stream. So the file is not stored, it is on the fly.

    app.get("/video", function(req,res){
       res.writeHead(200, {'Content-Type': 'video/mp4'});
       var src = "movie.avi";

       var Transcoder = require('stream-transcoder');
       var stream = fs.createReadStream(src);
       new Transcoder(stream)
           .maxSize(1280, 720)
           .videoCodec('h264')
           .videoBitrate(800 * 1000)
           .fps(25)
           .sampleRate(44100)
           .channels(2)
           .audioBitrate(128 * 1000)
           .format('mp4')
           .on('finish', function() {
               console.log("finished");
           })
           .stream().pipe(res);
    });

    It works nicely, it is fast, but too fast, the audio is played at the same speed, however the video does not respect the frame rate, whatever is recieved from ffmpeg is immeidately shown, fastly. Additionally, it does not show the total time, I believe it is the problem. I need to somehow specify the length, framerate, but I could not find enough information on that. I thought the stream recieved from ffmpeg should contain that. And I could not find respective headers for that in HTTP.

    Here are the flags that this stream-transcoder module uses for MP4 :

    [ '-i',
     '-',
     '-vf',
     'scale=min(trunc(1280/hsub)*hsub\\,trunc(a*720/hsub)*hsub):min(trunc(720/vsub)*vsub\\,trunc(1280/a/vsub)*vsub)',
     '-vcodec',
     'h264',
     '-b:v',
     800000,
     '-r',
     25,
     '-ar',
     44100,
     '-ac',
     2,
     '-ab',
     128000,
     '-f',
     'mp4',
     '-movflags',
     'frag_keyframe+faststart',
     'pipe:1' ]

    When I use VP8 encoder and WebM, it works nicely, the time is displayed, video plays normal speed.