Recherche avancée

Médias (91)

Autres articles (61)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Submit bugs and patches

    13 avril 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

Sur d’autres sites (3453)

  • C++/OpenCV - VideoCapture doesn't work but it worked before with exactly the same code

    5 mars 2015, par Damià Obrador

    I’m trying to write a shot boundary detection algorithm in C++ using OpenCV. After all, I have to say that I have no experience working with OpenCV.

    I have been improving the following code (and I am still in it) during the last two weeks and everything seems the works correctly, not in terms of perfect shot detection, but every line of code did what was expected from it.

    #include <cstdlib>
    #include <opencv2></opencv2>opencv.hpp>
    #include <opencv2></opencv2>core/core.hpp>
    #include <opencv2></opencv2>video/background_segm.hpp>
    #include <opencv2></opencv2>highgui/highgui.hpp>
    #include <iostream>
    #include <opencv2></opencv2>imgproc/imgproc.hpp>
    #include
    #include <istream>
    #include <fstream>
    using namespace cv;



    int main(){

       VideoCapture capture("vdevendetta.mp4");
       if ( !capture.isOpened() )
        {
            std::cout &lt;&lt; "Cannot open the video file";
            return -1;
        }
       int numFrames=capture.get(CV_CAP_PROP_FRAME_COUNT);
       bool SB_counter=false;
       Mat currentFrame;
       Mat frame;
       Mat fore;
       Mat back;
       vector<mat> frames;
       FileStorage file;
       FileStorage file2;
       Mat prev_Y;
       Mat channels[3];
       for(int i=0;i>currentFrame;
               frame=currentFrame.clone();
               cvtColor(frame,frame,CV_BGR2YUV);
               split( frame, channels );
               prev_Y=channels[0];
               SB_counter=false;
           }
           else
           {
               capture>>currentFrame;
               frame=currentFrame.clone();
               Mat channels[3];
               cvtColor(frame,frame,CV_BGR2YUV);
               split( frame, channels );
               Mat curr_Y=channels[0];
               channels[0]=prev_Y;
               prev_Y=curr_Y;
               merge(channels,3,frame);
               cvtColor(frame,frame,CV_Luv2BGR);
               cvtColor(frame,frame,CV_BGR2GRAY);
               frames.push_back(frame);
           }

       }

       vector<double> MAFDs;
       vector<double> MAFD;
       vector<double> aux;
       double min;
       double min2;

       for(int j=1;j14)
           {
               std::cout&lt;&lt;"De"&lt;*
       std::ofstream fout("MAFD.txt");
       if(fout.is_open()==true)
       {
         //file opened successfully so we are here
         std::cout &lt;&lt; "File Opened successfully!!!. Writing data from array to file" &lt;&lt; std::endl;

           for(int i = 0; MAFD[i] != '\0'; i++)
           {
           fout &lt;&lt; MAFD[i]; //writing ith character of array in the file
           }
         std::cout &lt;&lt; "Array data successfully saved into the file test.txt" &lt;&lt; std::endl;
       }
       else //file could not be opened
       {
           std::cout &lt;&lt; "File could not be opened." &lt;&lt; std::endl;
       }*/
       return 0;
    }
    </double></double></double></mat></fstream></istream></iostream></cstdlib>

    Three days ago I had an strange problem. The line :

    VideoCapture capture("vdevendetta.mp4");

    stopped working. I spent many hours looking for the solution but nothing seems to repair it. After reading everything related with OpenCV, VideoCapture and ffmpeg that I found on internet I decided to reinstall everything taking care of each detail, but it still didn’t work. Finally I solved it changing the line with this other one :

    VideoCapture capture("/home/damia/Documentos/Universitat/ARA/PAEAV/workspace_cpp/SBD/src/vdevendetta.mp4");

    I did not know why this solved it because the video is in the same directory than the program, but I continued working because everything seemed correct.
    Today I had the same problem again on the new line.
    The terminal doesn’t show any error comment (exceptuating "Cannot open the video file", obviously) but the code doesn’t work again.

    I’m using Ubuntu 14.04 LTS, OpenCV 2.4.9 and Eclipse.

    I think if someone test the code it will run correctly, but I would like to know if there is something I have no taking into account.

    Thank you very match.

  • ffmpeg : images to 29.97fps mpeg2, audio not sync [migrated]

    21 novembre 2011, par Andy Le

    I have spent a lot of time on this issue. Hope someone can help.

    I want to convert 3147 images + ac3 audio file into an mpeg2 video at 29.97fps (about 1m45s). My command :

    ~/ffmpeg/ffmpeg/ffmpeg -loop_input -t 105 -i v%4d.tga -i final.ac3 -vcodec mpeg2video -qscale 1 -s 400x400 -r 30000/1001 -acodec copy -y out.mpeg 2> out.txt

    However, the audio file ends before the frame sequence. Which means the video is slower then audio.

    I checked the output file with imageinfo and see :

    General
    Complete name                    : out.mpeg
    Format                           : MPEG-PS
    File size                        : 7.18 MiB
    Duration                         : 1mn 44s
    Overall bit rate                 : 574 Kbps

    Video
    ID                               : 224 (0xE0)
    Format                           : MPEG Video
    Format version                   : Version 2
    Format profile                   : Main@Main
    Format settings, BVOP            : No
    Format settings, Matrix          : Default
    Format_Settings_GOP              : M=1, N=12
    Duration                         : 1mn 44s
    Bit rate mode                    : Variable
    Bit rate                         : 103 Kbps
    Width                            : 400 pixels
    Height                           : 400 pixels
    Display aspect ratio             : 1.000
    Frame rate                       : 29.970 fps
    Resolution                       : 8 bits
    Colorimetry                      : 4:2:0
    Scan type                        : Progressive
    Bits/(Pixel*Frame)               : 0.021
    Stream size                      : 1.29 MiB (18%)

    Audio
    ID                               : 128 (0x80)
    Format                           : AC-3
    Format/Info                      : Audio Coding 3
    Duration                         : 1mn 44s
    Bit rate mode                    : Constant
    Bit rate                         : 448 Kbps
    Channel(s)                       : 6 channels
    Channel positions                : Front: L C R, Side: L R, LFE
    Sampling rate                    : 44.1 KHz
    Stream size                      : 5.61 MiB (78%)

    The log from ffmpeg shows many duplicate frames. But I don't know how to get rid of that.

    -loop_input is deprecated, use -loop 1
    [image2 @ 0x9c17a80] max_analyze_duration 5000000 reached at 5000000
    Input #0, image2, from &#39;v%4d.tga&#39;:
     Duration: 00:02:05.88, start: 0.000000, bitrate: N/A
       Stream #0:0: Video: targa, bgr24, 400x400, 25 fps, 25 tbr, 25 tbn, 25 tbc
    -loop_input is deprecated, use -loop 1
    [ac3 @ 0x9ca5420] max_analyze_duration 5000000 reached at 5014400
    [ac3 @ 0x9ca5420] Estimating duration from bitrate, this may be inaccurate
    Input #1, ac3, from &#39;Final.ac3&#39;:
     Duration: 00:20:10.68, start: 0.000000, bitrate: 447 kb/s
       Stream #1:0: Audio: ac3, 44100 Hz, 5.1(side), s16, 448 kb/s
    Incompatible pixel format &#39;bgr24&#39; for codec &#39;mpeg2video&#39;, auto-selecting format &#39;yuv420p&#39;
    [buffer @ 0x9c1e060] w:400 h:400 pixfmt:bgr24 tb:1/1000000 sar:0/1 sws_param:
    [buffersink @ 0x9dd56c0] auto-inserting filter &#39;auto-inserted scale 0&#39; between the filter &#39;src&#39; and the filter &#39;out&#39;
    [scale @ 0x9c178e0] w:400 h:400 fmt:bgr24 -> w:400 h:400 fmt:yuv420p flags:0x4
    [mpeg @ 0x9d58060] VBV buffer size not set, muxing may fail
    Output #0, mpeg, to &#39;out.mpeg&#39;:
     Metadata:
       encoder         : Lavf53.21.0
       Stream #0:0: Video: mpeg2video, yuv420p, 400x400, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
       Stream #0:1: Audio: ac3, 44100 Hz, 5.1(side), 448 kb/s
    Stream mapping:
     Stream #0:0 -> #0:0 (targa -> mpeg2video)
     Stream #1:0 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame=  267 fps=  0 q=1.0 size=     564kB time=00:00:08.87 bitrate= 520.6kbits/s dup=43 drop=0    
    frame=  544 fps=542 q=1.0 size=    1186kB time=00:00:18.11 bitrate= 536.2kbits/s dup=89 drop=0    
    frame=  821 fps=546 q=1.0 size=    1818kB time=00:00:27.36 bitrate= 544.3kbits/s dup=135 drop=0    
    frame= 1098 fps=548 q=1.0 size=    2444kB time=00:00:36.60 bitrate= 547.0kbits/s dup=181 drop=0    
    frame= 1376 fps=549 q=1.0 size=    3072kB time=00:00:45.87 bitrate= 548.5kbits/s dup=227 drop=0    
    frame= 1653 fps=550 q=1.0 size=    3700kB time=00:00:55.12 bitrate= 549.9kbits/s dup=273 drop=0    
    frame= 1930 fps=550 q=1.0 size=    4326kB time=00:01:04.36 bitrate= 550.6kbits/s dup=319 drop=0    
    frame= 2208 fps=551 q=1.0 size=    4960kB time=00:01:13.64 bitrate= 551.8kbits/s dup=365 drop=0    
    frame= 2462 fps=546 q=1.0 size=    5746kB time=00:01:22.11 bitrate= 573.2kbits/s dup=407 drop=0    
    frame= 2728 fps=544 q=1.0 size=    6354kB time=00:01:30.99 bitrate= 572.1kbits/s dup=451 drop=0    
    frame= 3007 fps=545 q=1.0 size=    6980kB time=00:01:40.28 bitrate= 570.2kbits/s dup=498 drop=0    
    frame= 3146 fps=546 q=1.0 Lsize=    7352kB time=00:01:44.93 bitrate= 573.9kbits/s dup=521 drop=0    

    video:1518kB audio:5745kB global headers:0kB muxing overhead 1.230493%
  • How can i create a portrait video using Android's MediaRecorder

    23 mars 2015, par urudroid

    I have an Android application which is able to record and play a videos in portrait mode, those features are working fine on Android phones.

    The issue comes up because this video is needed to be played also on iOS devices (after being shared through a server).

    iOS is not correctly showing the video as it looks "cropped", but videos recorded on iOS are played without issues.

    So, the main difference between videos created on Android and iOS’ is the size and the rotation.

    Im using CWAC-Camera library for preview and recording and ffmpeg to scale the video down to 320x568px (as this is the standard size for both Android and iOS apps).

    Here is the metadata from an video created from Android :

    General
    Complete name                            : android_video.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 447 KiB
    Duration                                 : 5s 596ms
    Overall bit rate                         : 654 Kbps
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00
    Writing application                      : Lavf56.4.101

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : High@L2.1
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 5s 406ms
    Bit rate                                 : 536 Kbps
    Width                                    : 568 pixels
    Height                                   : 320 pixels
    Display aspect ratio                     : 16:9
    Original display aspect ratio            : 16:9
    Rotation                                 : 270°
    Frame rate mode                          : Constant
    Frame rate                               : 14.985 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.197
    Stream size                              : 354 KiB (79%)
    Writing library                          : x264 core 142
    Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=14 / 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.40 / aq=1:1.00
    Language                                 : English
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00

    Audio
    ID                                       : 2
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 5s 596ms
    Bit rate mode                            : Constant
    Bit rate                                 : 132 Kbps
    Channel(s)                               : 2 channels
    Channel(s)_Original                      : 1 channel
    Channel positions                        : Front: C
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 89.4 KiB (20%)
    Language                                 : English
    Encoded date                             : UTC 1904-01-01 00:00:00
    Tagged date                              : UTC 1904-01-01 00:00:00

    And here is the metadata from the video created on iOS :

    General
    Complete name                            : ios_video.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media / Version 2
    Codec ID                                 : mp42
    File size                                : 673 KiB
    Duration                                 : 7s 38ms
    Overall bit rate                         : 783 Kbps
    Encoded date                             : UTC 2015-03-17 19:16:36
    Tagged date                              : UTC 2015-03-17 19:16:37

    Video
    ID                                       : 2
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L3.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 2 frames
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 7s 33ms
    Bit rate                                 : 711 Kbps
    Width                                    : 320 pixels
    Height                                   : 568 pixels
    Display aspect ratio                     : 0.563
    Frame rate mode                          : Constant
    Frame rate                               : 30.000 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.130
    Stream size                              : 610 KiB (91%)
    Title                                    : Core Media Video
    Encoded date                             : UTC 2015-03-17 19:16:36
    Tagged date                              : UTC 2015-03-17 19:16:37
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709
    Color range                              : Limited

    Audio
    ID                                       : 1
    Format                                   : AAC
    Format/Info                              : Advanced Audio Codec
    Format profile                           : LC
    Codec ID                                 : 40
    Duration                                 : 7s 38ms
    Source duration                          : 7s 105ms
    Bit rate mode                            : Constant
    Bit rate                                 : 64.0 Kbps
    Channel(s)                               : 2 channels
    Channel(s)_Original                      : 1 channel
    Channel positions                        : Front: C
    Sampling rate                            : 44.1 KHz
    Compression mode                         : Lossy
    Stream size                              : 56.8 KiB (8%)
    Source stream size                       : 57.2 KiB (9%)
    Title                                    : Core Media Audio
    Encoded date                             : UTC 2015-03-17 19:16:36
    Tagged date                              : UTC 2015-03-17 19:16:37

    The values width and height are inverted on Android, also the Rotation parameter is set to 270º (this is the rotation parameter for portrait videos).

    This is a sketch of how iOS’ videos look on iOS app :

    Videos recorded on iOS

    And this is how Android’s videos look on iOS app :

    enter image description here

    So, in order to get the videos correctly displayed both on iOS and Android i need to be able to set the width to 320 and height to 568 on Android. I tried it from several places (outside and inside CWAC-Camera library) but i always get a Camera.Parameters error.

    It is possible to do this on Android ?

    EDIT :

    This is the result i get when i set the rotation to 0 with ffmpeg :

    enter image description here