
Recherche avancée
Médias (29)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (10)
-
Contribute to translation
13 avril 2011You can help us to improve the language used in the software interface to make MediaSPIP more accessible and user-friendly. You can also translate the interface into any language that allows it to spread to new linguistic communities.
To do this, we use the translation interface of SPIP where the all the language modules of MediaSPIP are available. Just subscribe to the mailing list and request further informantion on translation.
MediaSPIP is currently available in French and English (...) -
Selection of projects using MediaSPIP
2 mai 2011, parThe examples below are representative elements of MediaSPIP specific uses for specific projects.
MediaSPIP farm @ Infini
The non profit organizationInfini develops hospitality activities, internet access point, training, realizing innovative projects in the field of information and communication technologies and Communication, and hosting of websites. It plays a unique and prominent role in the Brest (France) area, at the national level, among the half-dozen such association. Its members (...) -
Installation en mode ferme
4 février 2011, parLe mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
C’est la méthode que nous utilisons sur cette même plateforme.
L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)
Sur d’autres sites (3150)
-
Failed to use h264_v4l2 codec in ffmpeg to decode video
6 janvier, par wangt13I am working on an embedded Linux system (kernel-5.10.24) and I want to use
ffmpeg
libraries (ffmpeg-4.4.4) to do video decoding.

The C code is as follows, it uses
h264_v4l2m2m
decoder to decode the video,

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

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

 const char *input_file = argv[1];
 const char *output_file = argv[2];

 AVFormatContext *fmt_ctx = NULL;
 AVCodecContext *codec_ctx = NULL;
 AVCodec *codec = NULL;
 AVPacket pkt;
 AVFrame *frame = NULL;
 AVFrame *rgb_frame = NULL;
 struct SwsContext *sws_ctx = NULL;

 FILE *output = NULL;
 int video_stream_index = -1;

 avformat_network_init();

 if (avformat_open_input(&fmt_ctx, input_file, NULL, NULL) < 0) {
 fprintf(stderr, "Could not open input file %s\n", input_file);
 return -1;
 }

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

 for (int i = 0; i < fmt_ctx->nb_streams; i++) {
 if (fmt_ctx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
 video_stream_index = i;
 break;
 }
 }

 if (video_stream_index == -1) {
 fprintf(stderr, "Could not find video stream\n");
 return -1;
 }

 //// codec = avcodec_find_decoder(fmt_ctx->streams[video_stream_index]->codecpar->codec_id);
 codec = avcodec_find_decoder_by_name("h264_v4l2m2m");
 if (!codec) {
 fprintf(stderr, "Codec not found\n");
 return -1;
 }

 codec_ctx = avcodec_alloc_context3(codec);
 if (!codec_ctx) {
 fprintf(stderr, "Could not allocate codec context\n");
 return -1;
 }

 if (avcodec_parameters_to_context(codec_ctx, fmt_ctx->streams[video_stream_index]->codecpar) < 0) {
 fprintf(stderr, "Failed to copy codec parameters to decoder context\n");
 return -1;
 }

 if (avcodec_open2(codec_ctx, codec, NULL) < 0) {
 fprintf(stderr, "Could not open codec\n");
 return -1;
 }

 output = fopen(output_file, "wb");
 if (!output) {
 fprintf(stderr, "Could not open output file %s\n", output_file);
 return -1;
 }

 frame = av_frame_alloc();
 rgb_frame = av_frame_alloc();
 if (!frame || !rgb_frame) {
 fprintf(stderr, "Could not allocate frames\n");
 return -1;
 }

 int width = codec_ctx->width;
 int height = codec_ctx->height;
 int num_bytes = av_image_get_buffer_size(AV_PIX_FMT_RGB24, width, height, 1);
 uint8_t *buffer = (uint8_t *)av_malloc(num_bytes * sizeof(uint8_t));
 av_image_fill_arrays(rgb_frame->data, rgb_frame->linesize, buffer, AV_PIX_FMT_RGB24, width, height, 1);

