
Recherche avancée
Médias (91)
-
Spitfire Parade - Crisis
15 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Audio
-
Wired NextMusic
14 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Video d’abeille en portrait
14 mai 2011, par
Mis à jour : Février 2012
Langue : français
Type : Video
-
Sintel MP4 Surround 5.1 Full
13 mai 2011, par
Mis à jour : Février 2012
Langue : English
Type : Video
-
Carte de Schillerkiez
13 mai 2011, par
Mis à jour : Septembre 2011
Langue : English
Type : Texte
-
Publier une image simplement
13 avril 2011, par ,
Mis à jour : Février 2012
Langue : français
Type : Video
Autres articles (67)
-
Use, discuss, criticize
13 avril 2011, parTalk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
A discussion list is available for all exchanges between users. -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
-
Les tâches Cron régulières de la ferme
1er décembre 2010, parLa gestion de la ferme passe par l’exécution à intervalle régulier de plusieurs tâches répétitives dites Cron.
Le super Cron (gestion_mutu_super_cron)
Cette tâche, planifiée chaque minute, a pour simple effet d’appeler le Cron de l’ensemble des instances de la mutualisation régulièrement. Couplée avec un Cron système sur le site central de la mutualisation, cela permet de simplement générer des visites régulières sur les différents sites et éviter que les tâches des sites peu visités soient trop (...)
Sur d’autres sites (10221)
-
convert MOV to mp4 using transcode
3 janvier 2017, par koemI want to convert a MOV from my Casio cam to mp4 using transcode. Why transcode ? Because I also want to deshake the video in the same step.
When I use
ffmpeg -i in.MOV out.mp4
it works. When using
transcode -J stabilize -i in.MOV
or
transcode -J transform -i in.MOV -y ffmpeg -F mpeg4 -o out.mp4
I get hundreds of these errors :
[ffmpeg_audio] Error: avcodec_open2 failed
[adpcm_ima_wav @ 0x1f7f180] Only 4-bit ADPCM IMA WAV files are supportedThis looks to me as if transcode uses ffmpeg internally.
I could use ffmpeg to make it mp4 first and then use transcode to stabilize the video, but then it would be re-encoded twice which I would like to avoid.
This is what mplayer says about my MOV file :
MPlayer2 2.0-701-gd4c5b7f-2ubuntu2 (C) 2000-2012 MPlayer Team
Cannot open file '/home/koem/.mplayer/input.conf': No such file or directory
Failed to open /home/koem/.mplayer/input.conf.
Cannot open file '/etc/mplayer/input.conf': No such file or directory
Failed to open /etc/mplayer/input.conf.
Playing 1-original.MOV.
Detected file format: QuickTime / MOV (libavformat)
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (adpcm_ima_wav), -aid 0, -alang eng
Clip info:
major_brand: qt
minor_version: 537921536
compatible_brands: qt caqv
creation_time: 2017-01-02 23:31:38
Load subtitles in .
Failed to open VDPAU backend libvdpau_i965.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
[ass] auto-open
Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [libavcodec]
Selected audio codec: ADPCM IMA WAV [libavcodec]
AUDIO: 44100 Hz, 2 ch, s16le, 352.8 kbit/25.00% (ratio: 44100->176400)
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
VIDEO: 1920x1080 29.970 fps 15940.0 kbps (1992.5 kB/s)
VO: [xv] 1920x1080 => 1920x1080 Planar YV12
Colorspace details not fully supported by selected vo.
A: 1.1 V: 1.1 A-V: -0.000 ct: 0.000 0/ 0 16% 8% 1.6% 0 0
Exiting... (Quit)How can I make it work with transcode without using ffmpeg first ?
-
FFmpeg API - transcoding and sending pulseaudio input (rtsp)
16 octobre 2020, par user3469024My goal is to read pulseaudio microphone audio input and send it via rtsp encoded as opus. To play stream I am using ffplay.


What step am I missing ? Currently I am hearing only noise when receiving stream. What is interesting,
av_dump_format
shows correct output :

Input #0, pulse, from 'default':
 Duration: N/A, start: 1602879120.276839, bitrate: 1536 kb/s
 Stream #0:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Output #0, rtsp, to 'rtsp://localhost:8191/call':
 Stream #0:0: Audio: opus, 8000 Hz, mono, s16, 16 kb/s




