Recherche avancée

Médias (1)

Mot : - Tags -/école

Autres articles (74)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (5676)

  • FFprobe analysis of HLS chunks duration

    23 mars 2017, par Georgе Stoyanov

    I am writing a script for analysis of HLS streams. The problem is that when I run it on some specific streams the duration is missing from the format block. It shows

       "format": {
           "filename": "http://example.com/Content/HLS/Live/index.m3u8",
           "nb_streams": 7,
           "nb_programs": 5,
           "format_name": "hls,applehttp",
           "format_long_name": "Apple HTTP Live Streaming",
           "start_time": "71900.703522",
           "size": "1030",
           "probe_score": 100
       }

    I tried to run the same command on the main manifest file, on the profile manifest file and on the chunk itself but I am getting :

    Duration : N/A

    So now I was thinking is it possible to define that the ffprobe has to analyze only one chunk because I can get the duration from the number of the frames divided by the frame rate of the profile.

  • OSError : [Errno 13] Permission denied when running python code called extract.py

    26 avril 2017, par aisunshinehui

    ffmpeg.py :

    def resize(videoName, resizedName):
       if not os.path.exists(videoName):
         print '%s does not exist!' % videoName
         return False
       # call ffmpeg and grab its stderr output
       p = subprocess.Popen([ffmpeg, "-i", videoName],stderr=subprocess.PIPE)
       out, err = p.communicate()
       # search resolution info
       if err.find('differs from') > -1:
         return False
       reso = re.findall(r'Video.*, ([0-9]+)x([0-9]+)', err)
       if len(reso) < 1:
          return False
       # call ffmpeg again to resize
       subprocess.call([ffmpeg, '-i', videoName, '-s', '160 x 120', resizedName])
       return check(resizedName)

    # check the video file is corrupted or not
    def check(videoName):
        if not os.path.exists(videoName):
           return False
        p = subprocess.Popen([ffmpeg, "-i", videoName], stderr=subprocess.PIPE)
        out, err = p.communicate()
        if err.find('Invalid') > -1:
           return False
        return True

    extract.py :

    def extract(videoName, outputBase):
       if not os.path.exists(videoName):
           print '%s does not exist!' % videoName
           return False
       if check_dup(outputBase):
           print '%s processed' % videoName
           return True
       resizedName = os.path.join(tmpDir, os.path.basename(videoName))
       if not ffmpeg.resize(videoName, resizedName):
           resizedName = videoName     # resize failed, just use the input video
       subprocess.call('%s %s | %s %s %s %s' % (dtBin, resizedName, fvBin, pcaList, codeBookList, outputBase), shell=True)
       return True

    def check_dup(outputBase):
       """
       Check if fv of all modalities have been extracted
       """
       featTypes = ['traj', 'hog', 'hof', 'mbhx', 'mbhy']
       featDims = [20, 48, 54, 48, 48]
       for i in range(len(featTypes)):
           featName = '%s.%s.fv.txt' % (outputBase, featTypes[i])
           if not os.path.isfile(featName) or not os.path.getsize(featName) > 0:
               return False
           # check if the length of feature can be fully divided by featDims
           f = open(featName)
           featLen = len(f.readline().rstrip().split())
           f.close()
           if featLen % (featDims[i] * 512) > 0:
               return False
       return True

    i run the extract.py in the terminal and error occurred as follows,then add sudo and run chmod 777 -R /usr/lib/python2.7 to change the permission but it doesn`t work !

    aisunshinehui@aisunshinehui : /program/dtfv/script$ sudo python extract_fv.py /home/aisunshinehui/program/dtfv/script/videolist/video.txt

    /home/aisunshinehui/program/dtfv/script/output/ 1
    [sudo] password for aisunshinehui:
       0 /home/aisunshinehui/program/dtfv/script/videolist
     Traceback (most recent call last):
         File "extract_fv.py", line 63, in <module>
           extract(videos[i], outputName)
         File "extract_fv.py", line 27, in extract
           if not ffmpeg.resize(videoName, resizedName):
         File "/home/aisunshinehui/program/dtfv/script/ffmpeg.py", line 17, in resize
           p = subprocess.Popen([ffmpeg, "-i", videoName], stderr=subprocess.PIPE)
         File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
           errread, errwrite)
         File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
           raise child_exception
       OSError: [Errno 13] Permission denied
    </module>

    help me !

  • Lossless avi encoding on linux

    21 septembre 2022, par dlants

    I am trying to write video using opencv. It is important for me to do this precisely - so it has to be a lossless codec. I am working with OpenCV 2.4.1 on Ubuntu 12.04

    &#xA;&#xA;

    Previously, I was using the fourcc code 0. This gave me the exact result I wanted, and I was able to recover the images perfectly.

    &#xA;&#xA;

    I am not sure what happened, but as of a recent update (around Jul 20th 2012), something went wrong and I am no longer able to write files with this fourcc code. I really don't remember what it was, but it could have come from doing an update, removing some software from my software center, and some other things I did during general cleaning...

    &#xA;&#xA;

    When I check an older file with mediainfo (http://www.fourcc.org/identifier/) I see the following result :

    &#xA;&#xA;

    Complete name                            : oldsample.avi&#xA;Format                                   : AVI&#xA;Format/Info                              : Audio Video Interleave&#xA;Format profile                           : OpenDML&#xA;File size                                : 1.07 GiB&#xA;Duration                                 : 41s 467ms&#xA;Overall bit rate                         : 221 Mbps&#xA;Writing application                      : Lavf53.5.0&#xA;Video&#xA;ID                                       : 0&#xA;Format                                   : RGB&#xA;Codec ID                                 : 0x00000000&#xA;Codec ID/Info                            : Basic Windows bitmap format. 1, 4 and 8 bpp     versions are palettised. 16, 24 and 32bpp contain raw RGB samples&#xA;Duration                                 : 41s 467ms&#xA;Bit rate                                 : 221 Mbps&#xA;Width                                    : 640 pixels&#xA;Height                                   : 4294966 816 pixels&#xA;Display aspect ratio                     : 0.000&#xA;Frame rate                               : 30.000 fps&#xA;Bit depth                                : 8 bits&#xA;Stream size                              : 1.07 GiB (100%)&#xA;

    &#xA;&#xA;

    Now, I see that when I write using the 0 fourcc codec, the program actually defaults to the i420 codec. Here is the output from one of the files I try to write now :

    &#xA;&#xA;

    Complete name                            : newsample.avi&#xA;Format                                   : AVI&#xA;Format/Info                              : Audio Video Interleave&#xA;File size                                : 73.0 MiB&#xA;Duration                                 : 5s 533ms&#xA;Overall bit rate                         : 111 Mbps&#xA;Writing application                      : Lavf54.6.100&#xA;Video&#xA;ID                                       : 0&#xA;Format                                   : YUV&#xA;Codec ID                                 : I420&#xA;Codec ID/Info                            : 8 bit Y plane followed by 8 bit 2x2 subsampled U and V planes.&#xA;Duration                                 : 5s 533ms&#xA;Bit rate                                 : 111 Mbps&#xA;Width                                    : 640 pixels&#xA;Height                                   : 480 pixels&#xA;Display aspect ratio                     : 4:3&#xA;Frame rate                               : 30.000 fps&#xA;Compression mode                         : Lossless&#xA;Bits/(Pixel*Frame)                       : 12.000&#xA;Stream size                              : 72.9 MiB (100%)&#xA;

    &#xA;&#xA;

    This format, and other formats I try to use (like huffyuv HFYU), do not work for me because I end up with effects like this http://imgur.com/a/0OC4y - you see the bright artifacts coming in due to what I assume is either lossy compression or chroma subsampling in the case of HFYU which is supposed to be lossless. What you are looking at is the red channel from one of my videos. The perceptual effect is negligible when you look at all 3 channels simultaneously but it is essential that I reconstruct the images exactly.

    &#xA;&#xA;

    Furthermore, while I am able to play my old files in media players like vlc, I suddenly find them to be completely incompatible with opencv. When I try to open the older files with a videocapture, the open step works fine, but trying to do a read operation results in a segfault. Furthermore, When I try to write with either :

    &#xA;&#xA;

    CV_FOURCC(0,0,0,0)&#xA;0&#xA;

    &#xA;&#xA;

    Opencv defaults to I420 for some reason.

    &#xA;&#xA;

    Next, I tried using some alternate codecs. 'DIB ' seems like something that should work for me, and on the opencv website (http://opencv.willowgarage.com/wiki/VideoCodecs) it is listed as a 'recommended' codec. However, trying to use this results in the following message :

    &#xA;&#xA;

    OpenCV-2.4.1/modules/highgui/src/cap_gstreamer.cpp:483: error: (-210) Gstreamer Opencv backend doesn&#x27;t support this codec acutally. in function CvVideoWriter_GStreamer::open&#xA;&#xA;Aborted (core dumped)&#xA;

    &#xA;&#xA;

    I checked the opencv source for this codec, and stumbled across the following :

    &#xA;&#xA;

    cd OpenCV-2.4.1/modules&#xA;grep -i -r "CV_FOURCC" ./*&#xA;...&#xA;./highgui/src/cap_qt.cpp:    /*if( fourcc == CV_FOURCC( &#x27;D&#x27;, &#x27;I&#x27;, &#x27;B&#x27;, &#x27; &#x27; ))&#xA;./highgui/include/opencv2/highgui/highgui_c.h:#define CV_FOURCC_DEFAULT CV_FOURCC(&#x27;I&#x27;, &#x27;Y&#x27;, &#x27;U&#x27;, &#x27;V&#x27;) /* Use default codec for specified filename (Linux only) */&#xA;

    &#xA;&#xA;

    I tried installing qt4 and reconfiguring with the WITH_QT flag, but that did not change anything. I also tried uncommenting that part of the code and reinstalling opencv, but that also did not work.

    &#xA;&#xA;

    My ultimate goal is for any way to efficiently store and retrieve a video stream with 16 bits for every pixel (like 32float would work fine, and then it wouldn't need to be perfect). Right now I am unpacking the 16 bits into the red and green channels, which is why I need it to be perfect - since an error of 1 in the red channel is multiplied by 256 in the final result. I am not having success with any of the fourcc codes available to me.

    &#xA;