Recherche avancée

Médias (0)

Mot : - Tags -/formulaire

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

Autres articles (54)

  • Mise à disposition des fichiers

    14 avril 2011, par

    Par défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
    Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
    Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)

  • Problèmes fréquents

    10 mars 2010, par

    PHP et safe_mode activé
    Une des principales sources de problèmes relève de la configuration de PHP et notamment de l’activation du safe_mode
    La solution consiterait à soit désactiver le safe_mode soit placer le script dans un répertoire accessible par apache pour le site

  • Gestion générale des documents

    13 mai 2011, par

    MédiaSPIP ne modifie jamais le document original mis en ligne.
    Pour chaque document mis en ligne il effectue deux opérations successives : la création d’une version supplémentaire qui peut être facilement consultée en ligne tout en laissant l’original téléchargeable dans le cas où le document original ne peut être lu dans un navigateur Internet ; la récupération des métadonnées du document original pour illustrer textuellement le fichier ;
    Les tableaux ci-dessous expliquent ce que peut faire MédiaSPIP (...)

Sur d’autres sites (9079)

  • Which OpenCV FOURCC codecs should I use for my Python program ?

    17 mars 2020, par Rainer H.

    I have implemented a Python script which displays a video to the user and records it. The video is saved either compressed or uncompressed.

    In an old program I have seen, that the "DIVX" MPEG-4 and the "IYUV" codecs were used. For some reason, they don’t work on my computer (OUTPUT_VIDEO is a MP4-file).

    OpenCV: FFMPEG: tag 0x58564944/'DIVX' is not supported with codec id 13 and format 'mp4 / MP4 (MPEG-4 Part 14)'
    OpenCV: FFMPEG: fallback to use tag 0x00000020/' ???'

    The "MPJPG" codec works with ".avi" files.

    Because I’m not sure about the codecs, I would like to ask, which codecs should I use for my script to achieve the following requirements :

    • the video sequence can be saved as .mp3, .mp4 file (both compressed) or as .avi file (uncompressed).
    • Python script should work on Windows and Linux platforms.

    This is my source code :
    main.py

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-

    import os
    import cv2
    import platform

    #=========== TO CHANGE ===========
    INPUT_VIDEO = os.path.join("..", "resources", "video.mp4")
    OUTPUT_VIDEO = os.path.join("..", "recorded", "recorded.avi")
    compress = False
    #=========== TO CHANGE ===========

    WINDOW_NAME = "Video Recorder"

    player = cv2.VideoCapture(INPUT_VIDEO)

    # Get the frames per second (fps) of the video.
    fps = player.get(cv2.CAP_PROP_FPS)

    # Get width and height via the video capture property.
    width = player.get(cv2.CAP_PROP_FRAME_WIDTH)
    height = player.get(cv2.CAP_PROP_FRAME_HEIGHT)

    # Define the codec and create VideoWriter object according to the used operating system.
    four_cc = None
    if platform.system() == "Windows":
       if compress:
           four_cc = cv2.VideoWriter_fourcc(*"MJPG")  # *"DIVX")  # DIVX MPEG-4 codec.
       else:
           four_cc = cv2.VideoWriter_fourcc(*"MJPG")  # *"IYUV")  # Uncompressed yuv420p in avi container.
    elif platform.system() == "Linux":
       if compress:
           four_cc = cv2.VideoWriter_fourcc(*"DIVX")  # DIVX MPEG-4 codec.
       else:
           four_cc = cv2.VideoWriter_fourcc(*"IYUV")  # Uncompressed yuv420p in avi container.

    recorder = cv2.VideoWriter(OUTPUT_VIDEO, four_cc, fps, (int(width), int(height)))

    if player is None:
       quit()

    while player.isOpened():
       ret, frame = player.read()

       if ret:
           cv2.imshow(WINDOW_NAME, frame)
           recorder.write(frame)
       else:
           break

       key_code = cv2.waitKey(1)

       # Closes the window if the ESC key was pressed.
       if key_code == 27:
           break

       # Closes the window if the X button of the window was clicked.
       if cv2.getWindowProperty(WINDOW_NAME, 1) == -1:
           break

    player.release()
    recorder.release()
    cv2.destroyAllWindows()

    I’m using a Windows 7 computer, with opencv-contrib-python 3.4.0.12 and Python 3.6.

  • How to redirect the output of an invoked program to a file ?

    26 avril 2013, par Jim Miller

    I've got some PHP code that, among other things, uses system() to call ffmpeg to encode a video. When I run this from a command line, I can redirect the output of the PHP script to a file in the usual way — php mycode.php > mycode.log — and I get not only whatever print statements I call in PHP, but also the stuff produced by ffmpeg, which I want. All's well.

    Now, however, I want to launch the PHP script in the background via a web page : I do some stuff on my site that causes this to run :

    $the_command = "/bin/php $php_file_name > $log_file_name &";
    $the_result = system($the_command, $retval);

    This successfully runs my script in a background PHP process, and my videos are still getting encoded by ffmpeg. However, the only thing I'm getting in my redirected log file are the print statements in the script — the output of the ffmpeg invocations are getting sent off to the ether somewhere. Is there any way I can get these saved in the log file as well ?

  • Cannot Compile C Program That Uses a Library (FFmpeg) with GCC Because of the Library's Include Statements

    12 septembre 2019, par NetherGranite

    I am unable to compile a C project that uses a library called "FFmpeg" with a compiler called "GCC", and I believe it might be either because I don’t quite understand how #include works or because I am using the wrong compilation process.

    In a folder called Test, I have a file Test/test.c with the following contents :

    #include
    #include
    #include "FFmpeg/libavcodec/avcodec.h"

    The folder FFmpeg is located at Test/FFmpeg. When I try to compile this with GCC, I receive the following error :

    fatal error: libavutil/samplefmt.h: No such file or directory

    The file Test/FFmpeg/libavcodec/avcodec.h has the following code in it :

    #include "libavutil/samplefmt.h"
    #include "libavutil/attributes.h"
    #include "libavutil/avutil.h"
    ... //many more #include statements

    Is the issue here that I need to add "FFmpeg/" to all of these include statements ?

    If so, is there a way to automatically do this ? This library is enormous and probably has hundreds of these statements.

    If not, what should I be doing instead ? Should I attempt to compile the library by itself ? If so, how do I then include this compiled version of the library in my program ?


    Notes :

    • The command I am using to compile is gcc -c test.c.
    • I have GCC installed via MinGW.
    • I ultimately need to be able to compile this program to both a .dll and an .so.

    I apologize if any of the terminology I use here is incorrect or if my explanations are poor. I know almost nothing about compilation. Please let me know if I need to fill in more information.