Re: [Libav-user] swr_convert_frame returns -1 while converting u8 to s16 audio format

2016-07-18 Thread Carl Eugen Hoyos
  writes:

> /ffmpeg version 0.11.5 Copyright (c) 2000-2014 the FFmpeg developers

This is not supported for a long time.

Sorry, Carl Eugen

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


Re: [Libav-user] How to process incomming AVFrame pointer in a decoder ?

2016-07-18 Thread ssshukla26
Hi guyz,

What I found out is that the decoder is getting *avpkt->size* as *0 (zero)*
under the below function after some 67 frames and hence it closing abruptly.

*int qhw_decode_frame (AVCodecContext *avctx, void *pframe, int *got_frame,
AVPacket *avpkt);*

Can anyone please help. Am so much stuck.



--
View this message in context: 
http://libav-users.943685.n4.nabble.com/Libav-user-How-to-process-incomming-AVFrame-pointer-in-a-decoder-tp4662357p4662365.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


[Libav-user] swr_convert_frame returns -1 while converting u8 to s16 audio format

2016-07-18 Thread rizvan . kuliev

Hi all!

I'm trying to use *swresample *library to resample audio format from 
AV_SAMPLE_FMT_U8 to AV_SAMPLE_FMT_S16.


My file is:

/>ffmpeg -i D:\cam_md_start_1.wav/

/ffmpeg version 0.11.5 Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 26 2014 01:10:12 with gcc 4.9-win32 (GCC)
  configuration: --enable-memalign-hack --arch=x86_64 
--target-os=mingw32 --cross-prefix=x86_64-w64-mingw32- --disable-ffprobe 
--disable-ffplay --build-suffix=-ovs-3.1 --enable-shared 
--disable-static --enable-libass 
--prefix=/home/gzh/sdk/mingw-x86_64/ffmpeg-ovs-3.1

  libavutil  54.  7.100 / 54.  7.100
  libavcodec 56.  1.100 / 56.  1.100
  libavformat56.  4.101 / 56.  4.101
  libavdevice56.  0.100 / 56.  0.100
  libavfilter 5.  1.100 /  5.  1.100
  libswscale  3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
Guessed Channel Layout for  Input Stream #0.0 : mono
Input #0, wav, from 'D:\cam_md_start_1.wav':
  Duration: 00:00:01.49, bitrate: 176 kb/s
Stream #0:0: Audio: *pcm_u8* ([1][0][0][0] / 0x0001), 22050 Hz, 1 
channels, u8, 176 kb/s

At least one output file must be specified

d:\ngp.sdk64\ffmpeg-ovs-3.1\bin>/

The code looks like this:

/std::unique_ptr m_swr;//
//m_swr.reset(swr_alloc());//
//av_opt_set_int(m_swr.get(), "in_channel_layout", 
frame->channel_layout, 0);//
//av_opt_set_int(m_swr.get(), "out_channel_layout", 
frame->channel_layout, 0);//
//av_opt_set_int(m_swr.get(), "in_sample_rate", 
frame->sample_rate, 0);//
//av_opt_set_int(m_swr.get(), "out_sample_rate", 
frame->sample_rate, 0);//
//av_opt_set_sample_fmt(m_swr.get(), "in_sample_fmt", 
(AVSampleFormat)frame->format, 0);//
//av_opt_set_sample_fmt(m_swr.get(), "out_sample_fmt", 
AV_SAMPLE_FMT_S16, 0);//

//swr_init(m_swr.get());//
//std::unique_ptr converted(av_frame_alloc());//
//converted->channel_layout = frame->channel_layout;//
//converted->sample_rate = frame->sample_rate;//
//converted->format = AV_SAMPLE_FMT_S16;//
//int err = swr_convert_frame(m_swr.get(), converted.get(), 
frame.get());/


The problem is that swr_convert_frame returns value -1 and doesn't 
convert the frame.

I have attached input frame as frame.txt and output as converted.txt.

Please, could someone help me to understand why swr_convert_frame fails 
to convert format?


--

AxxonSoft   

Rizvan Kuliev

Programmer

rizvan.kul...@axxonsoft.com 

  
 
 
  
CONFIDENTIALITY NOTICE 


-   frame   unique_ptr {data=0x0256dc92d260 {0x0256dc938c60 
"}~~}}}~~ЂЂЂЂ~~}}~~~~~~~}}}~~~}~}~ЂЂЂЂЂЂ...,
 ...} ...} std::unique_ptr &
-   [ptr]   0x0256dc92d260 {data=0x0256dc92d260 
{0x0256dc938c60 
"}~~}}}~~ЂЂЂЂ~~}}~~~~~~~}}}~~~}~}~ЂЂЂЂЂЂ...,
 ...} ...} AVFrame *
+   data0x0256dc92d260 {0x0256dc938c60 
"}~~}}}~~ЂЂЂЂ~~}}~~~~~~~}}}~~~}~}~ЂЂЂЂЂЂ...,
 ...}   unsigned char *[8]
+   linesize0x0256dc92d2a0 {4096, 0, 0, 0, 0, 0, 0, 0}  
int[8]
+   extended_data   0x0256dc92d260 {0x0256dc938c60 
"}~~}}}~~ЂЂЂЂ~~}}~~~~~~~}}}~~~}~}~ЂЂЂЂЂЂ...}
unsigned char * *
width   0   int
height  0   int
nb_samples  4096int
format  0   int
key_frame   1   int
pict_type   AV_PICTURE_TYPE_NONE (0)AVPictureType
+   base0x0256dc92d2e0 {0x , 
0x , 0x , ...}   unsigned char 
*[8]
+   sample_aspect_ratio {num=0 den=1 }  AVRational
pts -9223372036854775808__int64
pkt_pts 0   __int64
pkt_dts 0   __int64
coded_picture_number0   int
display_picture_number  0   int
quality 0