Opened 3 months ago

Last modified 3 months ago

#7372 new defect

[regression][eac3] Unable to parse channels information while compiling with ac3 decoder disabled.

Reported by: apasyniuk Owned by:
Priority: important Component: avcodec
Version: git-master Keywords: eac3 regression
Cc: onemda@gmail.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When ffmpeg is compiled with ac3 decoder disabled ffmpeg is unable to extract channel information from ts file.

It can be a regression after a changes introduced in: ae9297097696f3d06417a6e8a5368d5f38a6edb4

How to reproduce:
Before ae9297097696f3d06417a6e8a5368d5f38a6edb4 commit:

> $ ./ffprobe -i ~/builds/ts_multi_codec.ts                                                                                                                                                                                                                         [±e5819fa629] 
ffprobe version N-90480-ge5819fa629 Copyright (c) 2007-2018 the FFmpeg developers                                                                                                                                                                                                 
  built with gcc 5.5.0 (Ubuntu 5.5.0-12ubuntu1~16.04) 20171010                                                                                                                                                                                                                    
  configuration: --prefix=/home/apasyniuk/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/apasyniuk/ffmpeg_build/include --extra-ldflags=-L/home/apasyniuk/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/apasyniuk/bin --disable-decoder=ac3       
  libavutil      56. 12.100 / 56. 12.100                                                                                                                                                                                                                                          
  libavcodec     58. 16.100 / 58. 16.100                                                                                                                                                                                                                                          
  libavformat    58. 10.100 / 58. 10.100                                                                                                                                                                                                                                          
  libavdevice    58.  2.100 / 58.  2.100                                                                                                                                                                                                                                          
  libavfilter     7. 13.100 /  7. 13.100                                                                                                                                                                                                                                          
  libswscale      5.  0.102 /  5.  0.102                                                                                                                                                                                                                                          
  libswresample   3.  0.101 /  3.  0.101                                                                                                                                                                                                                                          
[mpegts @ 0x2722b00] DTS discontinuity in stream 0: packet 3 with DTS 123306, packet 4 with DTS 126906                                                                                                                                                                            
Input #0, mpegts, from '/home/apasyniuk/builds/ts_multi_codec.ts':                                                                                                                                                                                                                
  Duration: 00:01:21.02, start: 1.370067, bitrate: 4749 kb/s                                                                                                                                                                                                                      
  Program 2                                                                                                                                                                                                                                                                       
    Stream #0:0[0x21]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc                                                                                                                 
    Stream #0:1[0x24]: Audio: eac3 ([6][0][0][0] / 0x0006), 48000 Hz, 5.1(side), 192 kb/s                                                                                                                                                                                         
    Stream #0:2[0x25]: Audio: aac (LC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp, 128 kb/s 
Stream #0:1[0x24]: Audio: eac3 ([6][0][0][0] / 0x0006), 48000 Hz, 5.1(side), 192 kb/s

ffprobe is able to extract information about channels 5.1

after ae9297097696f3d06417a6e8a5368d5f38a6edb4 commit:

> $ ./ffprobe -i ~/builds/ts_multi_codec.ts                                                                                                                                                                                                                         [±ae92970976]
ffprobe version N-90481-gae92970976 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 5.5.0 (Ubuntu 5.5.0-12ubuntu1~16.04) 20171010
  configuration: --prefix=/home/apasyniuk/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/apasyniuk/ffmpeg_build/include --extra-ldflags=-L/home/apasyniuk/ffmpeg_build/lib --extra-libs='-lpthread -lm' --bindir=/home/apasyniuk/bin --disable-decoder=ac3      
  libavutil      56. 12.100 / 56. 12.100
  libavcodec     58. 16.100 / 58. 16.100
  libavformat    58. 10.100 / 58. 10.100
  libavdevice    58.  2.100 / 58.  2.100
  libavfilter     7. 13.100 /  7. 13.100
  libswscale      5.  0.102 /  5.  0.102
  libswresample   3.  0.101 /  3.  0.101
