Skip to content

Instantly share code, notes, and snippets.

@tmm1
Created November 26, 2017 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmm1/990cb460f0cfe8a6880728d0a9141649 to your computer and use it in GitHub Desktop.
Save tmm1/990cb460f0cfe8a6880728d0a9141649 to your computer and use it in GitHub Desktop.
(lldb) target create "./ffmpeg_g"Current executable set to './ffmpeg_g' (x86_64).
(lldb) settings set -- target.run-args "-hwaccel" "videotoolbox" "-hwaccel_output_format" "videotoolbox_vld" "-i" "h264.ts" "-f" "null" "-y" "/dev/null"
(lldb) run
Process 90719 launched: './ffmpeg_g' (x86_64)
ffmpeg version N-89243-g8794e0c037 Copyright (c) 2000-2017 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.38)
configuration: --prefix=/tmp/ffmpeg-master --enable-shared --disable-static --disable-stripping --disable-optimizations
libavutil 56. 3.100 / 56. 3.100
libavcodec 58. 3.105 / 58. 3.105
libavformat 58. 2.102 / 58. 2.102
libavdevice 58. 0.100 / 58. 0.100
libavfilter 7. 4.100 / 7. 4.100
libswscale 5. 0.101 / 5. 0.101
libswresample 3. 0.101 / 3. 0.101
Input #0, mpegts, from 'h264.ts':
Duration: 00:00:58.93, start: 2.334267, bitrate: 922 kb/s
Program 1
Metadata:
service_name : Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 180k tbc
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native))
Press [q] to stop, [?] for help
Process 90719 stopped
* thread #2, stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
frame #0: 0x00007fff7d432fe6 libsystem_platform.dylib`_platform_memmove$VARIANT$Haswell + 198
libsystem_platform.dylib`_platform_memmove$VARIANT$Haswell:
-> 0x7fff7d432fe6 <+198>: movb %cl, (%rdi,%r8)
0x7fff7d432fea <+202>: subq $0x1, %rdx
0x7fff7d432fee <+206>: je 0x7fff7d433004 ; <+228>
0x7fff7d432ff0 <+208>: movb 0x1(%rsi,%r8), %cl
Target 0: (ffmpeg_g) stopped.
(lldb) bt
* thread #2, stop reason = EXC_BAD_ACCESS (code=1, address=0x28)
* frame #0: 0x00007fff7d432fe6 libsystem_platform.dylib`_platform_memmove$VARIANT$Haswell + 198
frame #1: 0x00007fff7d280131 libsystem_c.dylib`__memcpy_chk + 22
frame #2: 0x0000000101115e84 libavcodec.58.dylib`ff_videotoolbox_avcc_extradata_create(avctx=0x000000010580fc00) at videotoolbox.c:122
frame #3: 0x0000000101117d45 libavcodec.58.dylib`videotoolbox_decoder_config_create(codec_type='avc1', avctx=0x000000010580fc00) at videotoolbox.c:694
frame #4: 0x0000000101117292 libavcodec.58.dylib`videotoolbox_start(avctx=0x000000010580fc00) at videotoolbox.c:754
frame #5: 0x000000010111713e libavcodec.58.dylib`av_videotoolbox_default_init2(avctx=0x000000010580fc00, vtctx=0x0000000000000000) at videotoolbox.c:1145
frame #6: 0x00000001011170c9 libavcodec.58.dylib`av_videotoolbox_default_init(avctx=0x000000010580fc00) at videotoolbox.c:1137
frame #7: 0x00000001000319b9 ffmpeg_g`videotoolbox_init(s=0x000000010580fc00) at ffmpeg_videotoolbox.c:139
frame #8: 0x0000000100025c45 ffmpeg_g`get_format(s=0x000000010580fc00, pix_fmts=0x0000000103034ca0) at ffmpeg.c:2858
frame #9: 0x00000001009c755a libavcodec.58.dylib`ff_get_format(avctx=0x000000010580fc00, fmt=0x000070000aa359bc) at decode.c:1312
frame #10: 0x0000000100f3d57c libavcodec.58.dylib`ff_thread_get_format(avctx=0x000000010580fc00, fmt=0x000070000aa359bc) at pthread_frame.c:951
frame #11: 0x0000000100bb5c8e libavcodec.58.dylib`get_pixel_format(h=0x0000000105800600, force_callback=1) at h264_slice.c:865
frame #12: 0x0000000100bb3f98 libavcodec.58.dylib`h264_init_ps(h=0x0000000105800600, sl=0x0000000105810200, first_slice=1) at h264_slice.c:1108
frame #13: 0x0000000100baf0fa libavcodec.58.dylib`h264_field_start(h=0x0000000105800600, sl=0x0000000105810200, nal=0x0000000103035170, first_slice=1) at h264_slice.c:1397
frame #14: 0x0000000100badd50 libavcodec.58.dylib`ff_h264_queue_decode_slice(h=0x0000000105800600, nal=0x0000000103035170) at h264_slice.c:2105
frame #15: 0x0000000100bc1310 libavcodec.58.dylib`decode_nal_units(h=0x0000000105800600, buf="", buf_size=53464) at h264dec.c:673
frame #16: 0x0000000100bc03eb libavcodec.58.dylib`h264_decode_frame(avctx=0x000000010580fc00, data=0x0000000103001f60, got_frame=0x000000010580eb90, avpkt=0x000000010580eb30) at h264dec.c:998
frame #17: 0x0000000100f3d15f libavcodec.58.dylib`frame_worker_thread(arg=0x000000010580ea00) at pthread_frame.c:201
frame #18: 0x00007fff7d4396c1 libsystem_pthread.dylib`_pthread_body + 340
frame #19: 0x00007fff7d43956d libsystem_pthread.dylib`_pthread_start + 377
frame #20: 0x00007fff7d438c5d libsystem_pthread.dylib`thread_start + 13
(lldb) up
frame #1: 0x00007fff7d280131 libsystem_c.dylib`__memcpy_chk + 22
libsystem_c.dylib`__memcpy_chk:
0x7fff7d280131 <+22>: movq %rbx, %rax
0x7fff7d280134 <+25>: addq $0x8, %rsp
0x7fff7d280138 <+29>: popq %rbx
0x7fff7d280139 <+30>: popq %rbp
(lldb) up
frame #2: 0x0000000101115e84 libavcodec.58.dylib`ff_videotoolbox_avcc_extradata_create(avctx=0x000000010580fc00) at videotoolbox.c:122
119
120 // save sps header (profile/level) used to create decoder session,
121 // so we can detect changes and recreate it.
-> 122 memcpy(vtctx->sps, h->ps.sps->data + 1, 3);
123
124 data = CFDataCreate(kCFAllocatorDefault, vt_extradata, vt_extradata_size);
125 av_free(vt_extradata);
(lldb) p h
(H264Context *) $0 = 0x0000000105800600
(lldb) p vtctx
(VTContext *) $1 = 0x0000000000000000
(lldb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment