Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (53)

  • ANNEXE : Les plugins utilisés spécifiquement pour la ferme

    5 mars 2010, par

    Le site central/maître de la ferme a besoin d’utiliser plusieurs plugins supplémentaires vis à vis des canaux pour son bon fonctionnement. le plugin Gestion de la mutualisation ; le plugin inscription3 pour gérer les inscriptions et les demandes de création d’instance de mutualisation dès l’inscription des utilisateurs ; le plugin verifier qui fournit une API de vérification des champs (utilisé par inscription3) ; le plugin champs extras v2 nécessité par inscription3 (...)

  • 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 ;

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (8872)

  • How to kill command Exec in difference Function in Golang

    26 juillet 2022, par Tammam

    i'm making screen record web based using command exec to run FFMPEG. here I created a startRecording function but I am still confused about stopping the command process in the stopRecording function, because the command is executed in the startRecording function. How to stop a process that is already running in the srartRecording function in the stopRecording function ?

    


    here my code

    


    //Handler to create room/start record
func RoomCreate(c *fiber.Ctx) error {
    fileName := "out.mp4"
    fmt.Println(fileName)
    if len(os.Args) > 1 {
        fileName = os.Args[1]
    }

    

    errCh := make(chan error, 2)
    ctx, cancelFn := context.WithCancel(context.Background())
    // Call to function startRecording
    go func() { errCh <- startRecording(ctx, fileName) }()

    go func() {
        errCh <- nil
    }()
    err := <-errCh
    cancelFn()
    if err != nil && err != context.Canceled {
        log.Fatalf("Execution failed: %v", err)
    }
    
    return c.Redirect(fmt.Sprintf("/room/%s", guuid.New().String()))
}



//Function to run command FFMPEG
func startRecording(ctx context.Context, fileName string) error {
    ctx, cancelFn := context.WithCancel(ctx)
    defer cancelFn()
    // Build ffmpeg
    ffmpeg := exec.Command("ffmpeg",
        "-f", "gdigrab",
        "-framerate", "30",
        "-i", "desktop",
        "-f", "mp4",
        fileName,
    )
    // Stdin for sending data
    stdin, err := ffmpeg.StdinPipe()
    if err != nil {
        return err
    }
    //var buf bytes.Buffer
    defer stdin.Close()
    // Run it in the background
    errCh := make(chan error, 1)

    go func() {
        fmt.Printf("Executing: %v\n", strings.Join(ffmpeg.Args, " "))
        
        if err := ffmpeg.Run(); err != nil {
            return
        }
        //fmt.Printf("FFMPEG output:\n%v\n", string(out))
        errCh <- err
    }()
    // Just start sending a bunch of frames
    for {
        
        // Check if we're done, otherwise go again
        select {
        case <-ctx.Done():
            return ctx.Err()
        case err := <-errCh:
            return err
        default:
        }
    }
}

//Here function to stop Recording
func stopRecording(ctx context.Context) error {
//Code stop recording in here
} 


    


    Thanks for advance

    


  • "Undefined referance to function" while linking ffmpeg [duplicate]

    19 mai 2022, par user19068953

    I'm trying to link ffmpeg on ubuntu, i downloaded ffmpeg source and added to my lib/ffmpeg library then ran ./configure, i created a cmake on my project directory and one inside ffmpeg dir. The cmake compiles just fine but when i run make it just gives me an error saying Undefined referance to avformat_alloc_context(), it says this for all functions but the structs, typedefs and defines compile just fine. Here are my files :

    


    ./cmake :

    


    cmake_minimum_required(VERSION 3.14)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(Interview C CXX)

add_definitions(-DGL_SILENCE_DEPRECATION)

SET(EXECUTABLE_OUTPUT_PATH ${dir}/bin )
set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin )

file(GLOB_RECURSE SOURCE_FILES 
    ${CMAKE_SOURCE_DIR}/src/*.c
    ${CMAKE_SOURCE_DIR}/src/*.cpp
    # last resort
    ${CMAKE_SOURCE_DIR}/lib/ffmpeg/*/*.c
)
    
# Add header files
file(GLOB_RECURSE HEADER_FILES 
    ${CMAKE_SOURCE_DIR}/src/*.h
    ${CMAKE_SOURCE_DIR}/src/*.hpp
    # last resort
    ${CMAKE_SOURCE_DIR}/lib/ffmpeg/*/*.h
)

list(APPEND SOURCES
    src/main.cpp
    src/vipch.h
    src/VideDecoder.cpp
    src/VideoDecoder.h
    src/Application.cpp
    src/Application.h
    src/OpenGLRender.cpp
    src/OpenGLRender.h
    src/Layer.h
    src/Layer.cpp

    # last resort
    lib/ffmppeg/*/*.h
    lib/ffmppeg/*/*.c
)
add_executable(Interview src/main.cpp)

# ffmpeg linking -----------------------------------------------


add_library(ffmpeg STATIC IMPORTED)
add_subdirectory(lib/ffmpeg)

target_include_directories(Interview PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/ffmpeg)

link_directories(${CMAKE_SOURCE_DIR}/lib)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")


    


    The cmake files are a bit messy since i am trying to figure this out.
./lib/ffmpeg/cmake :

    


    cmake_minimum_required(VERSION 3.14)
project(ffmpeg)

list(APPEND SOURCES
    libavformat/avformat.h
    libavformat/avformat.c
)

file(GLOB_RECURSE SOURCE_FILES 
    ${CMAKE_SOURCE_DIR}/*/*.c
)   
# Add header files
file(GLOB_RECURSE HEADER_FILES 
    ${CMAKE_SOURCE_DIR}/*/*.h
)

