Recherche avancée

Médias (1)

Mot : - Tags -/blender

Autres articles (50)

  • La sauvegarde automatique de canaux SPIP

    1er avril 2010, par

    Dans le cadre de la mise en place d’une plateforme ouverte, il est important pour les hébergeurs de pouvoir disposer de sauvegardes assez régulières pour parer à tout problème éventuel.
    Pour réaliser cette tâche on se base sur deux plugins SPIP : Saveauto qui permet une sauvegarde régulière de la base de donnée sous la forme d’un dump mysql (utilisable dans phpmyadmin) mes_fichiers_2 qui permet de réaliser une archive au format zip des données importantes du site (les documents, les éléments (...)

  • Script d’installation automatique de MediaSPIP

    25 avril 2011, par

    Afin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
    Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
    La documentation de l’utilisation du script d’installation (...)

  • Encodage et transformation en formats lisibles sur Internet

    10 avril 2011

    MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
    Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
    Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...)

Sur d’autres sites (7003)

  • Fatal error reading PNG image file : Invalid IHDR data (gdk-pixbuf-error-quark, 0), when using ffmpeg and wxWidgets

    20 mai 2023, par Dhairya Gupta

    for my C++ project I am using CMake + conan for my project on ubuntu20.04. The config files is as follows

    


    conanfile.py

    


    from conan import ConanFile
from conan.tools.cmake import cmake_layout

class TrajectronRecipe(ConanFile):
    name='trajectron'
    version='0.0.2'

    license = 'GPL3'
    topics = ('gui', 'video', 'interactive')

    settings = ('os', 'compiler', 'build_type', 'arch')
    generators = (
        'CMakeDeps', 
        'CMakeToolchain'
    )

    def requirements(self):
        self.requires('cmake/3.26.3') # build manager
        self.requires('spdlog/1.11.0')  # logger
        self.requires('ffmpeg/5.1')
    
    def build_requirements(self):
        if self.settings.os != 'Windows':
            self.tool_requires("cmake/3.26.3")

    def layout(self):
        # print(f'[settings build] {str(self.settings.build_type)}')
        self.folders.build = f'{str(self.settings.build_type)}'
        self.folders.generators = ''
        # cmake_layout(self)


    


    CMakeLists.txt

    


    cmake_minimum_required(VERSION 3.26 FATAL_ERROR)
set(CXX_STANDARD_REQUIRED ON)
set(CXX_STANDARD 20)
set(CMAKE_CXX_COMPILER /usr/bin/g++-10)
set(CMAKE_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")

project(
    Trajectron
    VERSION 0.0.2
    DESCRIPTION "GUI app to map out trajectories of objects in real time videos"
    LANGUAGES CXX
)
cmake_language(GET_MESSAGE_LOG_LEVEL VERBOSE)

#### external packages
find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)
find_package(wxWidgets REQUIRED gl core base OPTIONAL_COMPONENTS net)
include("${wxWidgets_USE_FILE}")
find_package(ffmpeg REQUIRED)

#### target
add_executable(trajectron 
  main.cpp
  src/app.cpp
  src/base_frame.cpp
  src/sys_file_dir_frame.cpp
  src/panels/video_stage.cpp
  src/panels/control.cpp
  src/panels/frame_list.cpp
  src/events/import_event.cpp
  src/video_processor.cpp
)

