[FFmpeg-user] ffmpeg audio distortion using blackmagic

Flumotion Support support at flumotion.com
Thu Jul 19 10:41:35 EEST 2018


Hello everybody


Thanks for your answer,
I can not use the hdmi imput, my customer only has a sdi signal, i can not
save because is a live stream.
Thanks in advance
Kind regards

This is my fffmpeg version

 ffmpeg -version
ffmpeg version N-86442-g8aa6060 Copyright (c) 2000-2017 the FFmpeg
developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
configuration: --extra-libs=-ldl --enable-version3 --enable-libfdk-aac
--enable-libmp3lame --enable-libx264 --enable-gpl --enable-postproc
--enable-nonfree --enable-avfilter --enable-pthreads --enable-decklink
--extra-cflags=-I/root/ffmpeg/ffmpeg/blackmagic/
--extra-ldflags=-L/root/ffmpeg/ffmpeg/blackmagic/
libavutil      55. 63.100 / 55. 63.100
libavcodec     57. 98.100 / 57. 98.100
libavformat    57. 73.100 / 57. 73.100
libavdevice    57.  7.100 / 57.  7.100
libavfilter     6. 92.100 /  6. 92.100
libswscale      4.  7.101 /  4.  7.101
libswresample   2.  8.100 /  2.  8.100
libpostproc    54.  6.100 / 54.  6.100

My server

[root at server-master ~]# uname -a
Linux server-master.cust.fluendo.net 3.10.0-327.13.1.el7.x86_64 #1 SMP Thu
Mar 31 16:04:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
[root at server-master ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

My capture devise;

 ffmpeg -f decklink -list_formats 1 -i 'DeckLink Mini Recorder'
ffmpeg version N-86442-g8aa6060 Copyright (c) 2000-2017 the FFmpeg
developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --extra-libs=-ldl --enable-version3 --enable-libfdk-aac
--enable-libmp3lame --enable-libx264 --enable-gpl --enable-postproc
--enable-nonfree --enable-avfilter --enable-pthreads --enable-decklink
--extra-cflags=-I/root/ffmpeg/ffmpeg/blackmagic/
--extra-ldflags=-L/root/ffmpeg/ffmpeg/blackmagic/
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 98.100 / 57. 98.100
  libavformat    57. 73.100 / 57. 73.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 92.100 /  6. 92.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
[decklink @ 0x3b2c380] Supported formats for 'DeckLink Mini Recorder':
    format_code    description
    ntsc        720x486 at 30000/1001 fps (interlaced, lower field first)
    pal         720x576 at 25000/1000 fps (interlaced, upper field first)
    ntsp        720x486 at 60000/1001 fps
    palp        720x576 at 50000/1000 fps
    23ps        1920x1080 at 24000/1001 fps
    24ps        1920x1080 at 24000/1000 fps
    Hp25        1920x1080 at 25000/1000 fps
    Hp29        1920x1080 at 30000/1001 fps
    Hp30        1920x1080 at 30000/1000 fps
    Hi50        1920x1080 at 25000/1000 fps (interlaced, upper field first)
    Hi59        1920x1080 at 30000/1001 fps (interlaced, upper field first)
    Hi60        1920x1080 at 30000/1000 fps (interlaced, upper field first)
    hp50        1280x720 at 50000/1000 fps
    hp59        1280x720 at 60000/1001 fps
    hp60        1280x720 at 60000/1000 fps
DeckLink Mini Recorder: Immediate exit requested


My full outpuit:


/usr/local/bin/ffmpeg -re -loglevel 48 -format_code pal -f decklink -i
"DeckLink Mini Recorder" -audio_input embedded -video_input sdi -vcodec
libx264 -crf 22 -preset:v veryfast -b:v 900k -pix_fmt yuv420p -acodec
libfdk_aac -vbr 4 -ab 64k -ar 48000 -ac 2 -s 640x360 -f flv
"rtmp://myserver:1935/test/live"
ffmpeg version N-86442-g8aa6060 Copyright (c) 2000-2017 the FFmpeg
developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --extra-libs=-ldl --enable-version3 --enable-libfdk-aac
--enable-libmp3lame --enable-libx264 --enable-gpl --enable-postproc
--enable-nonfree --enable-avfilter --enable-pthreads --enable-decklink
--extra-cflags=-I/root/ffmpeg/ffmpeg/blackmagic/
--extra-ldflags=-L/root/ffmpeg/ffmpeg/blackmagic/
  libavutil      55. 63.100 / 55. 63.100
  libavcodec     57. 98.100 / 57. 98.100
  libavformat    57. 73.100 / 57. 73.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 92.100 /  6. 92.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Splitting the commandline.
Reading option '-re' ... matched as option 're' (read input at native frame
rate) with argument '1'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument '48'.
Reading option '-format_code' ... matched as AVOption 'format_code' with
argument 'pal'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'decklink'.
Reading option '-i' ... matched as input url with argument 'DeckLink Mini
Recorder'.
Reading option '-audio_input' ... matched as AVOption 'audio_input' with
argument 'embedded'.
Reading option '-video_input' ... matched as AVOption 'video_input' with
argument 'sdi'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec
('copy' to copy stream)) with argument 'libx264'.
Reading option '-crf' ... matched as AVOption 'crf' with argument '22'.
Reading option '-preset:v' ... matched as AVOption 'preset:v' with argument
'veryfast'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use
-b:v)) with argument '900k'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel
format) with argument 'yuv420p'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec
('copy' to copy stream)) with argument 'libfdk_aac'.
Reading option '-vbr' ... matched as AVOption 'vbr' with argument '4'.
Reading option '-ab' ... matched as option 'ab' (audio bitrate (please use
-b:a)) with argument '64k'.
Reading option '-ar' ... matched as option 'ar' (set audio sampling rate
(in Hz)) with argument '48000'.
Reading option '-ac' ... matched as option 'ac' (set number of audio
channels) with argument '2'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or
abbreviation)) with argument '640x360'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'flv'.
Reading option 'rtmp://myserver:1935/test/live' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument 48.
Successfully parsed a group of options.
Parsing a group of options: input url DeckLink Mini Recorder.
Applying option re (read input at native frame rate) with argument 1.
Applying option f (force format) with argument decklink.
Successfully parsed a group of options.
Opening an input file: DeckLink Mini Recorder.
[decklink @ 0x22547a0] Trying to find mode for frame size 0x0, frame timing
0/0, field order 0, direction 0, mode number 0, format code pal
[decklink @ 0x22547a0] Found Decklink mode 720 x 576 with rate 25.00(i)
[decklink @ 0x22547a0] Using 2 input audio channels
[decklink @ 0x22547a0] Probe buffer size limit of 5000000 bytes reached
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, decklink, from 'DeckLink Mini Recorder':
  Duration: N/A, start: 0.000000, bitrate: 167424 kb/s
    Stream #0:0, 5, 1/1000000: Audio: pcm_s16le, 48000 Hz, stereo, s16,
