Re: [Libav-user] How to achieve 30 FPS using APIs on Android?

2016-09-20 Thread Amber Beriwal
Hi,

 

Yes, we built FFMPEG libs by ourselves. What is Neon support?

 

Regards

Amber Beriwal

Newgen Software Technologies Ltd.

 

From: Libav-user [mailto:libav-user-boun...@ffmpeg.org] On Behalf Of William 
MANCON
Sent: Wednesday, September 21, 2016 6:53 AM
To: This list is about using libavcodec, libavformat, libavutil, libavdevice 
and libavfilter. 
Subject: Re: [Libav-user] How to achieve 30 FPS using APIs on Android?

 

Did you built ffmpeg libs by yourself ? is there neon support ? 


Disclaimer :- This e-mail and any attachment may contain confidential, 
proprietary or legally privileged information. If you are not the original 
intended recipient and have erroneously received this message, you are 
prohibited from using, copying, altering or disclosing the content of this 
message. Please delete it immediately and notify the sender. Newgen Software 
Technologies Ltd (NSTL)  accepts no responsibilities for loss or damage arising 
from the use of the information transmitted by this email including damages 
from virus and further acknowledges that no binding nature of the message shall 
be implied or assumed unless the sender does so expressly with due authority of 
NSTL.


___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] How to achieve 30 FPS using APIs on Android?

2016-09-20 Thread William MANCON
Did you built ffmpeg libs by yourself ? is there neon support ?
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Audio encoding: more samples than frame size (avcodec_encode_audio2)

2016-09-20 Thread Yu Ang Tan
>
> > [libvorbis @ 028b1520] more samples than frame size
> > (avcodec_encode_audio2)
>
> Are you sure that you are encoding to flac?
>
>
You were spot on. I was using "test.ogg" instead of "test.flac".

I made the following changes and now it works fine.
-audio_decode_example("test.ogg", "test.sdp");
+audio_decode_example("test.flac", "test.sdp");

-outCodecCtx->sample_fmt = AV_SAMPLE_FMT_FLTP;
+outCodecCtx->sample_fmt = AV_SAMPLE_FMT_S16;   // FLAC uses fixed
point samples

Thanks!
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Demuxer not giving proper data to decoder ?

2016-09-20 Thread Carl Eugen Hoyos
2016-09-15 13:54 GMT+02:00 Carl Eugen Hoyos :
> 2016-09-15 13:41 GMT+02:00 ssshukla26 :
>
> [...]
>
> Did you already look at other hardware decoders in current FFmpeg?

You may be interested to see this patch on -devel:

crystalhd: Use up-to-date bsf API
http://ffmpeg.org/pipermail/ffmpeg-devel/2016-September/199734.html

Carl Eugen
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] Audio encoding: more samples than frame size (avcodec_encode_audio2)

2016-09-20 Thread Carl Eugen Hoyos
2016-09-20 10:02 GMT+02:00 Yu Ang Tan :
> I am trying to read an RTP audio stream, and encode it into a FLAC file.
> However, when I am reading the stream, I get this error:
>
> [libvorbis @ 028b1520] more samples than frame size
> (avcodec_encode_audio2)

Are you sure that you are encoding to flac?

> During debug mode, it seems the frame_size of my input and output codec
> context are mismatched:
>
> inCodecCtx->frame_size = 1152;
> outCodecCtx->frame_size = 64;
>
> I tried to write 1152 to outCodecCtx->frame_size, but it gets overwritten
> with 64 at `avcodec_open2()`. Why can't I set the frame_size to match the
> input frame_size?

My guess is that you are using a different codec for output than for input.

Carl Eugen
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] How to achieve 30 FPS using APIs on Android?

2016-09-20 Thread Amber Beriwal
Hi,

 

Decode Only. We are not generating PNG. These are the timings of obtaining YUV 
data from frame.

 

Regards

Amber Beriwal

Newgen Software Technologies Ltd.

 

From: Libav-user [mailto:libav-user-boun...@ffmpeg.org] On Behalf Of William 
MANCON
Sent: Tuesday, September 20, 2016 3:31 PM
To: This list is about using libavcodec, libavformat, libavutil, libavdevice 
and libavfilter. 
Subject: Re: [Libav-user] How to achieve 30 FPS using APIs on Android?

 

thoses time are the time to decode and generate the png ? 


Disclaimer :- This e-mail and any attachment may contain confidential, 
proprietary or legally privileged information. If you are not the original 
intended recipient and have erroneously received this message, you are 
prohibited from using, copying, altering or disclosing the content of this 
message. Please delete it immediately and notify the sender. Newgen Software 
Technologies Ltd (NSTL)  accepts no responsibilities for loss or damage arising 
from the use of the information transmitted by this email including damages 
from virus and further acknowledges that no binding nature of the message shall 
be implied or assumed unless the sender does so expressly with due authority of 
NSTL.


___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


[Libav-user] UDP streaming from one PC to another

2016-09-20 Thread Timur Guseynov
Hi.

I am wondering if I can stream with ffmpeg from one PC via UDP to another
and the second one has ffmpeg using this stream as an input and save to
file?

Can I do it via CLI?
Will I be able to do the same programatically using its API?

Kind regards,
Timur Guseynov
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


Re: [Libav-user] How to achieve 30 FPS using APIs on Android?

2016-09-20 Thread William MANCON
thoses time are the time to decode and generate the png ?
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user


[Libav-user] Audio encoding: more samples than frame size (avcodec_encode_audio2)