[mpegts @ 0x3715b00] DTS discontinuity in stream 0: packet 3 with DTS 123306, packet 4 with DTS 126906
[mpegts @ 0x3715b00] Could not find codec parameters for stream 1 (Audio: eac3 ([6][0][0][0] / 0x0006), 48000 Hz, 0 channels): unspecified number of channels                                                                                                                     
Consider increasing the value for the 'analyzeduration' and 'probesize' options                                                                                                                                                                                                   
Input #0, mpegts, from '/home/apasyniuk/builds/ts_multi_codec.ts':                                                                                                                                                                                                                
  Duration: 00:01:21.02, start: 1.370067, bitrate: 4749 kb/s
  Program 2
    Stream #0:0[0x21]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc                                                                                                                
    Stream #0:1[0x24]: Audio: eac3 ([6][0][0][0] / 0x0006), 48000 Hz, 0 channels
    Stream #0:2[0x25]: Audio: aac (LC) ([17][0][0][0] / 0x0011), 48000 Hz, stereo, fltp, 115 kb/s
Unsupported codec with id 86056 for input stream 1

we get 0 channels and following log

[mpegts @ 0x3715b00] Could not find codec parameters for stream 1 (Audio: eac3 ([6][0][0][0] / 0x0006), 48000 Hz, 0 channels): unspecified number of channels                                                                                                                     
Consider increasing the value for the 'analyzeduration' and 'probesize' options

Link to test file : http://streaming.dolby.com/ftproot/mitXperts/ts/ts_multi_codec.ts

Additionaly after reverting part of the changes everything seems to work correctly in this case:

g show 5e14c2b1a5441 libavcodec/aac_ac3_parser.c | git apply -R 

Change History (3)

comment:1 Changed 3 months ago by richardpl

Try this patch:

diff --git a/libavcodec/aac_ac3_parser.c b/libavcodec/aac_ac3_parser.c
index 54e459844f..15fc929cb4 100644
--- a/libavcodec/aac_ac3_parser.c
+++ b/libavcodec/aac_ac3_parser.c
@@ -89,7 +89,7 @@ get_next:
            the frame). */
         if (avctx->codec_id != AV_CODEC_ID_AAC) {
             avctx->sample_rate = s->sample_rate;
-            if (avctx->codec_id != AV_CODEC_ID_EAC3) {
+            if ((CONFIG_EAC3_DECODER && avctx->codec_id != AV_CODEC_ID_EAC3) || (!CONFIG_EAC3_DECODER)) {
                 avctx->channels = s->channels;
                 avctx->channel_layout = s->channel_layout;
             }

comment:2 Changed 3 months ago by apasyniuk

I try this and yes it works now.
Maybe it's good idea to add this config check to next if with bit_rate parameter?

diff --git a/third_party/ffmpeg/libavcodec/aac_ac3_parser.c b/third_party/ffmpeg/libavcodec/aac_ac3_parser.c
index 54e459844f14..46e73014560e 100644
--- a/third_party/ffmpeg/libavcodec/aac_ac3_parser.c
+++ b/third_party/ffmpeg/libavcodec/aac_ac3_parser.c
@@ -89,7 +89,7 @@ get_next:
            the frame). */
         if (avctx->codec_id != AV_CODEC_ID_AAC) {
             avctx->sample_rate = s->sample_rate;
-            if (avctx->codec_id != AV_CODEC_ID_EAC3) {
+            if ((CONFIG_EAC3_DECODER && avctx->codec_id != AV_CODEC_ID_EAC3) || (!CONFIG_EAC3_DECODER)) {
                 avctx->channels = s->channels;
                 avctx->channel_layout = s->channel_layout;
             }
@@ -97,7 +97,7 @@ get_next:
             avctx->audio_service_type = s->service_type;
         }
 
-        if (avctx->codec_id != AV_CODEC_ID_EAC3)
+        if ((CONFIG_EAC3_DECODER && avctx->codec_id != AV_CODEC_ID_EAC3) || (!CONFIG_EAC3_DECODER))
             avctx->bit_rate = s->bit_rate;
     }

comment:3 Changed 3 months ago by cehoyos

  • Keywords eac3 regression added
  • Priority changed from normal to important
Note: See TracTickets for help on using tickets.