target_include_directories(trajectron PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_link_libraries(trajectron PUBLIC spdlog::spdlog)
target_link_libraries(trajectron PUBLIC ffmpeg::ffmpeg)

if(wxWidgets_FOUND)
    target_link_libraries(trajectron PRIVATE ${wxWidgets_LIBRARIES})
else(wxWidgets_FOUND)
    message("wxWidgets not found!")
endif(wxWidgets_FOUND)


    


    when i make the project as follows it build sucessfully with conan and ffmpeg

    


    cmake -G "Unix Makefiles" -S . -B build -DCMAKE_TOOLCHAIN_FILE=dependencies/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Debug
cd build/
cmake --build


    


    when i run it ./build/trajectron the application launches successfully. But when i click a button to open a wxFilectrl frame, it crashes with the following output
(https://i.stack.imgur.com/YKtfL.png)

    


    **This only happens when i have used ** find_package(ffmpeg REQUIRED) and target_link_libraries(trajectron PUBLIC ffmpeg::ffmpeg) otherwise it works properly.

    


    if you want to see the code for more context : https://github.com/dhairyagupta2603/trajectron

    


    I have tried running the executable for the project using sudo as well as updated the mime database
sudo update-mime-database /usr/share/mime. Note that I am using GTk v3 and have used wxWidgets as a separate install on system as it was not available as a conan package

    


  • How to use ffmpeg to create a video from images with timestamps

    16 juin 2023, par 肉蛋充肌

    I am attempting to record videos from a camera (basler pylon). Each frame has a timestamp provided by the camera. I want to write every frame into a video file one by one and set the interval time between two consecutive frames (in other words, fps) to match the interval time of their timestamps.I found an example code that uses ffmpeg to write the frame with a specified fps, but I am unsure how to modify the code to change it from specifying fps to using the timestamp of the frame. As I don't know anything about ffmpeg, could someone show me how to modify the code to achieve this ? It should be noted that since I immediately write every image I obtain into a video, the solution of first obtaining all the images and then merging them into a video may not be feasible.

    


    class FFMPEG_VideoWriter:
    def __init__(
            self,
            filename,  # Use avi format if possible
            size,  # (width, height)
            fps,  # Frame rate
            codec="libx264",  # Codec
            audiofile=None,  # Audio file
            preset="medium",  # Compression rate; slower is better
            bitrate=None,  # Bitrate (set only when codec supports bitrate)
            pixfmt="rgba",
            logfile=None,
            threads=None,
            ffmpeg_params=None,
    ):
        if logfile is None:
            logfile = sp.PIPE

        self.filename = filename
        self.codec = codec
        self.ext = self.filename.split(".")[-1]

        # order is important
        cmd = [
            "ffmpeg",
            "-y",
            "-loglevel",
            "error" if logfile == sp.PIPE else "info",
            "-f",
            "rawvideo",
            "-vcodec",
            "rawvideo",
            "-s",
            "%dx%d" % (size[1], size[0]),
            "-pix_fmt",
            pixfmt,
            "-r",
            "%.02f" % fps,
            "-i",
            "-",
            "-an",
        ]
        cmd.extend(
            [
                "-vcodec",
                codec,
                "-preset",
                preset,
            ]
        )
        if ffmpeg_params is not None:
            cmd.extend(ffmpeg_params)
        if bitrate is not None:
            cmd.extend(["-b", bitrate])
        if threads is not None:
            cmd.extend(["-threads", str(threads)])

        if (codec == "libx264") and (size[0] % 2 == 0) and (size[1] % 2 == 0):
            cmd.extend(["-pix_fmt", "yuv420p"])
        cmd.extend([filename])

        popen_params = {"stdout": sp.DEVNULL, "stderr": logfile, "stdin": sp.PIPE}

        if os.name == "nt":
            popen_params["creationflags"] = 0x08000000  # CREATE_NO_WINDOW

        self.proc = sp.Popen(cmd, **popen_params)

    def write_frame(self, img_array):
        """Writes one frame in the file."""
        try:
            self.proc.stdin.write(img_array.tobytes())
        except IOError as err:
            ...
            raise IOError(error)

    def close(self):
        if self.proc:
            self.proc.stdin.close()
            if self.proc.stderr is not None:
                self.proc.stderr.close()
            self.proc.wait()
        self.proc = None

    # Support the Context Manager protocol, to ensure that resources are cleaned up.

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_value, traceback):
        self.close()

# Use Example
with FFMPEG_VideoWriter(video_path, (height, width), fps=120, pixfmt="rgb24") as writer:
    while self.isRecording or not self.frame_queue.empty():
        if not self.frame_queue.empty():
            writer.write_frame(self.frame_queue.get())


    


  • InnoSetup python subprocess Popen ffmpeg

    1er juillet 2023, par Chris P

    In my code i have this line :

    


    self.p1 = Popen([self.ffmpeg_path,'-y','-loglevel','quiet','-i',self.retransmition_url,'epalxeis-radio.mp3'],stdin=PIPE,stdout=PIPE,stderr=PIPE, bufsize=1)


    


    which read an web radio stream and saves it locally with filename "epalxeis-radio.mp3"

    


    Using python to launch the script - works !
Using pyinstaller to launch the exe - works !
Using InnoSetup to launch the exe after installation - not working :(.

    


    The problem is that there is no epalxeis-radio.mp3 created when i try the third case (innosetup).

    


    The ffmpeg_path is : self.ffmpeg_path = os.path.abspath("extra/ffmpeg.exe")
and there is the extra folder in the same directory which is the innosetup exe.

    


    From Windows task manager there is no ffmpeg.exe shown in the tasks list.

    


    What wrong ?

    


    Edit : I used a smaller script to test the error :

    


    from subprocess import Popen, DEVNULL, STDOUT, PIPE
import os
import time
ffmpeg_path = os.path.abspath("extra/ffmpeg.exe")
retransmition_url = "http://shaincast.caster.fm:40636/listen.mp3?authn76260dc1cdf44a9132c0b63f85d9c67a"
with Popen([ffmpeg_path,'-y','-loglevel','quiet','-i',retransmition_url,'epalxeis-radio.mp3'],stdin=PIPE,stdout=PIPE,stderr=PIPE) as p1:
    time.sleep(1)


    


    in pyinstaller exe runs, but in innosetup exe stop immediately.