Recherche avancée

Médias (0)

Mot : - Tags -/interaction

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

Autres articles (106)

  • Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs

    12 avril 2011, par

    La manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
    Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.

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

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

Sur d’autres sites (5141)

  • FFmpeg memory leak

    10 septembre 2015, par Spamdark

    I have developed just a simple library modifing a library that I found on the internet.

    What scares me, is that, when I play an avi, it plays and free the memory when the video ends, but when I play the video, it’s like a memory leak ! It grows to 138mb although the video has ended and the FreeAll method (A function that deletes the context, etc...) has been called.

    Here is the code of the method that is causing the memory leak :

    int VideoGL::NextVideoFrame(){
    int frameDone = 0;
    int result = 0;
    double pts = 0;

    if(!this->ended){

    if (!_started) return 0;
    AVPacket* packet;

    // Get the number of milliseconds passed and see if we should display a new frame
    int64_t msPassed = (1000 * (clock() - _baseTime)) / CLOCKS_PER_SEC;
    if (msPassed >= _currentPts)
    {
       // If this is not the current frame, copy it to the buffer
       if (_currentFramePts != _currentPts){
           _currentFramePts = _currentPts;
           memcpy(buffer_a,buffer, 3 * _codec_context_video->width * _codec_context_video->height);
           result = 1;
       }

       // Try to load a new frame from the video packet queue
       bool goodop=false;
       AVFrame *_n_frame = avcodec_alloc_frame();
       while (!frameDone && (packet = this->DEQUEUE(VIDEO)) != NULL)
       {
           if (packet == (AVPacket*)-1) return -1;

           goodop=true;

           _s_pts = packet->pts;
           avcodec_decode_video2(_codec_context_video, _n_frame, &frameDone, packet);
           av_free_packet(packet);

           if (packet->dts == AV_NOPTS_VALUE)
           {
               if (_n_frame->opaque && *(uint64_t*)_n_frame->opaque != AV_NOPTS_VALUE) pts = (double) *(uint64_t*)_n_frame->opaque;
               else pts = 0;
           }
           else pts = (double) packet->dts;

           pts *= av_q2d(_codec_context_video->time_base);

       }

       if (frameDone)
       {
           // if a frame was loaded scale it to the current texture frame buffer, but also set the pts so that it won't be copied to the texture until it's time
           sws_scale(sws_ctx,_n_frame->data, _n_frame->linesize, 0, _codec_context_video->height, _rgb_frame->data, _rgb_frame->linesize);


           double nts = 1.0/av_q2d(_codec_context_video->time_base);
           _currentPts = (uint64_t) (pts*nts);

       }

       avcodec_free_frame(&_n_frame);
       av_free(_n_frame);

       if(!goodop){
           ended=true;
       }
    }
    }

    return result;
    }

    I’ll be waiting for answers, thanks.

  • Ffmpeg : how to keep orientation when trimming video file ?

    7 mars 2013, par Alex

    I have a video file which I capture from my Android program and save as an mp4 video.

    In this my Android program I use

    setOrientationHint(90)

    call to indicate to a videoplayer that my camera has been rotated 90 degrees.

    I'm not really sure what setOrientationHint(90) does but with it I can see the file properly oriented when it plays in the video player. If not, then a video player orients my file incorrectly.

    Now I trim this file using FFMPEG command (here in.mp4, out.mp4, 1000 and 2000 are just for example)

    ffmpeg -i in.mp4 -ss 1000 -t 2000 -vcodec copy -acodec

    However, the resulting file is again wrongly oriented in the player.

    I wonder what should I do to keep the orientation hint in the trimmed video file ?

  • ffmpeg ffserver - create a mosaic from two 720p webcam feeds

    28 juillet 2015, par der_felix

    for a project i would like to take the video feeds (NO audio) of two logitech c920 webcams, put them side-by-side and stream them.
    the c920 is able to compress the video feed with h264 itself(if enabled) and delivers 1080p with upto 30fps.
    the stream is then loaded in an android app by a ffmpeg library and rendered to the screen.

    what i already know :
    i know that i can take multiple streams or input files and create a mosaic stream via the filter_complex module.
    http and h264 seem to be good for streaming, but other configurations are also welcom if they are faster/better.

    the question :
    but how can i start the cameras with v4l2, set the camera resoltution and camera internal encoding and use these streams to create the mosaic ?
    the mosaic should be unscaled (=2560x720px).

    and i very often get the error code 256 but didnt find a solution what it means.

    the system : laptop with usb3, ubuntu 15.04x64 ffmpeg 2.7.1 and ffserver 2.5.7

    thanks for your help

    ffserver config :

    HTTPPort 8080                
    HTTPBindAddress 0.0.0.0      
    MaxHTTPConnections 2000  
    MaxClients 1000        
    MaxBandwidth 50000
    CustomLog -      
    #NoDaemon      

    <feed>        

    File /tmp/feed1.ffm
    Launch ffmpeg -f v4l2 - input_format h264 -i /dev/video0 -i /dev/video1 -size 1280x720 -r 30 -filter_complex "nullsrc=size=2560x720 [base]; [0:v] setpts=PTS-STARTPTS [left]; [1:v] setpts=PTS-STARTPTS [right]; [base][left] overlay=shortest=1 [tmp1]; [tmp1][right] overlay=shortest=1:x=1280"  -c:v libx264 -f mpegts

    </feed>

    <stream>

    Feed feed1.ffm
    Format mpegts      
    VideoBitRate 1024  
    #VideoBufferSize 1024
    VideoFrameRate 30      
    #VideoSize hd720      
    VideoSize 2560x720
    #VideoIntraOnly        
    #VideoGopSize 12      
    VideoCodec libx264      
    NoAudio            
    VideoQMin 3        
    VideoQMax 31
    NoDefaults

    </stream>

    <stream>        
      Format status
      #Only allow local people to get the status
      ACL allow localhost
      ACL allow 192.168.0.0 192.168.255.255
    </stream>

    output :

    ubuntu@ubuntu:~$ ffserver
    ffserver version 2.5.7-0ubuntu0.15.04.1 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
     configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Tue Jul 28 10:13:44 2015 FFserver started.
    Tue Jul 28 10:13:44 2015 Launch command line: ffmpeg -f v4l2 - input_format h264 -i /dev/video0 -i /dev/video1 -size 1280x720 -r 30 -filter_complex nullsrc=size=2560x720 [base]; [0:v] setpts=PTS-STARTPTS [left]; [1:v] setpts=PTS-STARTPTS [right]; [base][left] overlay=shortest=1 [tmp1]; [tmp1][right] overlay=shortest=1:x=1280 -c:v libx264 -f mpegts http://127.0.0.1:8080/feed1.ffm
    feed1.ffm: Pid 17388 exited with status 256 after 0 seconds

    Hey guys !

    Here is our plan b for the mosaic stream.

    Alternative config :

    HTTPPort 8080        
    HTTPBindAddress 0.0.0.0  
    MaxHTTPConnections 2000  
    MaxClients 1000        
    MaxBandwidth 50000      
    CustomLog -        

    <feed>
    File /tmp/feedlinks.ffm
    Launch ffmpeg -f v4l2 -input_format h264 -vcodec h264 -i /dev/video0 -video_size 1280x720 -r 30
    </feed>

    <feed>
    File /tmp/feedrechts.ffm
    Launch ffmpeg -f v4l2 -input_format h264 -vcodec h264 -i /dev/video1 -video_size 1280x720 -r 30
    </feed>

    <stream>
    Feed feedlinks.ffm
    Format mpegts
    VideoBitRate 512
    VideoFrameRate 30
    VideoSize hd720
    VideoCodec libx264
    NoAudio
    VideoQMin 3
    VideoQMax 31
    </stream>

    <stream>
    Feed feedrechts.ffm
    Format mpegts
    VideoBitRate 512
    VideoFrameRate 30
    VideoSize hd720
    VideoCodec libx264
    NoAudio
    VideoQMin 3
    VideoQMax 31
    </stream>

    <feed>
    File /tmp/feedmosaic.ffm
    Launch ffmpeg -i http://localhost:8080/testlinks.mpg -i http://localhost:8080/testrechts.mpg -filter_complex "nullsrc=size=2560x720 [base]; [0:v] setpts=PTS-STARTPTS [left]; [1:v] setpts=PTS-STARTPTS [right]; [base][left] overlay=shortest=1 [tmp1]; [tmp1][right] overlay=shortest=1:x=1280" -c:v libx264 -preset ultrafast -f mpegts
    </feed>

    <stream>
    Feed feedmosaic.ffm
    Format mpegts         # Format of the stream
    VideoFrameRate 30      # Number of frames per second
    VideoSize 2560x720
    VideoCodec libx264      # Choose your codecs.
    NoAudio            # Suppress audio
    VideoQMin 3         # Videoquality ranges from 1 - 31 (worst to best)
    VideoQMax 31
    NoDefaults
    </stream>

    <stream>           # Server status URL
      Format status
      # Only allow local people to get the status
      ACL allow localhost
      ACL allow 192.168.0.0 192.168.255.255
      ACL allow 192.168.178.0 192.168.255.255
    </stream>

    And this is the new output :

    ubuntu@ubuntu:~$ ffserver
    ffserver version 2.5.7-0ubuntu0.15.04.1 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
     configuration: --prefix=/usr --extra-version=0ubuntu0.15.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libwavpack --enable-libwebp --enable-libxvid --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libvpx --enable-libx264 --enable-libsoxr --enable-gnutls --enable-openal --enable-libopencv --enable-librtmp --enable-libx265
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    /etc/ffserver.conf:44: Setting default value for video bit rate tolerance = 128000. Use NoDefaults to disable it.
    /etc/ffserver.conf:44: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
    /etc/ffserver.conf:44: Setting default value for video max rate = 1024000. Use NoDefaults to disable it.
    /etc/ffserver.conf:44: Setting default value for video buffer size = 1024000. Use NoDefaults to disable it.
    /etc/ffserver.conf:61: Setting default value for video bit rate tolerance = 128000. Use NoDefaults to disable it.
    /etc/ffserver.conf:61: Setting default value for video rate control equation = tex^qComp. Use NoDefaults to disable it.
    /etc/ffserver.conf:61: Setting default value for video max rate = 1024000. Use NoDefaults to disable it.
    /etc/ffserver.conf:61: Setting default value for video buffer size = 1024000. Use NoDefaults to disable it.
    Tue Jul 28 11:13:01 2015 Codec bitrates do not match for stream 0
    Tue Jul 28 11:13:01 2015 FFserver started.
    Tue Jul 28 11:13:01 2015 Launch command line: ffmpeg -f v4l2 -input_format h264 -vcodec h264 -i /dev/video0 -video_size 1280x720 -r 30 http://127.0.0.1:8080/feedlinks.ffm
    Tue Jul 28 11:13:01 2015 Launch command line: ffmpeg -f v4l2 -input_format h264 -vcodec h264 -i /dev/video1 -video_size 1280x720 -r 30 http://127.0.0.1:8080/feedrechts.ffm
    Tue Jul 28 11:13:01 2015 Launch command line: ffmpeg -i http://localhost:8080/testlinks.mpg -i http://localhost:8080/testrechts.mpg -filter_complex nullsrc=size=2560x720 [base]; [0:v] setpts=PTS-STARTPTS [left]; [1:v] setpts=PTS-STARTPTS [right]; [base][left] overlay=shortest=1 [tmp1]; [tmp1][right] overlay=shortest=1:x=1280 -c:v libx264 -preset ultrafast -f mpegts http://127.0.0.1:8080/feedmosaic.ffm
    Tue Jul 28 11:13:02 2015 127.0.0.1 - - [GET] "/feedlinks.ffm HTTP/1.1" 200 4175
    Tue Jul 28 11:13:02 2015 127.0.0.1 - - [GET] "/feedrechts.ffm HTTP/1.1" 200 4175
    Tue Jul 28 11:13:18 2015 127.0.0.1 - - [POST] "/feedmosaic.ffm HTTP/1.1" 200 4096
    Tue Jul 28 11:13:18 2015 127.0.0.1 - - [GET] "/testlinks.mpg HTTP/1.1" 200 2130291
    Tue Jul 28 11:13:18 2015 127.0.0.1 - - [GET] "/testrechts.mpg HTTP/1.1" 200 1244999
    feedmosaic.ffm: Pid 18775 exited with status 256 after 17 seconds

    Thanks for your help !