[FFmpeg-devel] [PATCH 277/281] ffmpeg: convert to new channel layout-API

Michael Niedermayer michael at niedermayer.cc
Sat Jan 15 15:47:20 EET 2022


On Thu, Jan 13, 2022 at 04:44:55PM -0300, James Almer wrote:
> 
> 
> On 1/13/2022 3:40 PM, James Almer wrote:
> > On 1/13/2022 3:29 PM, Michael Niedermayer wrote:
> > > On Wed, Jan 12, 2022 at 11:09:09PM -0300, James Almer wrote:
> > > > Signed-off-by: James Almer <jamrial at gmail.com>
> > > > ---
> > > >   fftools/cmdutils.c            | 42 +++++++++++++++---------
> > > >   fftools/cmdutils.h            |  8 -----
> > > >   fftools/ffmpeg.c              | 47 ++++++++++++++++----------
> > > >   fftools/ffmpeg.h              |  7 ++--
> > > >   fftools/ffmpeg_filter.c       | 52 ++++++++++++++++++++++-------
> > > >   fftools/ffmpeg_opt.c          | 62 ++++++++++++++++++++++++++++++-----
> > > >   tests/fate/aac.mak            |  2 +-
> > > >   tests/fate/lavf-container.mak |  2 +-
> > > >   8 files changed, 155 insertions(+), 67 deletions(-)
> > > 
> > > This or a prior patch introduces crashes (it bisected to this but
> > > this is my
> > > 2nd testcase the first did not reproduce reliably at all)
> > > 
> > > Thread 1 "ffmpeg_g" received signal SIGSEGV, Segmentation fault.
> > > 0x00005555566ed811 in av_vlog (avcl=0x5555577400c0, level=24,
> > > fmt=0x5555568249e8 "%d frames left in the queue on closing\n",
> > > vl=0x7fffffffda50) at libavutil/log.c:428
> > 
> > av_vlog() is where it crashes?
> > 
> > > 428        if (avc && avc->version >= (50 << 16 | 15 << 8 | 2) &&
> > > (gdb) bt
> > > #0  0x00005555566ed811 in av_vlog (avcl=0x5555577400c0, level=24,
> > > fmt=0x5555568249e8 "%d frames left in the queue on closing\n",
> > > vl=0x7fffffffda50) at libavutil/log.c:428
> > > #1  0x00005555566ed6bd in av_log (avcl=0x5555577400c0, level=24,
> > > fmt=0x5555568249e8 "%d frames left in the queue on closing\n") at
> > > libavutil/log.c:411
> > > #2  0x0000555555c320b9 in ff_af_queue_close (afq=0x5555576c47c8) at
> > > libavcodec/audio_frame_queue.c:39
> > > #3  0x0000555555e84c06 in mp3lame_encode_close
> > > (avctx=0x5555576bf180) at libavcodec/libmp3lame.c:86
> > > #4  0x0000555555c373f7 in avcodec_close (avctx=0x5555576bf180) at
> > > libavcodec/avcodec.c:489
> > > #5  0x0000555555f7feab in avcodec_free_context
> > > (pavctx=0x5555576a8858) at libavcodec/options.c:163
> > > #6  0x000055555569cfe3 in ffmpeg_cleanup (ret=1) at fftools/ffmpeg.c:608
> > > #7  0x0000555555694817 in exit_program (ret=1) at fftools/cmdutils.c:131
> > > #8  0x000055555569ef1f in do_audio_out (of=0x5555576ae2c0,
> > > ost=0x5555576a8800, frame=0x5555576bf580) at fftools/ffmpeg.c:1056
> > > #9  0x00005555556a117a in reap_filters (flush=0) at fftools/ffmpeg.c:1546
> > > #10 0x00005555556ad8e5 in transcode_step () at fftools/ffmpeg.c:4643
> > > #11 0x00005555556ad9e7 in transcode () at fftools/ffmpeg.c:4687
> > > #12 0x00005555556ae45c in main (argc=12, argv=0x7fffffffe1c8) at
> > > fftools/ffmpeg.c:4903
> > > (gdb) print avc->version
> > > Cannot access memory at address 0xc1528eb7c0ea0157
> > > 
> > > make -j32 && gdb --args ./ffmpeg_g -ss 8 -i NeroRecodeSample.mp4
> > > -bitexact -t 3 -filter_complex
> > > '[0:2]scale=720:576[v];[v][0:5]overlay' -y file-whitesubs.avi
> > > 
> > > it appears this file is at:
> > > https://samples.ffmpeg.org/MPEG-4/NeroRecodeSample-MP4/
> > 
> > I can't reproduce this on mingw64.
> 
> Does the following fix it for you?

jamrial/channel_layout4 seems not to crash anymore
but the output from
libswresample/tests/swresample

changes substantially with that branch merged
here a hunk showing that:

--- /tmp/old    2022-01-15 14:38:42.370067768 +0100
+++ /tmp/new    2022-01-15 14:37:58.265740924 +0100
@@ -3,14 +3,14 @@
 [e:0.037321 c:0.988153 max:0.208739] len:  968
 [e:0.037581 c:0.988035 max:0.208739] len:  968
 [e:0.040051 c:0.986398 max:0.208739] len:  968
-[e:0.042843 c:0.984417 max:0.215337] len:  968
-[e:0.038669 c:0.987065 max:0.208739] len:  968
+[e:0.238849 c:-nan max:0.990217] len:  968
+[e:0.236179 c:-nan max:0.990217] len:  968
 [e:0.000987 c:0.999985 max:0.003293] len:   16 F:  1
 [e:0.000131 c:0.999999 max:0.000438] len:   16 F:  1
 [e:0.000999 c:0.999985 max:0.003333] len:   16 F:  1
 [e:0.000084 c:1.000000 max:0.000280] len:   16 F:  1
-[e:0.000996 c:0.999985 max:0.003322] len:   16 F:  1
-[e:0.000027 c:1.000000 max:0.000089] len:   16 F:  1
+[e:0.181271 c:-nan max:0.297598] len:   16 F:  1
+[e:0.080519 c:-nan max:0.227637] len:   16 F:  1
 
 TEST: 3.0->7.1(wide-side), rate:16000->48000, fmt:dbl->dbl
 [e:0.039816 c:0.986742 max:0.283776] len:  968


 
[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220115/2dce8ac2/attachment.sig>


More information about the ffmpeg-devel mailing list