Hi,
When I starte my program (ctfull) I obtain this output:
m...@debian-meox:~/programmi/ctfull$ ./ctfull
setLowSize: width_out = 144 height_out = 96
VideoDialog::setLowSize QSize(144, 96)
Input #0, mpeg, from '/home/meox/mpeg/Fantozzi_-_Inizio_Film.mpg':
Duration: 00:04:59.31, start: 0.500000, bitrate: 270 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320x240 [PAR 1:1
DAR 4:3], 104857 kb/s, 25 tbr, 90k tbn, 25 tbc
Stream #0.1[0x1c0]: Audio: mp2, 22050 Hz, mono, s16, 64 kb/s
audio sample_rate = 22050
audio channels = 1
audio bit_rate = 64000
Mute = false
[swscaler @ 0x9a579a0]No accelerated colorspace conversion found.
resizeVideo: width_out = 320 height_out = 240
[mp2 @ 0x99d15e0]incorrect frame size
Last message repeated 3 times
[mp2 @ 0x99d15e0]incomplete frame
[Error] len1 = -1
[mp2 @ 0x99d15e0]Header missing skipping one byte.
Last message repeated 51 times
[mp2 @ 0x99d15e0]incorrect frame size
[mp2 @ 0x99d15e0]Header missing skipping one byte.
Last message repeated 51 times
....
The function that decode audio is:
int AudioThread::audio_decode_frame()
{
size_t len = 0;
int data_size = 0, len1 = 0;
while(true)
{
len = 0;
while(audio_pkt_size > 0)
{
data_size = audio_buf_size;
len1 = avcodec_decode_audio2(aCodecCtx, (int16_t
*)audio_buf+len,
&data_size, audio_pkt_data, audio_pkt_size);
if(len1 < 0)
{
qDebug() << "[Error] len1 = " << len1;
audio_pkt_size = 0;
continue;
}
len += len1;
audio_pkt_data += len1;
audio_pkt_size -= len1;
if(data_size <= 0)
{
qDebug() << "[data_size <= 0] len1 = " << len1;
continue;
}
return data_size;
}
if(pkt)
{
av_free(pkt->data);
delete pkt;
pkt = 0;
}
mlock.lock();
if(element > 0)
{
pkt = audioqueue.front();
audio_pkt_data = pkt->data;
audio_pkt_size = pkt->size;
audioqueue.pop();
element--;
}
else
{
audio_pkt_size = 0;
audio_pkt_data = 0;
mlock.unlock();
return -1;
}
mlock.unlock();
}
return -1;
}
Do you have some ideas?
thanks again
On Tue, Feb 9, 2010 at 8:04 PM, Gian Lorenzo Meocci <[email protected]> wrote:
> The problem is in avcodec_decode_audio2, the result is often equal to -1
>
> On Tue, Feb 9, 2010 at 7:51 PM, Ronald S. Bultje <[email protected]> wrote:
>> Hi,
>>
>> On Tue, Feb 9, 2010 at 1:49 PM, Gian Lorenzo Meocci <[email protected]>
>> wrote:
>>> I am new about ffmpeg. I am writing a little audio/video player for my
>>> company.
>>> For some video I obtain always "mp2[...] Header missng skip one byte".
>>>
>>> Why??? Can you help me?
>>
>> That's not very elaborate, can you explain in more detail what you're
>> doing and what fails? Can you reproduce with ffmpeg/ffplay?
>>
>> Ronald
>> _______________________________________________
>> libav-user mailing list
>> [email protected]
>> https://lists.mplayerhq.hu/mailman/listinfo/libav-user
>>
>
>
>
> --
> Ing. Gian Lorenzo Meocci
> http://www.meocci.it
>
--
Ing. Gian Lorenzo Meocci
http://www.meocci.it
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user