but ffplay shows different stream parameters :


Input #0, rtsp, from 'rtsp://localhost:8191/call':sq= 0B f=0/0 
 Metadata:
 title : No Name
 Duration: N/A, start: 51444.871521, bitrate: N/A
 Stream #0:0: Audio: opus, 48000 Hz, stereo, fltp




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

int main(int argc, char *argv[])
{
 int ret,got_frame,got_packet;
 const char *audio_input;
 const char *output;
 AVOutputFormat *out_format = NULL;
 AVInputFormat *in_format = NULL;
 AVFormatContext *in_format_ctx = NULL;
 AVFormatContext *out_format_ctx = NULL;
 AVCodec *in_codec = NULL;
 AVCodecContext *in_codec_ctx = NULL;
 AVCodec *out_codec = NULL;
 AVCodecContext *out_codec_ctx = NULL;
 AVPacket packet = { .data = NULL, .size = 0 };
 AVFrame *frame = NULL;
 AVDictionary *opt = NULL;
 AVStream *ost;

 av_register_all();
 avdevice_register_all();

 audio_input = argv[1];
 output = argv[2];

 //INPUT
 //Open input in selected format
 in_format = av_find_input_format("pulse");
 if((ret = avformat_open_input(&in_format_ctx, audio_input, in_format, NULL))!=0)
 {
 fprintf(stderr,"Could not open audio input: %s. %s\n",audio_input,av_err2str(ret));
 exit(1);
 }

 //Find stream info in header and display
 if((ret = avformat_find_stream_info(in_format_ctx, NULL))<0)
 {
 fprintf(stderr,"Could not find stream information. %s\n",av_err2str(ret));
 exit(1);
 }

 av_dump_format(in_format_ctx, 0, audio_input, 0);

 in_codec = avcodec_find_decoder(in_format_ctx->streams[0]->codec->codec_id);
 if(in_codec==NULL) {
 fprintf(stderr, "Unsupported decoder.\n");
 exit(1);
 }

 //Allocate memory for microphone input codec context (all information)
 in_codec_ctx = avcodec_alloc_context3(in_codec);
 if((ret = avcodec_copy_context(in_codec_ctx, in_format_ctx->streams[0]->codec)) != 0) {
 fprintf(stderr, "Couldn't copy codec context. %s\n",av_err2str(ret));
 exit(1);
 }

 //Use selected codec and codec context
 if((ret = avcodec_open2(in_codec_ctx, in_codec, NULL))<0)
 {
 fprintf(stderr, "Could not open audio codec. %s\n",av_err2str(ret));
 exit(1);
 }


 //OUTPUT
 ret = avformat_alloc_output_context2(&out_format_ctx, NULL, "rtsp", output);
 if (!out_format_ctx) {
 fprintf(stderr, "Output format ptoblem. %s\n",av_err2str(ret));
 exit(1);
 }

 out_format = out_format_ctx->oformat;
 /* open the output file, if needed */

 out_codec = avcodec_find_encoder(AV_CODEC_ID_OPUS);
 if(out_codec==NULL) {
 fprintf(stderr, "Unsupported encoder.\n");
 exit(1);
 }

 out_codec_ctx = avcodec_alloc_context3(out_codec);
 if (!out_codec_ctx) {
 fprintf(stderr, "Could not alloc an encoding context\n");
 exit(1);
 }

 /* check that the encoder supports s16 pcm input */
 out_codec_ctx->sample_fmt = AV_SAMPLE_FMT_S16;
 out_codec_ctx->bit_rate = 16000;
 out_codec_ctx->sample_rate = 8000;
 out_codec_ctx->channels = 1;
 out_codec_ctx->channel_layout = AV_CH_LAYOUT_MONO;
 out_codec_ctx->channels = av_get_channel_layout_nb_channels(out_codec_ctx->channel_layout);

 if (out_format_ctx->oformat->flags & AVFMT_GLOBALHEADER)
 out_codec_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;

 ret = avcodec_open2(out_codec_ctx, out_codec, NULL);
 if (ret < 0) {
 fprintf(stderr, "Could not open audio codec: %s\n", av_err2str(ret));
 exit(1);
 }

 ost = avformat_new_stream(out_format_ctx, NULL);
 if (!ost) {
 fprintf(stderr, "Could not allocate stream\n");
 exit(1);
 }
 ost->id=0;

 ret = avcodec_parameters_from_context(ost->codecpar, out_codec_ctx);
 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Failed to copy encoder parameters to output stream. %s\n",av_err2str(ret));
 return ret;
 }

 ost->time_base = out_codec_ctx->time_base;

 av_dump_format(out_format_ctx, 0, output, 1);

 /* copy the stream parameters to the muxer */
 ret = avcodec_parameters_from_context(ost->codecpar, out_codec_ctx);
 if (ret < 0) {
 fprintf(stderr, "Could not copy the stream parameters. %s\n",av_err2str(ret));
 exit(1);
 }

 if (!(out_format_ctx->oformat->flags & AVFMT_NOFILE)) {
 ret = avio_open(&out_format_ctx->pb, output, AVIO_FLAG_WRITE);
 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Could not open output file '%s'", output);
 return ret;
 }
 }

 /* init muxer, write output file header */
 ret = avformat_write_header(out_format_ctx, NULL);
 if (ret < 0) {
 av_log(NULL, AV_LOG_ERROR, "Error occurred when opening output file\n");
 return ret;
 }

 while(1)
 {
 if((ret = av_read_frame(in_format_ctx, &packet)) < 0)
 {
 fprintf(stderr, "Reading frame failed. %s\n",av_err2str(ret));
 break;
 }

 frame = av_frame_alloc();
 if (!frame) {
 ret = AVERROR(ENOMEM);
 break;
 }

 av_packet_rescale_ts(&packet,in_format_ctx->streams[0]->time_base,in_codec_ctx->time_base);

 if((ret = avcodec_decode_audio4(in_codec_ctx,frame,&got_frame,&packet)) < 0)
 {
 av_frame_free(&frame);
 fprintf(stderr, "Audio decoding failed. %s\n",av_err2str(ret));
 break;
 }

 frame->nb_samples = out_codec_ctx->frame_size;
 if((ret = av_frame_get_buffer(frame, 0))<0)
 {
 fprintf(stderr, "Error allocating an audio buffer. %s\n",av_err2str(ret));
 break;
 }

 if(got_frame)
 {
 if((ret = avcodec_encode_audio2(out_codec_ctx,&packet,frame,&got_packet)) < 0)
 {
 av_frame_free(&frame);
 fprintf(stderr, "Audio encoding failed. %d %s\n",ret,av_err2str(ret));
 break;
 }
 }
 av_frame_free(&frame);

 if(got_packet)
 {
 if((ret = av_interleaved_write_frame(out_format_ctx,&packet)) < 0)
 {
 av_packet_unref(&packet);
 fprintf(stderr, "Writing frame error. %s\n",av_err2str(ret));
 break;
 }
 }
 av_packet_unref(&packet);
 }
}




-
Re-sampling H264 video to reduce frame rate while maintaining high image quality
4 mars 2019, par BrianTheLionHere’s the mplayer output for a video of interest :
br@carina:/tmp$ mplayer foo.mov
mplayer: Symbol `ff_codec_bmp_tags' has different size in shared object, consider re-linking
MPlayer 1.0rc4-4.5.2 (C) 2000-2010 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing foo.mov.
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang eng
VIDEO: [H264] 1280x720 24bpp 59.940 fps 2494.2 kbps (304.5 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 15999->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
VO: [vdpau] 1280x720 => 1280x720 Planar YV12I’d like to use ffmpeg, mencoder, or some other command-line video transcoder to re-sample this video to a lower framerate without loss of image quality. That is, each frame should remain as crisp as possible.
Attempts
ffmpeg -i foo.mov -r 25 -vcodec copy bar.mov
- The target frame rate — 25fps — is achieved but individual frames are "blocky."
mencoder -nosound -ovc copy foo.mov -ofps 25 -o bar.mov
- Videos are effectively un-viewable.
Help !
This seems like a simple enough use case. I’m very surprised that obvious things are not working. Is there something wrong with my approach ?