include_directories(${CMAKE_SOURCE_DIR}/libavformat)
link_directories(${CMAKE_SOURCE_DIR}/libavformat)


    


    and my main file that i run my test src/main.cpp :

    


      extern "C"{&#xA;    #include <libavformat></libavformat>avformat.h>&#xA;}&#xA;&#xA;#include <iostream>&#xA;int main(int argc, char* argv[]) {&#xA;    AVFormatContext* context; &#xA;    context = avformat_alloc_context();&#xA;    std::cout &lt;&lt; context &lt;&lt; std::endl;&#xA;}&#xA;</iostream>

    &#xA;

    Again, no problem when using type's like AVFormatContext and defines but when i use a function like avformat_alloc_context it gives of this error (the source files are inside ffmpeg, i can inspect them with ctrl right-click on VSCode) :

    &#xA;

     /usr/bin/ld: CMakeFiles/Interview.dir/src/main.cpp.o: in function main&#x27;: main.cpp: &#xA;   (.text&#x2B;0x4e): undefined reference to avformat_alloc_context&#x27; collect2: error: ld returned 1 &#xA;   exit status make[2]: *** [CMakeFiles/Interview.dir/build.make:84: bin/Interview] Error 1 &#xA;   make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/Interview.dir/all] Error 2 make: *** &#xA;   [Makefile:84: all] Error 2&#xA;

    &#xA;

    Edit :&#xA;I edited the cmake file but now im getting a different error :

    &#xA;

    find_path(AVCODEC_INCLUDE_DIR NAMES "avformat.h" PATHS &#xA;${CMAKE_CURRENT_SOURCE_DIR}/lib/ffmpeg/libavformat)&#xA;find_library(AVCODEC_LIBRARY avformat)&#xA;&#xA;link_directories(${CMAKE_SOURCE_DIR}/lib)&#xA;&#xA;add_executable(Interview src/main.cpp)&#xA;&#xA;target_include_directories(Interview PRIVATE ${AVCODEC_INCLUDE_DIR})&#xA;target_link_libraries(Interview PRIVATE avformat)&#xA;&#xA;add_library(ffmpeg STATIC IMPORTED)&#xA;add_subdirectory(lib/ffmpeg)&#xA;&#xA;target_include_directories(Interview PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/lib/ffmpeg)&#xA;&#xA;set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")&#xA;

    &#xA;

    Note : AVCODEC_LIBRARY returns notfound cmake error but just using avcodec in target_link_libraries somehow doesn't result in a cmake error, however when i run make like this it gives this error :

    &#xA;

    usr/bin/ld: cannot find -lavformat collect2: error: ld returned 1 exit status make[2]: *** [CMakeFiles/Interview.dir/build.make:84: bin/Interview] Error 1 make[1]: *** [CMakeFiles/Makefile2:96: CMakeFiles/Interview.dir/all] Error 2 make: *** [Makefile:84: all] Error 2&#xA;

    &#xA;

  • react cant find ffmpegwasm

    18 septembre 2024, par Martin

    I am trying to create a working example for ffmpeg wasm with react js in my browser.

    &#xA;

    I have been following this very simple example :&#xA;https://www.youtube.com/watch?v=-OTc0Ki7Sv0&ab_channel=Fireship

    &#xA;

    installed ffmpeg locally inside my react repo node_modules as seen here :&#xA;enter image description here

    &#xA;

    And followed to tutorial video to edit the App.jsx so it looks like this :

    &#xA;

    import React, { useState, useEffect } from &#x27;react&#x27;;&#xA;import &#x27;./App.css&#x27;;&#xA;&#xA;import { createFFmpeg, fetchFile } from &#x27;@ffmpeg/ffmpeg&#x27;;&#xA;const ffmpeg = createFFmpeg({&#xA;  log: true,&#xA;});&#xA;function App() {&#xA;  &#xA;  const [ready, setReady] = useState(false);&#xA;&#xA;  const load = async () => {&#xA;      console.log(&#x27;load()&#x27;)&#xA;      await ffmpeg.load();&#xA;      setReady(true);&#xA;  }&#xA;&#xA;  useEffect(()=>{&#xA;    load();&#xA;  }, [])&#xA;&#xA;  return (&#xA;    <div classname="App">&#xA;      content&#xA;    </div>&#xA;  );&#xA;}&#xA;&#xA;export default App;&#xA;&#xA;

    &#xA;

    But this leads to error messages in my win10 command prompt terminal saying it cant find the ffmpeg files :

    &#xA;

    [16:07:47] [snowpack] [404] Not Found (/node_modules/@ffmpeg/core/dist/ffmpeg-core.js)&#xA;[16:07:47] [snowpack] [404] Not Found (/node_modules/@ffmpeg/core/dist/ffmpeg-core.wasm)&#xA;[16:07:47] [snowpack] [404] Not Found (/node_modules/@ffmpeg/core/dist/ffmpeg-core.worker.js)&#xA;

    &#xA;

    I've even tried moving the ffmpeg files to my public folder and editing the code to find them like so :

    &#xA;

    const ffmpeg = createFFmpeg({&#xA;  log: true,&#xA;  corePath: &#x27;../public/@ffmpeg/core/dist/ffmpeg-core.js&#x27;,&#xA;});&#xA;

    &#xA;

    But the same error occured. Why doesn't my react App.jsx file correctly find the ffmpeg files in my node_modules folder ?

    &#xA;