Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Howto Merge .WAV files - with a repeating shorter wav file ?
11 octobre 2011, par SeanNieuwoudtI need to take two WAV files (mysound.wav[10 seconds] and watermark.wav[1 second]) and merge the two together.
The problem is that the new generated file needs to have watermark.wav repeating for the duration of mysound.wav.
How do I do this via the CLI or script? I know about SoX and FFmpeg, but have not been successful at getting this work.
Thanks in advance :)
-
FFMPEG in android
11 octobre 2011, par KrishnenduIi am trying to reduce the video size capture by default camera (it's generating high resolution video) in Android. Does FFMPEG have a property to encode a video with given resolution? I try to Google, but all examples are using command line mode for FFMPEG.
My questions are:
- Can we use ffmpeg command line in Android?
- If not then how we will achieve it?
- Can we able record a video directly using ffmpeg in Android?
- Is there any other solution for this?
-
Feasibility of Decoupling DVB subtitle functionality from ffmpeg
10 octobre 2011, par AlsWe are trying to implement a DVB subtitle decoder using ffmpeg, We only need to use this particular feature(subtitle-libav codec) of
ffmpeg
Since we already have our own implementations for the other features. We noticed that the code imlpementation which does this is limited to a few number of files, but we are not sure how easily this can be decoupled from theffmpeg
.
So, the Q is:
Is is it feasible to customize/refactor theffmpeg
so that we can decouple the DVB subtitle functionality for our use, And how advicable it is to do so? -
Converting YUV420SP to YUV420P
10 octobre 2011, par limitfanHow do I to convert YUV420SP to YUV420P using ffmpeg sws_scale or another efficient method?
-
iPhone ffmpeg dev using libav to decode from AMR to ACC codec
10 octobre 2011, par VictorTIt seems to be that, the AMR support of AudioQueue has been disappeared since iOS 4.3 was released. I can't use audio frame received from RSTP server with old way:
audioFormat.mFormatID = kAudioFormatAMR; int err = AudioQueueNewOutput(&audioFormat, MyAudioQueueOutputCallback, self, NULL, kCFRunLoopCommonModes, 0, &audioQueue);
As a result I received an error in last string.
Maybe someone know how to decode AMR AVPacket into raw buffer and encode it with AAC or MP3 using LIBAV?
I've tried to use
avcodec_decode_audio3
It works and I can get raw buffer but when I'm trying to encode it with
avcodec_encode_audio
I get 0 as result
This is my method to encode buffer:
- (AVPacket) encodeRawFrame:(const short *) in_buffer withSize:(unsigned int) in_buf_byte_size { AVPacket res; AVCodec *codec; AVCodecContext *c= NULL; int count, out_size, outbuf_size, frame_byte_size; uint8_t *outbuf; avcodec_init(); avcodec_register_all(); printf("Audio encoding\n"); codec = avcodec_find_encoder(CODEC_ID_AAC); if (!codec) { fprintf(stderr, "codec not found\n"); return res; } c= avcodec_alloc_context(); c->bit_rate = 64000; c->sample_rate = 24000; c->channels = 2; if (avcodec_open(c, codec) < 0) { fprintf(stderr, "could not open codec\n"); } else { frame_byte_size=c->frame_size*2*2; count = in_buf_byte_size/frame_byte_size; fprintf(stderr, "Number of frames: %d\n", count); outbuf_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; outbuf = (uint8_t*) malloc(outbuf_size); out_size = avcodec_encode_audio(c, outbuf, outbuf_size, &in_buffer[frame_byte_size*i]); if(out_size >= 0) { res.size = outbuf_size; res.data = malloc(outbuf_size); } free(outbuf); } avcodec_close(c); av_free(c); return res; }
After encoding "out_size" is always 0 and result buffer is empty.
Thanks.