Bug#789254: This sample seems not to be processable by FFmpeg

Peter Belkner pbelkner at snafu.de
Mon Jun 22 08:27:22 UTC 2015

On 22.06.2015 09:55, Petter Reinholdtsen wrote:
> [Peter Belkner]
>> I was testing with Winamp and the FFmpeg based "in_ffsox" input plugin.
>> It was not "stuttering" at all. I discovered "stuttering" only when
>> testing with VLC player.
> Aha.
>> Meanwhile I've learned that we have two issues:
>>   1. "20030213-cvs.mpeg" had not processed at all (i.e. just loudness
>>      analysis was aborting with an error and hence it could not have
>>      "stuttered")
>>   2. "DavidGallo_2007.dv" stutters.
> Aha.  That is strange, as I am quite sure I tested it before reporting
> the bug.  Anyway, I trust your observations and must remember
> incorrectly.
>> The (previous) patch solves the first issue. The idea is to throw away
>> packages FFmpeg cannot deal with.
> Given that it only happen once, I guess the package is at the start or
> at the end.  Perhaps the message should be extended to mention how far
> into the stream the package is dropped.

The FFmpeg example "ffmpeg/doc/examples/decoding_encoding.c" aborts in 
such a case:

    len = avcodec_decode_audio4(c, decoded_frame, &got_frame, &avpkt);
    if (len < 0) {
         fprintf(stderr, "Error while decoding\n");

On the other hand the  FFmpeg program silently deals with the file.

I don't think that it is a good idea to let BS1770GAIN re-implemet large 
portions of FFmpeg.

Maybe we should revert to the original behavior of aborting in case 
avcodec_decode_audio4() fails and make it in option to continue in case 
of an error. It's then up to the user to see whether it makes sense.

> Am I right in believing that many such dropped packages in the middle of
> the stream will cause audio and video to get out of sync?
>> The following patch solves "stuttering" (but really is some kind of a
>> "sledgehammer")
>>      diff -rc ./bs1770gain-0.4.4-beta2/libffsox-2/ffsox_frame_writer.c ./bs1770gain-0.4.4-beta3/libffsox-2/ffsox_frame_writer.c
>>      *** ./bs1770gain-0.4.4-beta2/libffsox-2/ffsox_frame_writer.c	2015-06-14 18:11:19.000000000 +0200
>>      --- ./bs1770gain-0.4.4-beta3/libffsox-2/ffsox_frame_writer.c	2015-06-22 09:12:36.000000000 +0200
>>      ***************
>>      *** 145,150 ****
>>      --- 145,154 ----
>>           if (0!=*got_packet) {
>>             av_packet_rescale_ts(pkt,cc->time_base,st->time_base);
>>      +     // where do the "magic" factor 0.5 come from?
>>      +     pkt->dts>>=1;
>>      +     pkt->pts>>=1;
>>      +     pkt->duration>>=1;
>>             if (ffsox_stream_interleaved_write(so,pkt)<0) {
>>               DMESSAGE("writing packet");
>> Maybe Carl Eugen can provide some insight into how to align the time
>> scales between streams.
> I tested and this solve the stuttering for me too, but I have no idea
> about the mathematics involved here.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20150622/eac6ccde/attachment.html>

More information about the pkg-multimedia-maintainers mailing list