
Recherche avancée
Médias (2)
-
Core Media Video
4 avril 2013, par
Mis à jour : Juin 2013
Langue : français
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (108)
-
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 ) (...) -
Soumettre améliorations et plugins supplémentaires
10 avril 2011Si vous avez développé une nouvelle extension permettant d’ajouter une ou plusieurs fonctionnalités utiles à MediaSPIP, faites le nous savoir et son intégration dans la distribution officielle sera envisagée.
Vous pouvez utiliser la liste de discussion de développement afin de le faire savoir ou demander de l’aide quant à la réalisation de ce plugin. MediaSPIP étant basé sur SPIP, il est également possible d’utiliser le liste de discussion SPIP-zone de SPIP pour (...) -
L’espace de configuration de MediaSPIP
29 novembre 2010, parL’espace de configuration de MediaSPIP est réservé aux administrateurs. Un lien de menu "administrer" est généralement affiché en haut de la page [1].
Il permet de configurer finement votre site.
La navigation de cet espace de configuration est divisé en trois parties : la configuration générale du site qui permet notamment de modifier : les informations principales concernant le site (...)
Sur d’autres sites (8576)
-
Calling FFMPEG with Boost.Process
10 février 2016, par CadentOrangeI’m trying to call FFMPEG from my C++ process to stream video from an IP camera. The FFMPEG command I use is
ffmpeg.exe -rtsp_transport tcp -i rtsp://10.0.1.21/ONVIF/MediaInput?profile=1_def_profile4 -f image2pipe -pix_fmt rgb24 -vcodec rawvideo -r 15 -
. I’ve verified this command in the command prompt and it does start a video stream and dumps the frames tostdout
. I’ve also written similar code in Python and it works.This is the code I’m using to call FFMPEG with the arguments from the previous paragraph in C++ and read the individual frames from
stdout
.bool build_ffmpeg_arguments(const std::string &uri, std::vector &args)
{
args.push_back("-rtsp_transport");
args.push_back("tcp");
args.push_back("-i");
args.push_back(uri);
args.push_back("-f");
args.push_back("image2pipe");
args.push_back("-pix_fmt");
args.push_back("rgb24");
args.push_back("-vcodec");
args.push_back("rawvideo");
args.push_back("-r");
args.push_back("15");
args.push_back("-");
return true;
}
boost::process::child start_ffmpeg(const std::string &uri,
const std::string &ffmpeg_path = "c:\\Tools\\ffmpeg.exe")
{
std::vector args;
build_ffmpeg_arguments(uri, args);
boost::process::context ctx;
ctx.stdout_behavior = boost::process::capture_stream();
ctx.stderr_behavior = boost::process::capture_stream();
return boost::process::launch(ffmpeg_path, args, ctx);
}
bool read_frame(boost::process::pistream &is, int frame_size, std::vector<char> &frame_bytes)
{
char *buffer = new char[frame_size];
frame_bytes.clear();
is.read(buffer, frame_size);
int bytes_read = is.gcount();
frame_bytes.assign(buffer, buffer + bytes_read);
// std::cout << "Is Bad: " << is.bad() << std::endl;
// std::cout << "Is EOF: " << is.eof() << std::endl;
// std::cout << "gcount: " << bytes_read << std::endl;
delete[] buffer;
if(is.bad() || is.eof() || bytes_read < frame_size)
{
//We read in gunk, skip this time.
is.clear();
return false;
}
else
{
return true;
}
}
//This is where the code is invoked.
BOOST_AUTO_TEST_CASE(test_ffmpeg_stream)
{
std::string uri = "rtsp://10.0.1.21/ONVIF/MediaInput?profile=1_def_profile4";
int width = 320;
int height = 240;
int bpp = 3;
int bytes_expected = width * height * 3;
boost::process::child c = start_ffmpeg(uri);
boost::process::pistream &is = c.get_stdout();
boost::process::pistream &err = c.get_stderr();
std::vector<char> buffer;
bool result = read_frame(is, bytes_expected, buffer);
//BOOST_CHECK_EQUAL(true, result);
std::cout << "Buffer size: " << buffer.size() << std::endl;
std::string line;
while (std::getline(err, line))
std::cout << line << std::endl;
}
</char></char>The output from
stderr
suggests that the parameters could be passed in wrong.ffmpeg version 2.8.3 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 5.2.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --ena
ble-decklink --enable-zlib
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
rtsp://10.0.1.21/ONVIF/MediaInput?profile=1_def_profile4: Unknown errorIs there a way of showing the full command line with arguments that
boost::process::launch
is calling ? Is there anything obvious that I’m doing wrong withboost::process
?Update :
Suspecting that it could be the command line arguments being passed in wrong, I’ve created a dummy executable that prints out the command line arguments it receives. It’s a drop-in replacement for
ffmpeg.exe
purely so that I can see what command lines are being passed. The command line I’m getting is-rtsp_transport tcp -i rtsp://10.0.1.21/ONVIF/MediaInput?profile=1_def_profile4 -f image2pipe -pix_fmt rgb24 -vcodec rawvideo -r 15 -
. Manually calling ffmpeg with that command line works as expected. Yet somehow it doesn’t work when launched viaboost::process
.** Solution **
It looks like I need to set the the environment field of the context. No idea why that fixes the problem, but it does.
boost::process::context ctx;
ctx.environment = boost::process::self::get_environment();
ctx.stdout_behavior = boost::process::capture_stream();
ctx.stderr_behavior = boost::process::capture_stream(); -
lavc/sbrdsp : fix inverted boundary check
25 mai 2024, par Rémi Denis-Courmont -
errors while cmake compiling ffmpeg with custom libx265 which has opencv code in it
10 mai 2017, par Gibrani have changed libx265 with my code. now the new code dependency of opencv in it. so i changed the CMakeLists.txt of x265 source to solve it. i run exactly what i want it to do.
But when i compile it and add library as an external library in ffmpeg. ffmpeg gives the same dependency error of OpenCV like before because of this library. see the log below of ffmpeg.there is a configure file in ffmpeg i think by adding OpenCv dependency in it.
check_pkg_config x265 x265.h x265_api_get
pkg-config --exists --print-errors x265
check_func_headers x265.h x265_api_get -I/home/ryuk666/ffmpeg_build/include -L/home/ryuk666/ffmpeg_build/lib -lx265 -lstdc++ -lm -lrt -ldl
check_ld cc -I/home/ryuk666/ffmpeg_build/include -L/home/ryuk666/ffmpeg_build/lib -lx265 -lstdc++ -lm -lrt -ldl
check_cc -I/home/ryuk666/ffmpeg_build/include -L/home/ryuk666/ffmpeg_build/lib
BEGIN /tmp/ffconf.fTnjzKqn.c
1 #include
2 #include
3 long check_x265_api_get(void) { return (long) x265_api_get; }
4 int main(void) { int ret = 0;
5 ret |= ((intptr_t)check_x265_api_get) & 0xFFFF;
6 return ret; }
END /tmp/ffconf.fTnjzKqn.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I/home/ryuk666/ffmpeg_build/include -std=c11 -fomit-frame-pointer -pthread -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/fribidi -I/usr/include/freetype2 -I/usr/include/freetype2 -I/usr/include/opus -I/home/ryuk666/ffmpeg_build/include -L/home/ryuk666/ffmpeg_build/lib -c -o /tmp/ffconf.OuPGoDMW.o /tmp/ffconf.fTnjzKqn.c
gcc -L/home/ryuk666/ffmpeg_build/lib -Wl,--as-needed -Wl,-z,noexecstack -I/home/ryuk666/ffmpeg_build/include -L/home/ryuk666/ffmpeg_build/lib -o /tmp/ffconf.RVzkkwqb /tmp/ffconf.OuPGoDMW.o -lx265 -lstdc++ -lm -lrt -ldl -lx264 -lpthread -lm -ldl -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvpx -lm -lpthread -lvorbisenc -lvorbis -logg -ltheoraenc -ltheoradec -logg -lopus -lm -lmp3lame -lfreetype -lz -lpng12 -lz -lm -lfdk-aac -lm -lass -lm -lharfbuzz -lfontconfig -lexpat -lfreetype -lexpat -lfribidi -lfreetype -lz -lpng12 -lz -lm -lm -lz -pthread
/home/ryuk666/ffmpeg_build/lib/libx265.a(encoder.cpp.o): In function `afterMeanShift(cv::Mat&, int, std::vector >, cv::Size_<int>, std::vector >, cv::Mat, std::vector >)':
encoder.cpp:(.text+0x7abe): undefined reference to `cv::Mat::create(int, int const*, int)'
encoder.cpp:(.text+0x7ae0): undefined reference to `cv::Mat::zeros(cv::Size_<int>, int)'
encoder.cpp:(.text+0x7b17): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x7b91): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x7bad): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x7c29): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x7c45): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x7cbe): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x7d67): undefined reference to `cv::Mat::create(int, int const*, int)'
encoder.cpp:(.text+0x7d89): undefined reference to `cv::Mat::zeros(cv::Size_<int>, int)'
encoder.cpp:(.text+0x7dc0): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x7e39): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x7e55): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x7ed1): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x7eed): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x7f66): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x81bc): undefined reference to `cv::Mat::create(int, int const*, int)'
encoder.cpp:(.text+0x81de): undefined reference to `cv::Mat::zeros(cv::Size_<int>, int)'
encoder.cpp:(.text+0x8215): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x8291): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x82ad): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x8329): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x8345): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x83be): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x84aa): undefined reference to `cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
encoder.cpp:(.text+0x8598): undefined reference to `cv::morphologyEx(cv::_InputArray const&, cv::_OutputArray const&, int, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
encoder.cpp:(.text+0x85e1): undefined reference to `cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
encoder.cpp:(.text+0x86c9): undefined reference to `cv::morphologyEx(cv::_InputArray const&, cv::_OutputArray const&, int, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
encoder.cpp:(.text+0x8786): undefined reference to `cv::Mat::create(int, int const*, int)'
encoder.cpp:(.text+0x87a8): undefined reference to `cv::Mat::zeros(cv::Size_<int>, int)'
encoder.cpp:(.text+0x87df): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x8859): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x8875): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x88f1): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x890d): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x8986): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x89f1): undefined reference to `cv::threshold(cv::_InputArray const&, cv::_OutputArray const&, double, double, int)'
encoder.cpp:(.text+0x8cac): undefined reference to `cv::connectedComponentsWithStats(cv::_InputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, cv::_OutputArray const&, int, int)'
encoder.cpp:(.text+0x8e3f): undefined reference to `cv::compare(cv::_InputArray const&, cv::_InputArray const&, cv::_OutputArray const&, int)'
encoder.cpp:(.text+0x8e89): undefined reference to `cv::getStructuringElement(int, cv::Size_<int>, cv::Point_<int>)'
encoder.cpp:(.text+0x8f67): undefined reference to `cv::dilate(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&, cv::Point_<int>, int, int, cv::Scalar_<double> const&)'
encoder.cpp:(.text+0x9031): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
encoder.cpp:(.text+0x9067): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x90f2): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
encoder.cpp:(.text+0x9138): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x91b6): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x91d5): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x9255): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x9270): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x92e6): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x9305): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x9385): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x93a4): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x9425): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x9444): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x94c5): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x94e0): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x9556): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x9575): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x95f5): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x9614): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x9695): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x96b0): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x9726): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x9745): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x97c5): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0x97e4): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0x9865): undefined reference to `cv::fastFree(void*)'
/home/ryuk666/ffmpeg_build/lib/libx265.a(encoder.cpp.o): In function `meanShift2(cv::Mat, cv::Mat&, cv::Size_<int>, std::vector >&, std::vector >&, std::vector >)':
encoder.cpp:(.text+0x9a69): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
encoder.cpp:(.text+0x9b2b): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
encoder.cpp:(.text+0xa11c): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xa191): undefined reference to `cv::Mat::deallocate()'
/home/ryuk666/ffmpeg_build/lib/libx265.a(encoder.cpp.o): In function `x265::Encoder::encode(x265_picture const*, x265_picture*)':
encoder.cpp:(.text+0xa2c3): undefined reference to `cvCreateImage'
encoder.cpp:(.text+0xa450): undefined reference to `cvSet2D'
encoder.cpp:(.text+0xa4cd): undefined reference to `cv::cvarrToMat(void const*, bool, bool, int, cv::AutoBuffer*)'
encoder.cpp:(.text+0xa5e9): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
encoder.cpp:(.text+0xa794): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
encoder.cpp:(.text+0xa86e): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
encoder.cpp:(.text+0xb1ec): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xb262): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xb300): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
encoder.cpp:(.text+0xb45e): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xb4d4): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xb565): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xb5e0): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xb5ff): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xb67e): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xb810): undefined reference to `cv::Mat::copyTo(cv::_OutputArray const&) const'
encoder.cpp:(.text+0xbad4): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xbb3a): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xbcd2): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
encoder.cpp:(.text+0xc01e): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xc083): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xc11b): undefined reference to `cv::resize(cv::_InputArray const&, cv::_OutputArray const&, cv::Size_<int>, double, double, int)'
encoder.cpp:(.text+0xc1ea): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xc260): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xc27b): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xc2f1): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xc310): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xc38d): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xc3ac): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xc429): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xc4dd): undefined reference to `cv::fastFree(void*)'
encoder.cpp:(.text+0xd5a0): undefined reference to `cv::Mat::deallocate()'
encoder.cpp:(.text+0xd6bc): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
encoder.cpp:(.text+0xd7a6): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
encoder.cpp:(.text+0xda4f): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
collect2: error: ld returned 1 exit status
ERROR: x265 not found using pkg-config
</int></int></int></int></int></int></double></int></int></int></int></double></int></int></int></double></int></int></int></int></int></int></int>