
Recherche avancée
Médias (1)
-
ED-ME-5 1-DVD
11 octobre 2011, par
Mis à jour : Octobre 2011
Langue : English
Type : Audio
Autres articles (95)
-
Mise à jour de la version 0.1 vers 0.2
24 juin 2013, parExplications des différents changements notables lors du passage de la version 0.1 de MediaSPIP à la version 0.3. Quelles sont les nouveautés
Au niveau des dépendances logicielles Utilisation des dernières versions de FFMpeg (>= v1.2.1) ; Installation des dépendances pour Smush ; Installation de MediaInfo et FFprobe pour la récupération des métadonnées ; On n’utilise plus ffmpeg2theora ; On n’installe plus flvtool2 au profit de flvtool++ ; On n’installe plus ffmpeg-php qui n’est plus maintenu au (...) -
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 ;
-
Ecrire une actualité
21 juin 2013, parPrésentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
Vous pouvez personnaliser le formulaire de création d’une actualité.
Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)
Sur d’autres sites (8049)
-
How do I properly link ffmpeg using CMake in my Flutter plugin on Linux ?
7 avril 2022, par GroovinChipI've written a Flutter plugin for Linux that uses
ffmpeg
and I'm having trouble building my example app that uses the plugin. I keep getting errors that there are no matching calls to severalffmpeg
functions, which I can actually click into and see. Why is this happening and what can I do to fix it ?

Here is my plugin's
CMakeLists.txt
:

cmake_minimum_required(VERSION 3.10)
set(PROJECT_NAME "thumblr_linux")
project(${PROJECT_NAME} LANGUAGES CXX)

# This value is used when generating builds using this plugin, so it must
# not be changed
set(PLUGIN_NAME "thumblr_linux_plugin")

add_subdirectory(FFmpeg)

add_library(${PLUGIN_NAME} SHARED
 "thumblr_linux_plugin.cc"
)
apply_standard_settings(${PLUGIN_NAME})
set_target_properties(${PLUGIN_NAME} PROPERTIES
 CXX_VISIBILITY_PRESET hidden)
target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL)
target_include_directories(${PLUGIN_NAME} INTERFACE
 "${CMAKE_CURRENT_SOURCE_DIR}/include")
target_link_libraries(${PLUGIN_NAME} PRIVATE flutter)
target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK FFmpgeg)

# List of absolute paths to libraries that should be bundled with the plugin
set(thumblr_linux_bundled_libraries
 ""
 PARENT_SCOPE
)



and here is my
FFmpeg/CMakeLists.txt
:

cmake_minimum_required(VERSION 3.14)
project(FFmpeg)

find_package(PkgConfig REQUIRED)
pkg_check_modules(AVCODEC REQUIRED IMPORTED_TARGET libavcodec)
pkg_check_modules(AVFORMAT REQUIRED IMPORTED_TARGET libavformat)
pkg_check_modules(AVFILTER REQUIRED IMPORTED_TARGET libavfilter)
pkg_check_modules(AVDEVICE REQUIRED IMPORTED_TARGET libavdevice)
pkg_check_modules(AVUTIL REQUIRED IMPORTED_TARGET libavutil)
pkg_check_modules(SWRESAMPLE REQUIRED IMPORTED_TARGET libswresample)
pkg_check_modules(SWSCALE REQUIRED IMPORTED_TARGET libswscale)

add_library(FFmpeg INTERFACE IMPORTED GLOBAL)

target_link_libraries(FFmpeg INTERFACE
 PkgConfig::AVCODEC
 PkgConfig::AVFORMAT
 PkgConfig::AVFILTER
 PkgConfig::AVDEVICE
 PkgConfig::AVUTIL
 PkgConfig::SWRESAMPLE
 PkgConfig::SWSCALE
)



and here are the error messages I get when building :


/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:80:9: error: no matching function for call to 'avformat_open_input'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:84:9: error: no matching function for call to 'avformat_find_stream_info'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:88:5: error: no matching function for call to 'av_dump_format'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:102:61: error: assigning to 'AVCodecContext *' from incompatible type 'AVCodecParameters *'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:111:9: error: use of undeclared identifier 'avcodec_open'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:119:14: error: use of undeclared identifier 'avcodec_alloc_frame'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:122:17: error: use of undeclared identifier 'avcodec_alloc_frame'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:127:16: error: no matching function for call to 'atk_image_get_image_size'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:133:5: error: use of undeclared identifier 'av_image_fill_arrays'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:144:9: error: use of undeclared identifier 'avcodec_decode_video'
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:179:15: error: unused variable 'ret' [-Werror,-Wunused-variable]
/home/parallels/flutter_projects/thumblr/thumblr_linux/example/linux/flutter/ephemeral/.plugin_symlinks/thumblr_linux/linux/thumblr_linux_plugin.cc:211:5: error: no matching function for call to 'avformat_close_input'



