Hi all,
I've been using ffmpeg with my Blackmagic Decklink card to capture video for my Plex server very successfully. In my prior threads earlier this year it took some doing to get the commands right, but ever since it's been working seamlessly. One remaining issue though is a large portion of the time there will be recordings with a few segments of distorted sound. I can't seem to find the reason for this. Occasionally swapping the audio format or trying a few times will give me a clean recording. But I'm getting tired of doing that and want to figure out what the problem could be, if anyone has any ideas. It seemingly occurs randomly, in one segment in one recording, in a different segment of the next recording attempt (of the same source) and then gone altogether.
Here is my ffmpeg command:
Note that also when recording using HDR 10, or 1080p versions of the command, the same sound problem can come up.Code:ffmpeg -f dshow -c:v v210 -video_pin_name 1 -audio_pin_name 1 -video_size 3840x2160 -rtbufsize 2147480000 -framerate 24000/1001 -channels 6 -sample_rate 48k -sample_size 16 -i video="Decklink Video Capture":audio="Decklink Audio Capture" -filter_complex "[0:0]scale=w=iw:h=ih:interl=false:eval=init:out_v_chr_pos=-128:out_h_chr_pos=-128:flags=bilinear+accurate_rnd+print_info,format=p010le[vout];[0:1]channelmap=FL-FL|FR-FR|LFE-FC|FC-LFE|BL-BL|BR-BR:5.1[aout]" -map "[vout]" -map "[aout]" -color_range 1 -chroma_sample_location left -color_trc bt709 -color_primaries bt709 -colorspace bt709 -strict -2 -c:a eac3 -b:a 640k -c:v hevc_nvenc -profile:v main10 -preset:v p7 -b:v 80M -bufsize:v 120M -maxrate 90M -minrate 60M -g 4 -t HH:MM:SS title.mkv
Here is an example clip of the problem. It always sounds like this when the problem happens, and the problem lasts about 10 seconds:
https://drive.google.com/file/d/1RtC1R-RBeKYqT-42Pl41vhxDBWcBrbq0/view?usp=sharing
+ Reply to Thread
Results 1 to 11 of 11
-
Last edited by Boxcart; 12th Apr 2023 at 23:24.
-
Last edited by october262; 13th Apr 2023 at 03:01.
-
I guess the conversion from h.265 sound channel(s) goes wrong ? bit and sample rates ? Hardware acceleration and software codecs are used in same project ? firmwares are up to date ? HDMI/SDI versions are rock solid…. ?
-
-
I just randomly tried something and was able to get a clean recording without a problem. It might be random or it might have solved/uncovered something. I removed "-sample_size 16" from the code above, so I used:
Code:ffmpeg -f dshow -c:v v210 -video_pin_name 1 -audio_pin_name 1 -video_size 3840x2160 -rtbufsize 2147480000 -framerate 24000/1001 -channels 6 -sample_rate 48k -i video="Decklink Video Capture":audio="Decklink Audio Capture" -filter_complex "[0:0]scale=w=iw:h=ih:interl=false:eval=init:out_v_chr_pos=-128:out_h_chr_pos=-128:flags=bilinear+accurate_rnd+print_info,format=p010le[vout];[0:1]channelmap=FL-FL|FR-FR|LFE-FC|FC-LFE|BL-BL|BR-BR:5.1[aout]" -map "[vout]" -map "[aout]" -color_range 1 -chroma_sample_location left -color_trc bt709 -color_primaries bt709 -colorspace bt709 -strict -2 -c:a eac3 -b:a 640k -c:v hevc_nvenc -profile:v main10 -preset:v p7 -b:v 80M -bufsize:v 120M -maxrate 90M -minrate 60M -g 4 -t HH:MM:SS title.mkv
UPDATE: I just did another hour recording without the "-sample_size 16" line and once again there was no audio distortion. I'll keep testing it to see if that fixed it. I have no idea why that would make a difference here.Last edited by Boxcart; 15th Apr 2023 at 23:31.
-
The audio glitch returned. I did get a couple clean 1 hour recordings after removing that command, but on the next recording attempt there was about a 12 second segment with the audio glitch about 1/3 of the way through the recording. I believe the "-sample_size X" command sets the audio bit depth, and when left out of the string ffmpeg goes with either the "default" or what the audio already is. The range appears to be 0-16 for that parameter. Maybe that has nothing to do with it and I got a couple lucky recordings with no problem? I just gave it another shot and the glitch re-occurred, this time late in the recording as opposed to 1/3 or 1/10 of the way through (same source stream). It seems to occur randomly. Trying to cut segments of MKVs together to get a clean output file is a nightmare. If I could fix the source of the problem that would be perfect.
Last edited by Boxcart; 16th Apr 2023 at 13:15.
-
Try using line-in for your audio to see if it works that way,maybe an issue with your capture card audio.
I think,therefore i am a hamster. -
just wonder if you might have a defective card - https://forum.blackmagicdesign.com/viewtopic.php?f=18&t=70345
-
I hadn't thought of that but maybe you're right. Since the audio problem bounces around in the output recordings from a clean source, and there's no clear ffmpeg property affecting it, maybe it's the card. I don't see any new firmware to update to either. I'll contact BMD.
-
Alright I just swapped out the DeckLink card with a new one and the same problem exists. At this point I've ruled out the software (even Blackmagic Media Express has the problem in addition to ffmpeg and OBS) the hardware (new card had the same issue). The audio problem is not in the source. So there is something about a Decklink card recording this audio format that causes a problem. I'm just trying to figure out what problem would cause this issue, where 95% of the recording is perfect but a random 5% or so will have crackling, in random places in each recording attempt.
Similar Threads
-
Sound problem with ffmpeg
By Boxcart in forum Video ConversionReplies: 3Last Post: 20th Mar 2023, 19:32 -
ffmpeg concat problem
By DuncanStone in forum Video ConversionReplies: 3Last Post: 5th Feb 2022, 14:56 -
Create background sound for video with ffmpeg
By qo4on in forum EditingReplies: 3Last Post: 26th Nov 2020, 12:50 -
Ffmpeg Problem
By phonkilla26 in forum Video Streaming DownloadingReplies: 3Last Post: 3rd Jan 2020, 14:20 -
ffmpeg problem again
By loa909 in forum Newbie / General discussionsReplies: 3Last Post: 15th Jul 2018, 03:59