[FFmpeg-devel] [PATCH v2] avdevice/avfoundation: continue to try get packet if not in observed_quit mode

Steven Liu lq at chinaffmpeg.org
Thu Sep 23 06:10:05 EEST 2021



> 2021年9月22日 下午7:09,Thilo Borgmann <thilo.borgmann at mail.de> 写道:
> 
> Hi,
> 
> 
> On 18 Sep 2021, at 3:51, Steven Liu wrote:
> 
>> Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
>> ---
>> libavdevice/avfoundation.m | 2 --
>> 1 file changed, 2 deletions(-)
>> 
>> diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
>> index 0cd6e646d5..cd30f48cfe 100644
>> --- a/libavdevice/avfoundation.m
>> +++ b/libavdevice/avfoundation.m
>> @@ -1186,8 +1186,6 @@ static int avf_read_packet(AVFormatContext *s, AVPacket *pkt)
>> 
> 
> Did you retest?
Hi Thilo,

Sure,
Samples of voice from microphone AVFoundation:
http://bbs.chinaffmpeg.com/before_patch.wav
http://bbs.chinaffmpeg.com/after_patch.wav

Maybe need macro to control the workflow?
My Mac(11.6 (20G165))

> On my Mac (10.10.5), current HEAD works fine with audio from the mic. Your patch introduces more errors for me:
> 
> Thilo-Borgmanns-MacBook-Pro-2:FFmpeg Thilo$ ./ffmpeg -f avfoundation -list_devices 0 -i ":0" -y out_post.mp4
> ffmpeg version N-103788-g0a51973 Copyright (c) 2000-2021 the FFmpeg developers
>  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
>  configuration: --disable-videotoolbox
>  libavutil      57.  6.100 / 57.  6.100
>  libavcodec     59.  9.100 / 59.  9.100
>  libavformat    59.  5.100 / 59.  5.100
>  libavdevice    59.  0.101 / 59.  0.101
>  libavfilter     8.  9.100 /  8.  9.100
>  libswscale      6.  1.100 /  6.  1.100
>  libswresample   4.  0.100 /  4.  0.100
> Input #0, avfoundation, from ':0':
>  Duration: N/A, start: 216642.184694, bitrate: 2822 kb/s
>  Stream #0:0: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
> Stream mapping:
>  Stream #0:0 -> #0:0 (pcm_f32le (native) -> aac (native))
> Press [q] to stop, [?] for help
> Output #0, mp4, to 'out_post.mp4':
>  Metadata:
>    encoder         : Lavf59.5.100
>  Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
>    Metadata:
>      encoder         : Lavc59.9.100 aac
> Illegal instruction: 40:00:00.00 bitrate=N/A speed=   0x
> 
> Thilo-Borgmanns-MacBook-Pro-2:FFmpeg Thilo$ ./ffmpeg -f avfoundation -list_devices 0 -i ":0" -y out_post.mp4
> ffmpeg version N-103788-g0a51973 Copyright (c) 2000-2021 the FFmpeg developers
>  built with Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
>  configuration: --disable-videotoolbox
>  libavutil      57.  6.100 / 57.  6.100
>  libavcodec     59.  9.100 / 59.  9.100
>  libavformat    59.  5.100 / 59.  5.100
>  libavdevice    59.  0.101 / 59.  0.101
>  libavfilter     8.  9.100 /  8.  9.100
>  libswscale      6.  1.100 /  6.  1.100
>  libswresample   4.  0.100 /  4.  0.100
> Input #0, avfoundation, from ':0':
>  Duration: N/A, start: 216651.490091, bitrate: 2822 kb/s
>  Stream #0:0: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
> Stream mapping:
>  Stream #0:0 -> #0:0 (pcm_f32le (native) -> aac (native))
> Press [q] to stop, [?] for help
> Output #0, mp4, to 'out_post.mp4':
>  Metadata:
>    encoder         : Lavf59.5.100
>  Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
>    Metadata:
>      encoder         : Lavc59.9.100 aac
> 2021-09-22 13:05:36.347 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497a80 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.358 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1569b30 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.370 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c15697f0 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.381 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c15697f0 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.393 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1569990 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.404 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1498310 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.416 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1569990 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.428 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497de0 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.439 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497f80 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.451 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497f80 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.462 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497f80 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.474 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497800 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.486 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497800 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.498 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1569990 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.509 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c15697f0 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.520 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497800 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.532 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497800 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.544 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1569fd0 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.555 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497800 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.567 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497800 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.579 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1497800 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff3c1539130 [type:soun][enabled:1][active:1]>
> 2021-09-22 13:05:36.590 ffmpeg[80494:2018762] Dropping audio sample buffer 0x7ff3c1569fd0 for output <AVCaptureAudioDataOutput: 0x7ff3c1536cb0> connection <AVCaptureConnection: 0x7ff
> 
> 
> -Thilo
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
> 

Thanks

Steven Liu



More information about the ffmpeg-devel mailing list