the C++ code for the plugin itself can be found here : https://github.com/GroovinChip/thumblr/blob/main/thumblr_linux/linux/thumblr_linux_plugin.cc


-
libavformat fails to link on Macos
24 avril 2022, par Bilal ShafiI'm trying to go through an ffmpeg tutorial however when I try to build my project I get the following error. I initialy thought that cmake's
find_path
andfind_library
was linking the wrong filesMark Setchell
showed that this was not the case. Now I'm not sure why the linker errors are occurring. Here is the minimum example that fails to compile and the aforementioned error.

[build] [1/1 100% :: 0.076] Linking CXX executable example
[build] FAILED: example 
[build] : && /usr/bin/clang++ -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.1.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/usr/local/opt/llvm/lib CMakeFiles/example.dir/main.cpp.o -o example /usr/local/lib/libavformat.dylib && :
[build] Undefined symbols for architecture x86_64:
[build] "avformat_open_input(AVFormatContext**, char const*, AVInputFormat const*, AVDictionary**)", referenced from:
[build] _main in main.cpp.o
[build] "avformat_free_context(AVFormatContext*)", referenced from:
[build] _main in main.cpp.o
[build] "avformat_alloc_context()", referenced from:
[build] _main in main.cpp.o
[build] ld: symbol(s) not found for architecture x86_64
[build] clang: error: linker command failed with exit code 1 (use -v to see invocation)
[build] ninja: build stopped: subcommand failed.



CMakeLists.txt :


cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 17)


find_path(AVFORMAT_INCLUDE_DIRS libavformat/avformat.h REQUIRED)
find_library(AVFORMAT_LIBRARY avformat REQUIRED)

message(WARNING "AVFORMAT_LIBRARY=" ${AVFORMAT_LIBRARY})
message(WARNING "AVFORMAT_INCLUDE_DIRS=" ${AVFORMAT_INCLUDE_DIRS})

add_executable(example main.cpp)
target_link_libraries(example ${AVFORMAT_LIBRARY})
target_include_directories(example PRIVATE ${AVFORMAT_INCLUDE_DIRS})




main.cpp :


#include <libavformat></libavformat>avformat.h>

#include 


int main(int argc, char **argv) {
 if (argc < 2) {
 printf("example ");
 exit(EXIT_FAILURE);
 }

 AVFormatContext *pFormatContext = avformat_alloc_context();

 avformat_open_input(&pFormatContext, argv[1], nullptr, nullptr);
 printf("Format %s, duration %lld us", pFormatContext->iformat->long_name, pFormatContext->duration);


 avformat_free_context(pFormatContext);
}



-
yt-dlp get audio only link -> ffmpeg piped audio -> ffplay
5 juin 2022, par james28909Ok, i have a perl script that i am trying to figure out why it is throwing an io error. First i use yt-dlg to get the link of only the audio - this works as expected and i can navigate to the link in a browser just fine. then i open a ffmpeg pipe in perl and then try to read the output from ffmpeg and eventually, if i can get this working, i will process the ffmpeg output then send to a named pipe.


the problem comes from the ffmpeg when i am processing the data from the link obtained with yt-dlp, and i think it has to do with my while loop but i am not sure what. i have a named pipe called "input". i summon ffmpeg with the following :


#/usr/bin/perl
use strict;
use warnings;

my $file = /path/to/named/pipe
my $read_len = 1024;

open (my $SOURCE_AUDIO, '-|', "ffmpeg -y -i \'$link\' -map 0 -c copy -ac 2 -f opus -ar 48000 pipe:1");
binmode($SOURCE_AUDIO);

# process the ffmpeg output.i have a function i want to implement here, 
# but i need to be able to parse ffmpeg output in set read lengths

while( read($SOURCE_AUDIO, my $buf, $read_len)){
print $file $buf;
};



but before the end of the playback, somewhere around the end of the audio stream ffmpeg throws errors like this :


[tls @ 0x5d0de00] Error in the pull function..2kbits/s speed=1.21x
[tls @ 0x5d0de00] IO error: Connection reset by peer
[tls @ 0x5d0de00] The specified session has been invalidated for some reason.
 Last message repeated 1 times
https://rr3---sn-(truncated): Input/output error
size= 1021kB time=00:01:18.36 bitrate= 106.7kbits/s speed=1.21x
video:0kB audio:1012kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.808163%



i am not sure what is causing it to end early, or what is causing it to be terminated. i can download the file and re-encode it (if needed) and then play it flawlessly with ffplay, but i cannot, for the life of me, parse ffmpeg output and write it to a named pipe. any help sure would be appreciated. thanks


P.S. i am using latest updated windows 11 and WSL's built in perl :


This is perl 5, version 30, subversion 0 (v5.30.0) built for x86_64-linux-gnu-thread-multi
(with 50 registered patches, see perl -V for more detail)

Copyright 1987-2019, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl". If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.