
Recherche avancée
Médias (91)
-
Corona Radiata
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Lights in the Sky
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Head Down
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Echoplex
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Discipline
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Letting You
26 septembre 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
Autres articles (41)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
Other interesting software
13 avril 2011, parWe don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
We don’t know them, we didn’t try them, but you can take a peek.
Videopress
Website : http://videopress.com/
License : GNU/GPL v2
Source code : (...)
Sur d’autres sites (8326)
-
cannot locate symbol "avpriv_pix_fmt_bps_avi"
14 mars 2017, par S. Le GalloudecI’m developping an android application using ffmpeg. I’m trying to decode a rtsp stream, and i have a problem with a symbol.
After i finally compiled ffmpeg with this tuto :
https://github.com/WritingMinds/ffmpeg-androidI used a code i found here : Receiving RTSP stream using FFMPEG library
But i have a problem when i run my program. I got this error :
java.lang.UnsatisfiedLinkError : dlopen failed : cannot locate symbol "avpriv_pix_fmt_bps_avi" referenced by "/data/app/com.example.local.test_ffmpeg-2/lib/arm/libnative-lib.so"...
The thing is that i checked into my .a to see if i had the symbol so i did :
nm libavcodec.a | grep avpriv_pix
It returned :
00000060 R avpriv_pix_fmt_bps_avi
00000000 R avpriv_pix_fmt_bps_mov
U avpriv_pix_fmt_bps_avi
U avpriv_pix_fmt_bps_movSo it looks like i have the symbol, but the U after means undefined, so i’m really confused. I’m not sure if my compilation failed somewhere or if the problem comes from my program.
I’m using ndk 14, if someone has some ideas, that would be great :)
Best regards
-
ffprobe "moov atom not found" on Linux, but works on OS X
15 mars 2017, par NeuroXcI have an MP4 file that I am trying to read info from via
ffprobe -print_format json -show_format -show_streams input.mp4
. On OS X with the Homebrew-provided FFMpeg 3.2.4, I’m able to read the video information this way. However, on both Debian Stretch and Arch Linux, with FFMpeg 3.2.4 provided through the respective package managers, I am getting :[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55e0b7977120] Format mov,mp4,m4a,3gp,3g2,mj2 detected only with low score of 1, misdetection possible!
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x55e0b7977120] moov atom not found
input.mp4: Invalid data found when processing inputAn example of a file showing this issue is https://falcon479.startdedicated.com/files/boxes.mp4
-
"Application provided invalid, non monotonically increasing dts to muxer in stream 0 : 47104 >= -4251" in C ffmpeg video & audio streams processing
30 décembre 2023, par M.HakimFor an input.mp4 file containing a video stream and an audio stream, intend to convert the video stream into h264 codec and the audio stream into aac codec and combine the two streams in output.mp4 file using C and ffmpeg libraries.
Am getting an error [mp4 @ 0x5583c88fd340] Application provided invalid, non monotonically increasing dts to muxer in stream 0 : 47104 >= -4251
How do i solve that error ?


#include 
#include <libavcodec></libavcodec>avcodec.h>
#include <libavformat></libavformat>avformat.h> 
#include <libavutil></libavutil>opt.h>

