
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (53)
-
ANNEXE : Les plugins utilisés spécifiquement pour la ferme
5 mars 2010, parLe 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, parCertains 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, parMediaspip 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 Tammami'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 user19068953I'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"{
 #include <libavformat></libavformat>avformat.h>
}

#include <iostream>
int main(int argc, char* argv[]) {
 AVFormatContext* context; 
 context = avformat_alloc_context();
 std::cout << context << std::endl;
}
</iostream>


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) :


/usr/bin/ld: CMakeFiles/Interview.dir/src/main.cpp.o: in function main': main.cpp: 
 (.text+0x4e): undefined reference to avformat_alloc_context' 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



Edit :
I edited the cmake file but now im getting a different error :


find_path(AVCODEC_INCLUDE_DIR NAMES "avformat.h" PATHS 
${CMAKE_CURRENT_SOURCE_DIR}/lib/ffmpeg/libavformat)
find_library(AVCODEC_LIBRARY avformat)

link_directories(${CMAKE_SOURCE_DIR}/lib)

add_executable(Interview src/main.cpp)

target_include_directories(Interview PRIVATE ${AVCODEC_INCLUDE_DIR})
target_link_libraries(Interview PRIVATE avformat)

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

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

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



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 :


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



-
react cant find ffmpegwasm
18 septembre 2024, par MartinI am trying to create a working example for ffmpeg wasm with react js in my browser.


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


installed ffmpeg locally inside my react repo node_modules as seen here :



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


import React, { useState, useEffect } from 'react';
import './App.css';

import { createFFmpeg, fetchFile } from '@ffmpeg/ffmpeg';
const ffmpeg = createFFmpeg({
 log: true,
});
function App() {
 
 const [ready, setReady] = useState(false);

 const load = async () => {
 console.log('load()')
 await ffmpeg.load();
 setReady(true);
 }

 useEffect(()=>{
 load();
 }, [])

 return (
 <div classname="App">
 content
 </div>
 );
}

export default App;




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


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



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


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



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