ffmpeg audio channel layout unknown to stereo/mono

1.4k Views Asked by At

I have one audio file, below I have attached the audio metadata,

the audio layout is "unknown", how to set the audio layout "Stereo" or "mono"?

now I am using the FFmpeg tool in NodeJs,

please suggest any other media customization tool also comfortable to the NodeJs

{ streams:
 [ { index: 0,
   codec_name: 'pcm_s16le',
   codec_long_name: 'PCM signed 16-bit little-endian',
   profile: 'unknown',
   codec_type: 'audio',
   codec_time_base: '1/24000',
   codec_tag_string: '[1][0][0][0]',
   codec_tag: '0x0001',
   sample_fmt: 's16',
   sample_rate: 24000,
   channels: 1,
   channel_layout: 'unknown',
   bits_per_sample: 16,
   id: 'N/A',
   r_frame_rate: '0/0',
   avg_frame_rate: '0/0',
   time_base: '1/24000',
   start_pts: 'N/A',
   start_time: 'N/A',
   duration_ts: 34546,
   duration: 1.439417,
   bit_rate: 384000,
   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: [Object] } ],
format:
 { filename: './Audios/temp/1607064049732/1607064049732-2.wav',
   nb_streams: 1,
   nb_programs: 0,
   format_name: 'wav',
   format_long_name: 'WAV / WAVE (Waveform Audio)',
   start_time: 'N/A',
   duration: 1.439417,
   size: 69136,
   bit_rate: 384244,
   probe_score: 99 },
   chapters: [] }]
1

There are 1 best solutions below

2
On

in your case, based on channels property with value 1, I would just fallback to mono in the application code. It unlikely to have any other channel_layout than mono while having only one channel in the stream.

From my experience, ffmpeg/ffprobe reports limited set of information when working with WAV/raw PCM formats.