int encodeVideoAndAudio4(char *pInName, char *pOutName) {

 AVFormatContext *format_ctx = avformat_alloc_context();

 AVCodecContext *video_dec_ctx = NULL;
 AVCodecContext *video_enc_ctx = NULL;
 AVCodec *video_dec_codec = NULL;
 AVCodec *video_enc_codec = NULL;
 AVDictionary *video_enc_opts = NULL;

 AVCodecContext *audio_dec_ctx = NULL;
 AVCodecContext *audio_enc_ctx = NULL;
 AVCodec *audio_dec_codec = NULL;
 AVCodec *audio_enc_codec = NULL;


 if (avformat_open_input(&format_ctx, pInName, NULL, NULL) < 0) {
 fprintf(stderr, "Error: Could not open input file\n");
 return 1;
 }

 if (avformat_find_stream_info(format_ctx, NULL) < 0) {
 fprintf(stderr, "Error: Could not find stream information\n");
 return 1;
 }

 for (int i = 0; i < format_ctx->nb_streams; i++) {
 AVStream *stream = format_ctx->streams[i];
 const char *media_type_str = av_get_media_type_string(stream->codecpar->codec_type);
 AVRational time_base = stream->time_base;

 }

 int video_stream_index = -1;
 for (int i = 0; i < format_ctx->nb_streams; i++) {
 if (format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
 video_stream_index = i;
 break;
 }
 }
 if (video_stream_index == -1) {
 fprintf(stderr, "Error: Could not find a video stream\n");
 return 1;
 }

 AVStream *videoStream = format_ctx->streams[video_stream_index];
 video_dec_ctx = avcodec_alloc_context3(NULL);
 avcodec_parameters_to_context(video_dec_ctx, videoStream->codecpar);

 video_dec_codec = avcodec_find_decoder(video_dec_ctx->codec_id);

 if (!video_dec_codec) {
 fprintf(stderr, "Unsupported video codec!\n");
 return 1;
 }

 if (avcodec_open2(video_dec_ctx, video_dec_codec, NULL) < 0) {
 fprintf(stderr, "Error: Could not open a video decoder codec\n");
 return 1;
 }

 video_enc_codec = avcodec_find_encoder(AV_CODEC_ID_H264);
 if (!video_enc_codec) {
 fprintf(stderr, "Error: Video Encoder codec not found\n");
 return 1;
 }

 video_enc_ctx = avcodec_alloc_context3(video_enc_codec);
 if (!video_enc_ctx) {
 fprintf(stderr, "Error: Could not allocate video encoder codec context\n");
 return 1;
 }

 videoStream->time_base = (AVRational){1, 25};

 video_enc_ctx->bit_rate = 1000; 
 video_enc_ctx->width = video_dec_ctx->width;
 video_enc_ctx->height = video_dec_ctx->height;
 video_enc_ctx->time_base = (AVRational){1, 25};
 video_enc_ctx->gop_size = 10;
 video_enc_ctx->max_b_frames = 1;
 video_enc_ctx->pix_fmt = AV_PIX_FMT_YUV420P;

 if (avcodec_open2(video_enc_ctx, video_enc_codec, NULL) < 0) {
 fprintf(stderr, "Error: Could not open encoder codec\n");
 return 1;
 }

 av_dict_set(&video_enc_opts, "preset", "medium", 0);
 av_opt_set_dict(video_enc_ctx->priv_data, &video_enc_opts);

 AVPacket video_pkt;
 av_init_packet(&video_pkt);
 video_pkt.data = NULL;
 video_pkt.size = 0;

 AVPacket pkt;
 av_init_packet(&pkt);
 pkt.data = NULL;
 pkt.size = 0;

 AVFrame *video_frame = av_frame_alloc();
 if (!video_frame) {
 fprintf(stderr, "Error: Could not allocate video frame\n");
 return 1;
 }

 video_frame->format = video_enc_ctx->pix_fmt;
 video_frame->width = video_enc_ctx->width;
 video_frame->height = video_enc_ctx->height;
 
 int audio_stream_index = -1;
 for (int i = 0; i < format_ctx->nb_streams; i++) {
 if (format_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) {
 audio_stream_index = i;
 break;
 }
 }

 if (audio_stream_index == -1) {
 fprintf(stderr, "Error: Could not find an audio stream\n");
 return 1;
 }
 
 AVStream *audioStream = format_ctx->streams[audio_stream_index];
 audio_dec_ctx = avcodec_alloc_context3(NULL);
 avcodec_parameters_to_context(audio_dec_ctx, audioStream->codecpar);
 
 audio_dec_codec = avcodec_find_decoder(audio_dec_ctx->codec_id);
 
 if (!audio_dec_codec) {
 fprintf(stderr, "Unsupported audio codec!\n");
 return 1;
 }
 
 if (avcodec_open2(audio_dec_ctx, audio_dec_codec, NULL) < 0) {
 fprintf(stderr, "Error: Could not open Audio decoder codec\n");
 return 1;
 }
 
 audio_enc_codec = avcodec_find_encoder(AV_CODEC_ID_AAC);
 if (!audio_enc_codec) {
 fprintf(stderr, "Error: Audio Encoder codec not found\n");
 return 1;
 }
 
 audio_enc_ctx = avcodec_alloc_context3(audio_enc_codec);
 if (!audio_enc_ctx) {
 fprintf(stderr, "Error: Could not allocate audio encoder codec context\n");
 return 1;
 }

 audioStream->time_base = (AVRational){1, audio_dec_ctx->sample_rate};
 
 audio_enc_ctx->bit_rate = 64000; 
 audio_enc_ctx->sample_rate = audio_dec_ctx->sample_rate;
 audio_enc_ctx->channels = audio_dec_ctx->channels;
 audio_enc_ctx->channel_layout = av_get_default_channel_layout(audio_enc_ctx->channels);
 audio_enc_ctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
 audio_enc_ctx->profile = FF_PROFILE_AAC_LOW;
 
 if (avcodec_open2(audio_enc_ctx, audio_enc_codec, NULL) < 0) {
 fprintf(stderr, "Error: Could not open encoder codec\n");
 return 1;
 }
 
 AVPacket audio_pkt;
 av_init_packet(&audio_pkt);
 audio_pkt.data = NULL;
 audio_pkt.size = 0;
 
 AVFrame *audio_frame = av_frame_alloc();
 if (!audio_frame) {
 fprintf(stderr, "Error: Could not allocate audio frame\n");
 return 1;
 }

 audio_frame->format = audio_enc_ctx->sample_fmt;
 audio_frame->sample_rate = audio_enc_ctx->sample_rate;
 audio_frame->channels = audio_enc_ctx->channels;
 
 AVFormatContext *output_format_ctx = NULL;
 if (avformat_alloc_output_context2(&output_format_ctx, NULL, NULL, pOutName) < 0) {
 fprintf(stderr, "Error: Could not create output context\n");
 return 1;
 }
 
 if (avio_open(&output_format_ctx->pb, pOutName, AVIO_FLAG_WRITE) < 0) {
 fprintf(stderr, "Error: Could not open output file\n");
 return 1;
 }
 
 AVStream *video_stream = avformat_new_stream(output_format_ctx, video_enc_codec);
 if (!video_stream) {
 fprintf(stderr, "Error: Could not create video stream\n");
 return 1;
 }
 
 av_dict_set(&video_stream->metadata, "rotate", "90", 0);
 
 if (avcodec_parameters_from_context(video_stream->codecpar, video_enc_ctx) < 0) {
 fprintf(stderr, "Error: Could not copy video codec parameters\n");
 return 1;
 }
 
 AVStream *audio_stream = avformat_new_stream(output_format_ctx, audio_enc_codec);
 if (!audio_stream) {
 fprintf(stderr, "Error: Could not create audio stream\n");
 return 1;
 }
 
 if (avcodec_parameters_from_context(audio_stream->codecpar, audio_enc_ctx) < 0) {
 fprintf(stderr, "Error: Could not copy audio codec parameters\n");
 return 1;
 }
 
 if (avformat_write_header(output_format_ctx, NULL) < 0) {
 fprintf(stderr, "Error: Could not write header\n");
 return 1;
 }
 
 int video_frame_count = 0, audio_frame_count = 0;
 
 while (1) {

 if (av_read_frame(format_ctx, &pkt) < 0) {
 fprintf(stderr, "BREAK FROM MAIN WHILE LOOP\n");
 break;
 }

 if (pkt.stream_index == video_stream_index) {

 if (avcodec_send_packet(video_dec_ctx, &pkt) < 0) {
 fprintf(stderr, "Error: Could not send video packet for decoding\n");
 return 1;
 }

 while (avcodec_receive_frame(video_dec_ctx, video_frame) == 0) { 

 if (avcodec_send_frame(video_enc_ctx, video_frame) < 0) {
 fprintf(stderr, "Error: Could not send video frame for encoding\n");
 return 1;
 }

 while (avcodec_receive_packet(video_enc_ctx, &video_pkt) == 0) {
 
 if (av_write_frame(output_format_ctx, &video_pkt) < 0) {
 fprintf(stderr, "Error: Could not write video packet to output file.\n");
 return 1;
 }

 av_packet_unref(&video_pkt);
 }

 video_frame_count++;
 }
 } else if (pkt.stream_index == audio_stream_index) {

 if (avcodec_send_packet(audio_dec_ctx, &pkt) < 0) {
 fprintf(stderr, "Error: Could not send audio packet for decoding\n");
 return 1;
 }

 while (avcodec_receive_frame(audio_dec_ctx, audio_frame) == 0) { 
 
 if (avcodec_send_frame(audio_enc_ctx, audio_frame) < 0) {
 fprintf(stderr, "Error: Could not send audio frame for encoding\n");
 return 1;
 }

 while (avcodec_receive_packet(audio_enc_ctx, &audio_pkt) == 0) { if (av_write_frame(output_format_ctx, &audio_pkt) < 0) {
 fprintf(stderr, "Error: Could not write audio packet to output file\n");
 return 1;
 }

 av_packet_unref(&audio_pkt);
 }

 audio_frame_count++;
 }
 }

 av_packet_unref(&pkt);
 }

 if (av_write_trailer(output_format_ctx) < 0) {
 fprintf(stderr, "Error: Could not write trailer\n");
 return 1;
 } 
 
 avformat_close_input(&format_ctx);
 avio_close(output_format_ctx->pb);
 avformat_free_context(output_format_ctx);
 
 av_frame_free(&video_frame);
 avcodec_free_context(&video_dec_ctx);
 avcodec_free_context(&video_enc_ctx);
 av_dict_free(&video_enc_opts);
 
 av_frame_free(&audio_frame);
 avcodec_free_context(&audio_dec_ctx);
 avcodec_free_context(&audio_enc_ctx);

 printf("Conversion complete. %d video frames processed and %d audio frames processed.\n",video_frame_count, audio_frame_count);

 return 0;
}


int main(int argc, char *argv[]) {
 if (argc != 3) {
 printf("Usage: %s \n", argv[0]);
 return 1;
 }

 const char *input_filename = argv[1];
 const char *output_filename = argv[2];

 avcodec_register_all();
 av_register_all();

 int returnValue = encodeVideoAndAudio4(input_filename, output_filename);
 
 return 0;
}




When i comment out the blocks that process one of the two streams, the other stream is converted and written to the output.mp4 successfully.
When each stream is processed in a separate loop, only the first stream is processed and written to the output.mp4 file and the other stream is skipped.
When both streams are processed in a common loop as it is in the code above, the above mentioned error appears.