0

I am using this to get the number of audio channels in a video file:

ffprobe -i movie.mxf -show_entries stream=channels -select_streams a -of compact=p=0:nk=1 -v 0

Which outputs:

0
1
1
1
1
1
1
1
1

There are 8 audio channels, and I wanted to get that number as a variable. Is this possible?

friendlygiraffe
  • 871
  • 2
  • 6
  • 18
  • You're displaying channels per stream. You'll have to sum them yourself. – Gyan Oct 09 '20 at 13:50
  • I would count the number of 1s in the output string? – friendlygiraffe Oct 12 '20 at 13:29
  • Yes, if you want to count the total number of channels of all audio streams. See `paste` answer in [Shell command to sum integers, one per line?](https://stackoverflow.com/a/451204/) – llogan Nov 05 '20 at 19:40

0 Answers0