
Recherche avancée
Autres articles (70)
-
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 (5009)
-
FFMPEG compiled binaries don't run using MinGW
9 juin 2015, par Paul KnopfI am trying to build windows executables/dlls for Windows XP, and they are not working. They are the correct architecture. They run fine on my Windows 8 device machine.
I used dependency walker to find missing DLLs, and all were present.
Here are the compiled executables I am trying to run.
I ran the windows build script for ffmpeg.
Here is a
dumpbin /headers ffmpeg.exe
Microsoft (R) COFF/PE Dumper Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file ffmpeg.exe
PE signature found
File Type: EXECUTABLE IMAGE
FILE HEADER VALUES
14C machine (x86)
7 number of sections
51A40 time date stamp Sun Jan 04 15:53:20 1970
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
32F characteristics
Relocations stripped
Executable
Line numbers stripped
Symbols stripped
Application can handle large (>2GB) addresses
32 bit word machine
Debug information stripped
OPTIONAL HEADER VALUES
10B magic # (PE32)
2.25 linker version
41400 size of code
4FA00 size of initialized data
1200 size of uninitialized data
14E0 entry point (004014E0)
1000 base of code
43000 base of data
400000 image base (00400000 to 00456FFF)
1000 section alignment
200 file alignment
4.00 operating system version
1.00 image version
4.00 subsystem version
0 Win32 version
57000 size of image
400 size of headers
597A9 checksum
3 subsystem (Windows CUI)
140 DLL characteristics
Dynamic base
NX compatible
200000 size of stack reserve
1000 size of stack commit
100000 size of heap reserve
1000 size of heap commit
0 loader flags
10 number of directories
0 [ 0] RVA [size] of Export Directory
51000 [ 36F0] RVA [size] of Import Directory
0 [ 0] RVA [size] of Resource Directory
0 [ 0] RVA [size] of Exception Directory
0 [ 0] RVA [size] of Certificates Directory
0 [ 0] RVA [size] of Base Relocation Directory
0 [ 0] RVA [size] of Debug Directory
0 [ 0] RVA [size] of Architecture Directory
0 [ 0] RVA [size] of Global Pointer Directory
56004 [ 18] RVA [size] of Thread Storage Directory
0 [ 0] RVA [size] of Load Configuration Directory
0 [ 0] RVA [size] of Bound Import Directory
517F0 [ 6C4] RVA [size] of Import Address Table Directory
0 [ 0] RVA [size] of Delay Import Directory
0 [ 0] RVA [size] of COM Descriptor Directory
0 [ 0] RVA [size] of Reserved Directory
SECTION HEADER #1
.text name
412BC virtual size
1000 virtual address (00401000 to 004422BB)
41400 size of raw data
400 file pointer to raw data (00000400 to 000417FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
60500060 flags
Code
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Execute Read
SECTION HEADER #2
.data name
19C virtual size
43000 virtual address (00443000 to 0044319B)
200 size of raw data
41800 file pointer to raw data (00041800 to 000419FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0700040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #3
.rdata name
A7D8 virtual size
44000 virtual address (00444000 to 0044E7D7)
A800 size of raw data
41A00 file pointer to raw data (00041A00 to 0004C1FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
40700040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Only
SECTION HEADER #4
.bss name
1200 virtual size
4F000 virtual address (0044F000 to 004501FF)
0 size of raw data
0 file pointer to raw data
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0700080 flags
Uninitialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #5
.idata name
36F0 virtual size
51000 virtual address (00451000 to 004546EF)
3800 size of raw data
4C200 file pointer to raw data (0004C200 to 0004F9FF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0300040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #6
.CRT name
3C virtual size
55000 virtual address (00455000 to 0045503B)
200 size of raw data
4FA00 file pointer to raw data (0004FA00 to 0004FBFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0300040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
SECTION HEADER #7
.tls name
20 virtual size
56000 virtual address (00456000 to 0045601F)
200 size of raw data
4FC00 file pointer to raw data (0004FC00 to 0004FDFF)
0 file pointer to relocation table
0 file pointer to line numbers
0 number of relocations
0 number of line numbers
C0300040 flags
Initialized Data
RESERVED - UNKNOWN
RESERVED - UNKNOWN
Read Write
Summary
1000 .CRT
2000 .bss
1000 .data
4000 .idata
B000 .rdata
42000 .text
1000 .tlsWhen I attempt to run the executable on XP, it just closes. There is no "missing dll" messages, nor anything in the event viewer.
-
send h264 video to nginx-rtmp server using ffmpeg API
11 décembre 2019, par GlenI have C++ code that grabs frames from a GigE camera and writes them out to a file. I’m using the libx264 codec and ffmpeg version 4.0.
Writing to the file works fine, however I would also like to send the video to nginx configured with the nginx-rtmp plug-in to make the video available live via HLS.
I can use the ffmpeg command line program to stream one of my previously captured files to my nginx server and rebroadcast as HLS, however if I try to stream from my C++ code the nginx server closes the connection after one or two frames are sent.
To test further, I used the ffmpeg command line program to receive a rtmp stream and write it out to a file. I am able to send video to ffmpeg from my C++ program with rtmp, however every frame generates a warning like this :
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1771, current: 53; changing to 1772. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1772, current: 53; changing to 1773. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1773, current: 53; changing to 1774. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1774, current: 53; changing to 1775. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1775, current: 53; changing to 1776. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1776, current: 53; changing to 1777. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1777, current: 53; changing to 1778. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1778, current: 53; changing to 1779. This may result in incorrect timestamps in the output file.
[avi @ 0x1b6b6f0] Non-monotonous DTS in output stream 0:0; previous: 1779, current: 53; changing to 1780. This may result in incorrect timestamps in the output file.I printed PTS and DTS for my packet before writing it, and the numbers were monotonous (for example, in this last frame the pts and dts printed from my code were 1780, not the ’current : 53’ that ffmpeg reports>
also, unless I tell ffmpeg what the output framerate should be I end up with a file that plays 2x speed.
After ffmpeg receives the rtmp stream and writes it to the file, I am then able to successfully send that file to my nginx server using ffmpeg.
here is some relevant code :
//configuring the codec context
// make sure that config.codec is something we support
// for now we are only supporting LIBX264
if (config.codec() != codecs::LIBX264) {
throw std::invalid_argument("currently only libx264 codec is supported");
}
// lookup specified codec
ffcodec_ = avcodec_find_encoder_by_name(config.codec().c_str());
if (!ffcodec_) {
throw std::invalid_argument("unable to get codec " + config.codec());
}
// unique_ptr to manage the codec_context
codec_context_ = av_pointer::codec_context(avcodec_alloc_context3(ffcodec_));
if (!codec_context_) {
throw std::runtime_error("unable to initialize AVCodecContext");
}
// setup codec_context_
codec_context_->width = frame_width;
codec_context_->height = frame_height;
codec_context_->time_base = (AVRational){1, config.target_fps()};
codec_context_->framerate = (AVRational){config.target_fps(), 1};
codec_context_->global_quality = 0;
codec_context_->compression_level = 0;
codec_context_->bits_per_raw_sample = 8;
codec_context_->gop_size = 1;
codec_context_->max_b_frames = 1;
codec_context_->pix_fmt = AV_PIX_FMT_YUV420P;
// x264 only settings
if (config.codec() == codecs::LIBX264) {
av_opt_set(codec_context_->priv_data, "preset", config.compression_target().c_str(), 0);
av_opt_set(codec_context_->priv_data, "crf", std::to_string(config.crf()).c_str(), 0);
}
// Open up the codec
if (avcodec_open2(codec_context_.get(), ffcodec_, NULL) < 0) {
throw std::runtime_error("unable to open ffmpeg codec");
}
// setup the output format context and stream for RTMP
AVFormatContext *tmp_f_context;
avformat_alloc_output_context2(&tmp_f_context, NULL, "flv", uri.c_str());
rtmp_format_context_ = av_pointer::format_context(tmp_f_context);
rtmp_stream_ = avformat_new_stream(rtmp_format_context_.get(), ffcodec_);
avcodec_parameters_from_context(rtmp_stream_->codecpar, codec_context_.get());
rtmp_stream_->time_base = codec_context_->time_base;
rtmp_stream_->r_frame_rate = codec_context_->framerate;
/* open the output file */
if (!(rtmp_format_context_->flags & AVFMT_NOFILE)) {
int r = avio_open(&rtmp_format_context_->pb, uri.c_str(), AVIO_FLAG_WRITE);
if (r < 0) {
throw std::runtime_error("unable to open " + uri + " : " + av_err2str(r));
}
}
if (avformat_write_header(rtmp_format_context_.get(), NULL) < 0) {
throw std::runtime_error("unable to write header");
}
av_dump_format(rtmp_format_context_.get(), 0,uri.c_str() , 1);at this point the av_dump_format produces this output :
Output #0, flv, to 'rtmp://[MY URI]':
Metadata:
encoder : Lavf58.12.100
Stream #0:0, 0, 1/1000: Video: h264 (libx264), 1 reference frame ([7][0][0][0] / 0x0007), yuv420p, 800x800 (0x0), 0/1, q=-1--1, 30 tbr, 1k tbnencoding and writing the frame :
// send the frame to the encoder, filtering first if necessary
void VideoWriter::Encode(AVFrame *frame)
{
int rval;
if (!apply_filter_) {
//send frame to encoder
rval = avcodec_send_frame(codec_context_.get(), frame);
if (rval < 0) {
throw std::runtime_error("error sending frame for encoding");
}
} else {
// push frame to filter
// REMOVED, currently testing without filtering
}
// get packets from encoder
while (rval >= 0) {
// create smart pointer to allocated packet
av_pointer::packet pkt(av_packet_alloc());
if (!pkt) {
throw std::runtime_error("unable to allocate packet");
}
rval = avcodec_receive_packet(codec_context_.get(), pkt.get());
if (rval == AVERROR(EAGAIN) || rval == AVERROR_EOF) {
return;
} else if (rval < 0) {
throw std::runtime_error("error during encoding");
}
// if I print pkt->pts and pkt->dts here, I see sequential numbers
// write packet
rval = av_interleaved_write_frame(rtmp_format_context_.get(), pkt.get());
if (rval < 0 ) {
std::cerr << av_err2str(rval) << std::endl;
}
}
}Since I am able to send video from a previously recorded file to nginx with the ffmpeg command line program, I believe the problem is in my code and not my nginx configuration.
EDIT : I think it may have to do with SPS/PPS as I see a bunch of these error messages in the nginx log before it closes the stream
2019/12/11 11:11:31 [error] 10180#0: *4 hls: failed to read 5 byte(s), client: XXX, server: 0.0.0.0:1935
2019/12/11 11:11:31 [error] 10180#0: *4 hls: error appenging SPS/PPS NALs, client: XXX, server: 0.0.0.0:1935As I mentioned, this code works fine if I set it up to write to an avi file rather stream to rtmp, and I can stream to ffmpeg listening for rtmp but with lots of warnings about the DTS but if I try to send to nginx, it closes the connection almost immediately. My first thought was that there was something wrong with the frame timestamps, but when I print pts and dts prior to writing the packet to the stream they look okay to me.
My end goal is to capture video to a file, and also be able to turn on the rtmp stream on demand — but for now I’m just trying to get the rtmp stream working continuously (without writing to a file)
Thanks for any insights.
-
What ffmpeg command line will list the key frames ?
21 décembre 2019, par ChrisJJWhat ffmpeg command line will list the index numbers of the key frames in an existing .MP4 to stdout ?
I’ve tried the only applicable answer at https://superuser.com/questions/885452/extracting-the-index-of-key-frames-from-a-video-using-ffmpeg to no avail.