2016-09-20 Thread Yu Ang Tan
I am trying to read an RTP audio stream, and encode it into a FLAC file.
However, when I am reading the stream, I get this error:

[libvorbis @ 028b1520] more samples than frame size
(avcodec_encode_audio2)

During debug mode, it seems the frame_size of my input and output codec
context are mismatched:

inCodecCtx->frame_size = 1152;
outCodecCtx->frame_size = 64;

I tried to write 1152 to outCodecCtx->frame_size, but it gets overwritten
with 64 at `avcodec_open2()`. Why can't I set the frame_size to match the
input frame_size? Should I create an additional output frame to copy the
contents over in a loop?

I'd really appreciate it if you could help me some help or suggestions.

Here is my source:

//
// Test with this command: ffmpeg -re -f lavfi -i
aevalsrc="atan(t/2)*sin(400*2*PI*t)" -ar 16000 -c:a pcm_s16be -f rtp rtp://
127.0.0.1:8554
// ffmpeg -f dshow -i audio="Microphone (High Definition Audio Device)"
-ar 16000 -c:a pcm_s16be -ac 1 -f rtp rtp://127.0.0.1:8554
// Working code

#include "stdafx.h"
#include 
extern "C"
{
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
}

#define AUDIO_INBUF_SIZE 20480

#define ERRBUFFLEN 200
char errbuf[ERRBUFFLEN];
#define av_err2str(ret) av_strerror(ret, errbuf, ERRBUFFLEN)
const int samp_rate = 16000;
int count = 0;
// Callback function
int _ffmpeg_interrupt_fcn(void* ptr)
{
int  = *((int*)ptr);
//double  = *((double*)ptr);
r += 1;
printf("Interrupted! %d\n", r);
if (r > 30) return 1;
return 0;
}

static int write_frame(AVFormatContext *fmt_ctx, const AVRational
*time_base, AVStream *st, AVPacket *pkt)
{
/* rescale output packet timestamp values from codec to stream
timebase */
av_packet_rescale_ts(pkt, *time_base, st->time_base);
pkt->stream_index = st->index;

/* Write the compressed frame to the media file. */
#ifdef DEBUG_PACKET
log_packet(fmt_ctx, pkt);
#endif
return av_interleaved_write_frame(fmt_ctx, pkt);
}

/*
* Audio decoding.
*/
static void audio_decode_example(const char *outfilename, const char
*filename)
{
int len;
FILE *f, *outfile;
uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
AVPacket inpkt, outpkt;

AVCodec *inCodec = NULL;
AVCodecContext *inCodecCtx = NULL;
AVFrame *decoded_frame = NULL;
AVFormatContext *inFormatCtx = NULL;

AVCodec *outCodec = NULL;
AVCodecContext *outCodecCtx = NULL;
AVFormatContext *outFormatCtx = NULL;
AVStream * outAudioStream = NULL;


int ret;

av_init_packet();

AVDictionary *d = NULL;   // "create" an empty dictionary
av_dict_set(, "protocol_whitelist", "file,udp,rtp", 0); // add an
entry

// Open video file
ret = avformat_open_input(, filename, NULL, );
if (ret <0)
{
printf_s("Failed: cannot open input.\n");
av_strerror(ret, errbuf, ERRBUFFLEN);
fprintf(stderr, "avformat_open_input() fail: %s\n", errbuf);
exit(1);
}

printf_s("Retrieve stream information.\n");
ret = avformat_find_stream_info(inFormatCtx, NULL);
if (ret <0)
{
printf_s("Failed: cannot find stream.\n");
av_strerror(ret, errbuf, ERRBUFFLEN);
fprintf(stderr, "avformat_find_stream_info() fail: %s\n",
errbuf);
exit(1);
}

av_dump_format(inFormatCtx, 0, filename, 0);

int stream_idx = -1;

for (int i = 0; i < inFormatCtx->nb_streams; i++)
if (inFormatCtx->streams[i]->codec->codec_type ==
AVMEDIA_TYPE_AUDIO) {
stream_idx = i;
break;
}
if (stream_idx == -1)
{
fprintf(stderr, "Video stream not found\n");
exit(1);
}

inCodec =
avcodec_find_decoder(inFormatCtx->streams[stream_idx]->codec->codec_id);
if (!inCodec) {
fprintf(stderr, "Codec not found\n");
exit(1);
}

inCodecCtx = avcodec_alloc_context3(inCodec);
if (!inCodecCtx) {
fprintf(stderr, "Could not allocate audio codec context\n");
exit(1);
}

inCodecCtx->channels = 1;

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

// Set output
ret = avformat_alloc_output_context2(, NULL, NULL,
outfilename);
if (!outFormatCtx || ret < 0)
{
fprintf(stderr, "Could not allocate output context");
}
outFormatCtx->flags |= AVFMT_FLAG_NOBUFFER |
AVFMT_FLAG_FLUSH_PACKETS;

[Libav-user] Memory leak while using ff_get_buffer ?

2016-09-20 Thread ssshukla26
I am using *ff_get_buffer* in my decoder, it seems to me that using this API
causing some memory leak. Please help, need your suggestions on this !



--
View this message in context: 
http://libav-users.943685.n4.nabble.com/Libav-user-Memory-leak-while-using-ff-get-buffer-tp4662720.html
Sent from the libav-users mailing list archive at Nabble.com.
___
Libav-user mailing list
Libav-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/libav-user