VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. 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:

    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
    Note that also when recording using HDR 10, or 1080p versions of the command, the same sound problem can come up.

    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
    Last edited by Boxcart; 12th Apr 2023 at 23:24.
    Quote Quote  
  2. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Boxcart View Post
    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:

    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
    Note that also when recording using HDR 10, or 1080p versions of the command, the same sound problem can come up.

    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
    do you still get the distorted audio if you output to mp4 instead of mkv ??
    Last edited by october262; 13th Apr 2023 at 03:01.
    Quote Quote  
  3. mr. Eric-jan's Avatar
    Join Date
    Apr 2018
    Location
    Netherlands
    Search Comp PM
    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…. ?
    Quote Quote  
  4. Originally Posted by Eric-jan View Post
    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…. ?
    Bit and sample rates are the same, firmware and HDMI and everything is in tact. It seems completely random since most of the recording is fine, and the bug appears in random places in each recording attempt on the same source video.
    Quote Quote  
  5. Originally Posted by october262 View Post
    Originally Posted by Boxcart View Post
    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:

    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
    Note that also when recording using HDR 10, or 1080p versions of the command, the same sound problem can come up.

    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
    do you still get the distorted audio if you output to mp4 instead of mkv ??
    I just tested it, same problem occurs.
    Quote Quote  
  6. 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
    and there was no sound problem in the output. I'll have to do several more recordings before I can confirm that "fixed" it. I have no idea why that may have worked but I'll keep testing in the meantime.

    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.
    Quote Quote  
  7. 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.
    Quote Quote  
  8. I'm a Super Moderator johns0's Avatar
    Join Date
    Jun 2002
    Location
    canada
    Search Comp PM
    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.
    Quote Quote  
  9. Member
    Join Date
    Feb 2006
    Location
    United States
    Search Comp PM
    Originally Posted by Boxcart View Post
    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.
    just wonder if you might have a defective card - https://forum.blackmagicdesign.com/viewtopic.php?f=18&t=70345
    Quote Quote  
  10. Originally Posted by october262 View Post
    Originally Posted by Boxcart View Post
    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.
    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.
    Quote Quote  
  11. 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.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!