
Recherche avancée
Autres articles (76)
-
Emballe Médias : Mettre en ligne simplement des documents
29 octobre 2010, parLe plugin emballe médias a été développé principalement pour la distribution mediaSPIP mais est également utilisé dans d’autres projets proches comme géodiversité par exemple. Plugins nécessaires et compatibles
Pour fonctionner ce plugin nécessite que d’autres plugins soient installés : CFG Saisies SPIP Bonux Diogène swfupload jqueryui
D’autres plugins peuvent être utilisés en complément afin d’améliorer ses capacités : Ancres douces Légendes photo_infos spipmotion (...) -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (10827)
-
Use ffmpeg to send custom header for RTSP session
29 janvier 2020, par senojsitrucI am trying to use the ffmpeg library (not the command line) to open an RTSP stream and push that stream to a server. In ONVIF parlance, this is a
backchannel
(for sending audio to a camera).Where I am stuck is in sending a custom header (
Require: ...
) with theDESCRIBE
command, and being able to handle the reply.Is there a way to do this with ffmpeg ?
DESCRIBE rtsp://192.168.0.1 RTSP/1.0 CSeq: 1
User-Agent: ONVIF Rtsp client Accept: application/sdp
Require: www.onvif.org/ver20/backchannelI noticed in
rtsp.c
that there are various*_rtsp_send_cmd_*()
functions that look interesting, but they all appear to be private to the library. -
Access violation reading location when opening avfromat_open_input
28 mai 2023, par noklaI am trying to build a function for reading a video from .mp4 file using ffmpeg and c++.


This function was already working on one computer but when I copied the code to another one, with the same environment it returned the following error :


Exception thrown at 0x00007FFC81B7667C (avutil-57.dll)
in VideoEditor.exe: 0xC0000005: Access violation 
reading location 0x0000000000000000.



If anyone has ever encountered such an issue or have any idea how to solve it please share.



This is the function :


void VideoSource::ReadSource()
{
 auto lock = this->LockSource();
 std::vector> newSource;

 // Open the file using libavformat
 AVFormatContext* av_format_ctx = avformat_alloc_context();
 if (!av_format_ctx) {
 //wxMessageBox("Couldn't create AVFormatContext\n");
 read = false;
 return;
 }
 if (avformat_open_input(&av_format_ctx, path.c_str(), NULL, NULL) != 0) { // error here
 //wxMessageBox("Couldn't open video file\n");
 read = false;
 return;
 }

 // Find the first valid video stream inside the file
 int video_stream_index = -1;
 AVCodecParameters* av_codec_params = NULL;
 const AVCodec* av_codec = NULL;
 for (uint i = 0; i < av_format_ctx->nb_streams; i)
 {
 av_codec_params = av_format_ctx->streams[i]->codecpar;
 av_codec = avcodec_find_decoder(av_codec_params->codec_id);

 if (!av_codec) {
 continue;
 }
 if (av_codec_params->codec_type == AVMEDIA_TYPE_VIDEO) {
 video_stream_index = i;
 break;
 }
 }

 if (video_stream_index == -1) {
 //wxMessageBox("Couldn't find valid video stream inside file\n");
 read = false;
 return;
 }

 // Set up a codec context for the decoder
 AVCodecContext* av_codec_ctx = avcodec_alloc_context3(av_codec);
 if (!av_codec_ctx) {
 //wxMessageBox("Couldn't create AVCpdecContext\n");
 read = false;
 return;
 }

 if (avcodec_parameters_to_context(av_codec_ctx, av_codec_params) < 0)
 {
 //wxMessageBox("Couldn't initialize AVCodecContext\n");
 read = false;
 return;
 }
 if (avcodec_open2(av_codec_ctx, av_codec, NULL) < 0) {
 //wxMessageBox("Couldn't open codec\n");

 read = false;
 return;
 }

 AVFrame* av_frame = av_frame_alloc();
 if (!av_frame) {
 //wxMessageBox("Couldn't allocate AVFrame\n");

 read = false;
 return;
 }
 AVPacket* av_packet = av_packet_alloc();
 if (!av_packet) {
 //wxMessageBox("Couldn't allocate AVPacket\n");

 read = false;
 return;
 }
 int response;
 int counter = 0;
 while (av_read_frame(av_format_ctx, av_packet) >= 0 && counter < 100000) {
 if (av_packet->stream_index != video_stream_index) {
 av_packet_unref(av_packet);
 continue;
 }
 response = avcodec_send_packet(av_codec_ctx, av_packet);
 if (response < 0) {
 //wxMessageBox("Failed to decode packet: %s\n", av_err2str(response));

 read = false;
 return;
 }
 response = avcodec_receive_frame(av_codec_ctx, av_frame);
 if (response == AVERROR(EAGAIN) || response == AVERROR_EOF) {
 av_packet_unref(av_packet);
 continue;
 }
 else if (response < 0) {
 //wxMessageBox("Failed to decode frame: %s\n", av_err2str(response));

 read = false;
 return;
 }
 counter++;
 av_packet_unref(av_packet);

 av_packet = av_packet_alloc();

 response = avcodec_send_frame(av_codec_ctx, av_frame);
 std::string tmp = av_err2str(response);
 //source.push_back(*av_frame);
 //auto mat_frame = Avframe2Cvmat(av_frame);

 //source.push_back(im);
 //bool isEqual = (cv::sum(Avframe2Cvmat(av_frame) != Avframe2Cvmat(&source[0])) == cv::Scalar(0, 0, 0, 0));
 //bool isEqual = (cv::sum(im != source[0]) == cv::Scalar(0, 0, 0, 0));
 //im.release();
 newSource.push_back(SyncObject(av_frame_clone(av_frame)));

 /*
 if (int iRet = av_frame_copy(&source.back(), av_frame) == 0) {
 av_log(NULL, AV_LOG_INFO, "Ok");
 }
 else {
 av_log(NULL, AV_LOG_INFO, "Error: %s\n", av_err2str(iRet));
 }*/
 av_frame_unref(av_frame);
 }


 avformat_close_input(&av_format_ctx);
 avformat_free_context(av_format_ctx);
 av_frame_free(&av_frame);
 av_packet_free(&av_packet);
 avcodec_free_context(&av_codec_ctx);
 //this->LockSource();
 source_.swap(newSource);
}