1536 kb/s
    Stream #0:1, 6, 1/1000000: Video: rawvideo, 1 reference frame (UYVY /
0x59565955), uyvy422, 720x576, 0/1, 165888 kb/s, 25 fps, 25 tbr, 1000k tbn,
1000k tbc
Successfully opened the file.
Parsing a group of options: output url rtmp://myserver.com:1935/test/live.
Applying option vcodec (force video codec ('copy' to copy stream)) with
argument libx264.
Applying option b:v (video bitrate (please use -b:v)) with argument 900k.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Applying option acodec (force audio codec ('copy' to copy stream)) with
argument libfdk_aac.
Applying option ab (audio bitrate (please use -b:a)) with argument 64k.
Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
Applying option ac (set number of audio channels) with argument 2.
Applying option s (set frame size (WxH or abbreviation)) with argument
640x360.
Applying option f (force format) with argument flv.
Successfully parsed a group of options.
Opening an output file: rtmp://myserver.com:1935/test/live.
[rtmp @ 0x226c840] No default whitelist set
[tcp @ 0x226c8e0] No default whitelist set
[decklink @ 0x22547a0] Frame received (#25) - Valid (829440B) - QSize
14.380829MB
[decklink @ 0x22547a0] Frame received (#50) - Valid (829440B) - QSize
34.343903MB
[decklink @ 0x22547a0] Frame received (#75) - Valid (829440B) - QSize
54.306976MB
[decklink @ 0x22547a0] Frame received (#100) - Valid (829440B) - QSize
74.270050MB
[decklink @ 0x22547a0] Frame received (#125) - Valid (829440B) - QSize
94.233124MB
[rtmp @ 0x226c840] Handshaking...
[rtmp @ 0x226c840] Type answer 3
[rtmp @ 0x226c840] Server version 3.0.1.1
[rtmp @ 0x226c840] Proto = rtmp, path = /test/live, app = test, fname = live
[rtmp @ 0x226c840] Server bandwidth = 2500000
[rtmp @ 0x226c840] Client bandwidth = 2500000
[rtmp @ 0x226c840] New incoming chunk size = 4096
[rtmp @ 0x226c840] Releasing stream...
[rtmp @ 0x226c840] FCPublish stream...
[rtmp @ 0x226c840] Creating stream...
[rtmp @ 0x226c840] Sending publish command for 'live'
Successfully opened the file.
Stream mapping:
  Stream #0:1 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (pcm_s16le (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
cur_dts is invalid (this is harmless if it occurs once at the start per
stream)
[rawvideo @ 0x226e020] PACKET SIZE: 829440, STRIDE: 1440
detected 8 logical cores
[graph 0 input from stream 0:1 @ 0x22a3c60] Setting 'video_size' to value
'720x576'
[graph 0 input from stream 0:1 @ 0x22a3c60] Setting 'pix_fmt' to value '17'
[graph 0 input from stream 0:1 @ 0x22a3c60] Setting 'time_base' to value
'1/1000000'
[graph 0 input from stream 0:1 @ 0x22a3c60] Setting 'pixel_aspect' to value
'0/1'
[graph 0 input from stream 0:1 @ 0x22a3c60] Setting 'sws_param' to value
'flags=2'
[graph 0 input from stream 0:1 @ 0x22a3c60] Setting 'frame_rate' to value
'25000/1000'
[graph 0 input from stream 0:1 @ 0x22a3c60] w:720 h:576 pixfmt:uyvy422
tb:1/1000000 fr:25000/1000 sar:0/1 sws_param:flags=2
[scaler_out_0_0 @ 0x22a4b80] Setting 'w' to value '640'
[scaler_out_0_0 @ 0x22a4b80] Setting 'h' to value '360'
[scaler_out_0_0 @ 0x22a4b80] Setting 'flags' to value 'bicubic'
[scaler_out_0_0 @ 0x22a4b80] w:640 h:360 flags:'bicubic' interl:0
[format @ 0x22a5480] compat: called with args=[yuv420p]
[format @ 0x22a5480] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0x2267940] query_formats: 5 queried, 4 merged, 0 already
done, 0 delayed
[scaler_out_0_0 @ 0x22a4b80] w:720 h:576 fmt:uyvy422 sar:0/1 -> w:640 h:360
fmt:yuv420p sar:0/1 flags:0x4
[libx264 @ 0x226a7e0] using mv_range_thread = 24
[libx264 @ 0x226a7e0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX AVX2 FMA3 LZCNT BMI2
[libx264 @ 0x226a7e0] profile High, level 3.0
[libx264 @ 0x226a7e0] 264 - core 142 r2495 6a301b6 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1
ref=1 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00
mixed_ref=0 me_r
ange=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1
chroma_qp_offset=0 threads=12 lookahead_threads=2 sliced_threads=0 nr=0
decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3
b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=1
keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=10 rc=crf
mbtree=1 crf=22.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40
aq=1:1.00
Clipping frame in rate conversion by 0.000008
cur_dts is invalid (this is harmless if it occurs once at the start per
stream)
    Last message repeated 12097 times
[graph_1_in_0_0 @ 0x2df2a40] Setting 'time_base' to value '1/48000'
[graph_1_in_0_0 @ 0x2df2a40] Setting 'sample_rate' to value '48000'
[graph_1_in_0_0 @ 0x2df2a40] Setting 'sample_fmt' to value 's16'
[graph_1_in_0_0 @ 0x2df2a40] Setting 'channel_layout' to value '0x3'
[graph_1_in_0_0 @ 0x2df2a40] tb:1/48000 samplefmt:s16 samplerate:48000
chlayout:0x3
[format_out_0_1 @ 0x2df3160] Setting 'sample_fmts' to value 's16'
[format_out_0_1 @ 0x2df3160] Setting 'sample_rates' to value '48000'
[format_out_0_1 @ 0x2df3160] Setting 'channel_layouts' to value '0x3'
[AVFilterGraph @ 0x225d240] query_formats: 4 queried, 9 merged, 0 already
done, 0 delayed
[libfdk_aac @ 0x2263700] Note, the VBR setting is unsupported and only
works with some parameter combinations
Output #0, flv, to 'rtmp://myserver.com:1935/test/live':




On Wed, Jul 18, 2018 at 7:53 PM, Micael Silva <micaelsilva at gmail.com> wrote:

> On Wed, Jul 18, 2018 at 1:11 PM, Flumotion Support <support at flumotion.com>
> wrote:
>
> > Hello everybody
> >
> > I have problems capturing a sdi flow with ffmpeg, I'm using a blackmagic
> > mini recorder pro, after a while of working the capture the audio is
> > distorted and the only way to fix it is to restart ffmpeg.
> >
> > this is my pipeline
> > /usr/local/bin/ffmpeg -re -loglevel 48 -format_code pal -f decklink -i
> > DeckLink Mini Recorder -audio_input embedded -video_input sdi -vcodec
> > libx264 -crf 22 -preset:v veryfast -b:v 900k -pix_fmt yuv420p -acodec
> > libfdk_aac -ab 64k -ar 48000 -ac 2 -s 640x360 -f flv rtmp://
> > myserver.com:1935/test/live
> >
> > I add an audio capture that is distorted from the second 10.
> > I will grow any help you can offer me.
> >
> > Thanks in advance
> > King regards
> >
> > ​
> >  croppedvideo.mp4
> > <https://drive.google.com/a/flumotion.com/file/d/1R_
> > pjUps2xkLYepeTxLIWKxqSy_qCnTF0/view?usp=drive_web>
> >
>
> The DeckLink Mini it's kinda of problematic with audio because it's very
> restrictive about sample rate, only inputs and outputs 48KHz, and it shows
> up in strange ways along the pipeline. Did you tried the same thing using
> the HDMI input? Or recording to a MP4 file, without the -re param?
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".




-- 
Flumotion Support
Flumotion Services S.A.
Avda. Diagonal 579-587 7º
08021 Barcelona - Spain
www.flumotion.com


More information about the ffmpeg-user mailing list