jave2
jave2 copied to clipboard
Add more flexible audio channel detection
Currently only the mono/stereo/quad channels are correctly recognized All other channel layouts don't return valid values
https://ffmpeg.org/doxygen/3.0/group__channel__mask__c.html
ffprobe -i [audio file] -show_streams -select_streams a:0
will show you various information such as the number of channels (e.g. 2) and the channel layout (e.g. stereo).
A pull request for this would be accepted ;)
A pull request for this would be accepted ;)
Unfortunately I don't know Java. This would be implemented in MultimediaObject.java, correct?
By the way, here's the kind of output that you get with ffprobe -i [audio file] -show_streams -select_streams a:0
. This is for a 6-channel (5.1) audio file:
Duration: 00:00:08.50, bitrate: 1411 kb/s
Stream #0:0: Audio: dts (DTS) ([1][0][0][0] / 0x0001), 44100 Hz, 5.1(side), fltp, 1411 kb/s
[STREAM]
index=0
codec_name=dts
codec_long_name=DCA (DTS Coherent Acoustics)
profile=DTS
codec_type=audio
codec_time_base=1/44100
codec_tag_string=[1][0][0][0]
codec_tag=0x0001
sample_fmt=fltp
sample_rate=44100
channels=6
channel_layout=5.1(side)
bits_per_sample=0
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/44100
start_pts=N/A
start_time=N/A
duration_ts=374784
duration=8.498503
bit_rate=1411200
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]
Relevant lines:
channels=6
channel_layout=5.1(side)
@BassThatHertz - That's wonderful that you provided the sample output!
@a-schild I referenced something related in my recent pull request - I'm planning on refactoring the parsing logic for MultimediaObjects. I'll keep this issue in mind. Related: my goal is to make it easier to service such enhancement requests in the future.