VideoHelp Forum

+ Reply to Thread
Results 1 to 6 of 6
Thread
  1. Member
    Join Date
    Apr 2021
    Location
    Spain
    Search Comp PM
    Hi, I have a problem converting some videos that have the audio in audio stream #2 instead of audio stream #1.

    I've seen here a way to check if an audio stream is silent:

    https://stackoverflow.com/questions/54613952/ffmpeg-check-audio-channels-for-silence

    Using this to see the audio stream #1:

    ffmpeg.exe -i FILE -map 0: a: 0 -af astats -f null -

    then the result of "RMS level dB" can be obtained, and that if it indicates "-inf" or a value typically below -30 dB, it indicates that this audio stream is silent.

    The problem is that "-inf" never appears and streams with audio often give very low values. For example I have set the threshold to -35 dB and I have some videos that give -50 dB and have audio. And others that have higher values with no audio. So I can't trust this system.

    Is there any other way or tool to see which audio stream is correct? Thank you.
    Quote Quote  
  2. If the audiostream doesn't have a language tag, you can simply extract it and listen to it with any player.
    Then you will know if it is the right stream.
    Use clever FFmpeg-GUI, load your video and after a short analysis you will see all included streams. If you still don't have enough information, click main, click extract audio stream, select stream 1, click extract audio, listen to the new created file, then extract audiostream2 and so on.

    Image
    [Attachment 62007 - Click to enlarge]
    Last edited by ProWo; 25th Nov 2021 at 10:22.
    Quote Quote  
  3. Member
    Join Date
    Apr 2021
    Location
    Spain
    Search Comp PM
    Thanks ProWo, but I can't do it manually, it's a transcoder that has to process hundreds of videos daily. I need to automate it.
    Quote Quote  
  4. Not sure whether it helps, but sox also has different audio analysis options,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. You will have to check if ALL or at least a sufficient number of samples ar equally low. You seem to have checked only the lowest sample.
    Automation I would try with avisynth. I use the plugin "minmaxaudio" for this kind of scans.
    Quote Quote  
  6. Member
    Join Date
    Apr 2021
    Location
    Spain
    Search Comp PM
    Thanks, I'm thinking about use -map 0 to transcode all the audio tracks. I have found some files with 4 audio tracks with the same audio in all, but with different volume level. Others with only one track working but in track 2 instedad 1... so I think it's better to transcode all.
    Quote Quote