This function is inside A class and those are its memebers :


bool created;
 bool read;
 std::string path; // THE PATH TO THE FILE
 std::vector> source_; // vector containing all of the video frames





This is what I get in the debugger when the error accures :


[![Debugger values][1]][1]



-
javacpp-presets ffmpeg : Trying to access Ebur128Context->integrated_loudness but unsuccessful
11 avril 2019, par Sourabh Jain[FFMPEG] Trying to access Ebur128Context->integrated_loudness but unsuccessful , using javacpp presets
I am trying to run ebur128Filter on audio file . similar to be doing
[http://ffmpeg.org/doxygen/2.6/f__ebur128_8c_source.html#l00135]ffmpeg -i sample.wav -filter_complex ebur128=peak=true -f null -
result of which is :
[Parsed_ebur128_0 @ 0x7f9d38403ec0] Summary:
Integrated loudness:
I: -15.5 LUFS
Threshold: -25.6 LUFS
Loudness range:
LRA: 1.5 LU
Threshold: -35.5 LUFS
LRA low: -16.3 LUFS
LRA high: -14.8 LUFS
True peak:
Peak: -0.4 dBFSpackage org.bytedeco.javacv;
import org.bytedeco.javacpp.BytePointer;
import org.bytedeco.javacpp.Pointer;
import org.bytedeco.javacpp.avfilter;
import org.junit.jupiter.api.Test;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.util.logging.Level;
import java.util.logging.Logger;
import static org.bytedeco.javacpp.avutil.av_opt_get;
public class LoudnessAndTruePeakTest {
@Test
public void ebur1228FilterTest() throws FrameFilter.Exception, FrameGrabber.Exception {
Logger.getGlobal().setLevel(Level.ALL);
String filter = "ebur128=peak=true:framelog=verbose";
FFmpegFrameFilter fFmpegFrameFilter = new FFmpegFrameFilter(filter, 2);
InputStream is = getClass().getResourceAsStream("/resources/sample.wav");
FFmpegFrameGrabber fFmpegFrameGrabber = new FFmpegFrameGrabber(is);
fFmpegFrameFilter.start();
fFmpegFrameGrabber.start();
Frame frame;
while ((frame = fFmpegFrameGrabber.grabSamples()) != null) {
fFmpegFrameFilter.push(frame);
}
printFilterState(fFmpegFrameFilter);
fFmpegFrameGrabber.stop();
fFmpegFrameFilter.stop();
}
private void printFilterState(FFmpegFrameFilter fFmpegFrameFilter) {
avfilter.AVFilterContext filters = fFmpegFrameFilter.afilter_graph.filters(3);
Pointer value = filters.priv();
String name = filters.name().getString();
System.out.println(name);
Pointer pointer = new BytePointer(8);
ByteBuffer buffer = pointer.asByteBuffer();
av_opt_get(value, "integrated_loudness", 0, buffer);
double db = buffer.getDouble();
System.out.println("integrated_loudness : " + db);
pointer = new BytePointer(8);
buffer = pointer.asByteBuffer();
av_opt_get(value, "i400.rel_threshold", 0, buffer);
db = buffer.getDouble();
System.out.println("i400.rel_threshold :" + db);
pointer = new BytePointer(8);
buffer = pointer.asByteBuffer();
av_opt_get(value, "loudness_range", 0, buffer);
db = buffer.getDouble();
System.out.println("loudness_range :" + db);
pointer = new BytePointer(8);
buffer = pointer.asByteBuffer();
av_opt_get(value, "i3000.rel_threshold :", 0, buffer);
db = buffer.getDouble();
System.out.println("i3000.rel_threshold :" + db);
pointer = new BytePointer(8);
buffer = pointer.asByteBuffer();
av_opt_get(value, "lra_low", 0, buffer);
db = buffer.getDouble();
System.out.println("lra_low :" + db);
pointer = new BytePointer(8);
buffer = pointer.asByteBuffer();
av_opt_get(value, "lra_high", 0, buffer);
db = buffer.getDouble();
System.out.println("lra_high :" + db);
}
}Output from program is :
Input #0, wav, from 'java.io.BufferedInputStream@2a40cd94':
Metadata:
title : test
album : test
artist : test
genre : Cinematic
Duration: N/A, bitrate: 256 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 8000 Hz, 2 channels, s16, 256 kb/s
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Parsed_ebur128_0
integrated_loudness : 2.315841784746324E77
i400.rel_threshold :2.315841784746324E77
loudness_range :2.315841784746324E77
i3000.rel_threshold :1.3561678660795056E248
lra_low :2.315841784746324E77
lra_high :2.0858062529025373E-306
[Parsed_ebur128_0 @ 0x7f8942683940] Summary:
Integrated loudness:
I: -70.0 LUFS
Threshold: 0.0 LUFS
Loudness range:
LRA: 0.0 LU
Threshold: 0.0 LUFS
LRA low: 0.0 LUFS
LRA high: 0.0 LUFS
True peak:
Peak: -inf dBFS
Process finished with exit code 0not sure what I am doing wrong here