printf("XXXXXXXXXXXX width: %d, height: %d, fmt: %d\n", width, height, codec_ctx->pix_fmt);
 sws_ctx = sws_getContext(width, height, codec_ctx->pix_fmt,
 width, height, AV_PIX_FMT_RGB24,
 SWS_BILINEAR, NULL, NULL, NULL);
 if (!sws_ctx) {
 fprintf(stderr, "Could not initialize the conversion context\n");
 return -1;
 }

 while (av_read_frame(fmt_ctx, &pkt) >= 0) {
 if (pkt.stream_index == video_stream_index) {
 int ret = avcodec_send_packet(codec_ctx, &pkt);
 if (ret < 0) {
 fprintf(stderr, "Error sending packet for decoding\n");
 return -1;
 }

 while (ret >= 0) {
 ret = avcodec_receive_frame(codec_ctx, frame);
 if (ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) {
 break;
 } else if (ret < 0) {
 fprintf(stderr, "Error during decoding\n");
 return -1;
 }

 sws_scale(sws_ctx, (const uint8_t *const *)frame->data, frame->linesize,
 0, height, rgb_frame->data, rgb_frame->linesize);

 fprintf(output, "P6\n%d %d\n255\n", width, height);
 fwrite(rgb_frame->data[0], 1, num_bytes, output);
 }
 }
 av_packet_unref(&pkt);
 }

 fclose(output);
 av_frame_free(&frame);
 av_frame_free(&rgb_frame);
 avcodec_free_context(&codec_ctx);
 avformat_close_input(&fmt_ctx);
 sws_freeContext(sws_ctx);

 return 0;
}



It ran with some error logs from
swscale
as follows,

# ./test_ffmpeg ./test.mp4 /tmp/output
[h264_v4l2m2m @ 0x1d76320] Using device /dev/video0
[h264_v4l2m2m @ 0x1d76320] driver 'mysoc-vdec' on card 'msoc-vdec' in mplane mode
[h264_v4l2m2m @ 0x1d76320] requesting formats: output=H264 capture=NV12
[h264_v4l2m2m @ 0x1d76320] the v4l2 driver does not support end of stream VIDIOC_SUBSCRIBE_EVENT
XXXXXXXXXXXX width: 1280, height: 720, fmt: 0
[swscaler @ 0x1dadaa0] No accelerated colorspace conversion found from yuv420p to rgb24.
[h264_v4l2m2m @ 0x1d76320] VIDIOC_G_SELECTION ioctl
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
[swscaler @ 0x1dadaa0] bad src image pointers
......



And it ran for about 4 seconds, while the
test.mp4
is about 13 seconds.
If I did NOT specify theh264_v4l2m2m
as the decoder, there is NObad src image pointers
and its run-time is as long as themp4
file.

What is wrong with above codes using
h264_v4l2m2m
and how to fix it ?

