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

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


On 22.06.2015 08:14, Petter Reinholdtsen wrote:
> [Peter Belkner]
>> I've made an educated guess on how to continue: simply skip the
>> package, and it seems to work smoothly:
> How did you test?

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.

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.

The (previous) patch solves the first issue. The idea is to throw away 
packages FFmpeg cannot deal with.

After having solved the first issue, "20030213-cvs.mpeg" will also 
"stutter". For solving "stuttering" I know have a really "educated" 
guess based on the observation that in almost all cases the duration of 
processed video files will be double the original length. A further 
observation is that the time stamps produced differ by the factor 2 
between the video and the audio stream.

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 applied the enclosed patch (notice the DMESSAGE) to see how often it
> trigger, and processed the MPEG file, and the sound was still
> stuttering.  This was the output when running bs1770gain:
>
> % ./bs1770gain/bs1770gain 20030213-cvs.mpeg -a -o foo
> analyzing ...
>    [1/1] "20030213-cvs.mpeg": 7%Error decoding audio, skipping audio package: frame_reader_run(), "ffsox_frame_reader.c" (148).
>          
>        integrated:  -34.7 LUFS / 11.7 LU
> transcoding ...
>    [1/1] "20030213-cvs.mkv" 7%Error decoding audio, skipping audio package: frame_reader_run(), "ffsox_frame_reader.c" (148).
>      
> done.
> %
>
> --- bs1770gain-0.4.3.orig/libffsox-2/ffsox_frame_reader.c
> +++ bs1770gain-0.4.3/libffsox-2/ffsox_frame_reader.c
> @@ -145,8 +145,10 @@ static int frame_reader_run(frame_reader
>         }
>   
>         if ((size=avcodec_decode_audio4(cc,frame,&got_frame,pkt))<0) {
> -        DMESSAGE("decoding audio");
> -        return -1;
> +        DMESSAGE("decoding audio, skipping audio package");
> +        // skip the package.
> +        pkt->size=0;
> +        return 0;
>         }
>   
>         pkt->size-=size;
>

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


More information about the pkg-multimedia-maintainers mailing list