-
ffmpeg fails to connect to pulse audio when scheduled through cron
4 février 2017, par BarrettI would like to start ffmpeg to capture audio from pulse through a cron task. I am currently running Linux arch 4.8.13-1-ARCH #1 SMP PREEMPT x86_64 GNU/Linux.
$ ffmpeg
ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 6.2.1 (GCC) 20160830
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab
libavutil 55. 34.100 / 55. 34.100
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.100 / 57. 56.100
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: MID [HDA Intel MID], device 0: CX20583 Analog [CX20583 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0/usr/local/sbin/ffmpeg-audio
#! /bin/sh
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
n=$(date +"%s")
out="/home/user/audio/out"$n".mp3"
cd /
echo -e $USER" "$(id -u)"\n"$out"\n" > $out.txt
/usr/bin/ffmpeg -y -f alsa -i pulse -t 5 -codec:a libmp3lame -q:a 9 "file:"$out$ crontab -l
* * * * * /usr/local/sbin/ffmpeg-audio
$ journalctl -u cronie
Feb 04 11:51:01 arch crond[8913]: pam_unix(crond:session): session opened for user user by (uid=0)
Feb 04 11:51:01 arch CROND[8914]: (user) CMD (/usr/local/sbin/ffmpeg-audio)
Feb 04 11:51:01 arch sudo[8919]: user : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/ffmpeg -y -f alsa -i pulse -t 5 -codec:a libmp3lame -q:a 9 file:/home/user/audio/out1486237861.mp3
Feb 04 11:51:01 arch sudo[8919]: pam_unix(sudo:session): session opened for user root by (uid=0)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT (ffmpeg version 3.2.2 Copyright (c) 2000-2016 the FFmpeg developers)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( built with gcc 6.2.1 (GCC) 20160830)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-netcdf --enable-shared --enable-version3 --enable-x11grab)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavutil 55. 34.100 / 55. 34.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavcodec 57. 64.101 / 57. 64.101)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavformat 57. 56.100 / 57. 56.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavdevice 57. 1.100 / 57. 1.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavfilter 6. 65.100 / 6. 65.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libavresample 3. 1. 0 / 3. 1. 0)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libswscale 4. 2.100 / 4. 2.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libswresample 2. 3.100 / 2. 3.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ( libpostproc 54. 1.100 / 54. 1.100)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT (ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused)
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ()
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT ([alsa @ 0x55a46e0144a0] cannot open audio device pulse (Connection refused))
Feb 04 11:51:01 arch CROND[8913]: (user) CMDOUT (pulse: Input/output error)
Feb 04 11:51:01 arch sudo[8919]: pam_unix(sudo:session): session closed for user root
Feb 04 11:51:01 arch CROND[8913]: pam_unix(crond:session): session closed for user userffmpeg runs correctly from the command line and ’$ which ffmpeg-audio’ returns /usr/local/sbin/ffmpeg-audio, but ffmpeg returns
([alsa @ 0x55a46e0144a0] cannot open audio device pulse (Connection
refused))when scheduled through cron.
Any suggestions ?
-
ffmpeg Non monotonous DTS, Previous DTS is always the same, audio microphone streaming [closed]
5 février, par adrien gonzalezI'm using ffmpeg to stream audio from a microphone using rtp. I'm on Raspberry and use an external sound card (HifiBerry DAC + ADC Pro).
My goal is to stream audio with the lowest latency possible to others Raspberry reading this audio with ffplay. I try not to compress the audio flux and leave it untouched as wav 48000 Hz.
I encounter often some Non Monotonous DTS errors. When this happens I have a latency of hundred of milliseconds adding itself.
I tried to add the +igndts flag but it is not changing anything. Also tried +genpts flag.


What is weird is that the previous DTS is always the same (201165 is the example below) and does not seems to change.
I looked on forums for answers but I'm unable to find one.


Here is my bash command :


ffmpeg -guess_layout_max 0 -re -f alsa -i hw -acodec pcm_s16le -ac 1 -payload_type 10 -f rtp rtp://192.168.1.152:5003


And the result from the terminal :


ffmpeg version 5.1.6-0+deb12u1+rpt1 Copyright (c) 2000-2024 the FFmpeg developers


built with gcc 12 (Debian 12.2.0-14)
 configuration: --prefix=/usr --extra-version=0+deb12u1+rpt1 --toolchain=hardened --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --disable-mmal --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sand --enable-sdl2 --disable-sndio --enable-libjxl --enable-neon --enable-v4l2-request --enable-libudev --enable-epoxy --libdir=/usr/lib/aarch64-linux-gnu --arch=arm64 --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
Input #0, alsa, from 'hw':
 Duration: N/A, start: 1738663653.066577, bitrate: 1536 kb/s
 Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Stream mapping:
 Stream #0:0 -> #0:0 (pcm_s16le (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
Output #0, rtp, to 'rtp://192.168.1.152:5003':
 Metadata:
 encoder : Lavf59.27.100
 Stream #0:0: Audio: pcm_s16le, 48000 Hz, mono, s16, 768 kb/s
 Metadata:
 encoder : Lavc59.37.100 pcm_s16le
SDP:
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 192.168.1.152
t=0 0
a=tool:libavformat LIBAVFORMAT_VERSION
m=audio 5003 RTP/AVP 10
b=AS:768

[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201160; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201155; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201149; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201142; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201134; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201124; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201114; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201102; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201089; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201075; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201060; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201044; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201027; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 201009; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 200990; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 200970; changing to 201165. This may result in incorrect timestamps in the output file.
[rtp @ 0x558b48ea90] Non-monotonous DTS in output stream 0:0; previous: 201165, current: 200949; changing to 201165. This may result in incorrect timestamps in the output file.



I tried to add the +igndts flag but it is not changing anything. Also tried +genpts flag. I expected the DTS to restore itself but I still have the same issue