HaroldMills / Vesper

Open source software for acoustic monitoring of nocturnal bird migration.
MIT License
55 stars 6 forks source link

Error indicates channel number is at fault when /admin settings more accurate #192

Closed RichardLitt closed 2 years ago

RichardLitt commented 2 years ago

I've run into this issue a few times, where I have a bad setup in one way or another, and when I try to import some Recordings, they fail because Vesper "Could not infer recorder channel numbers for recording file". I've run a diff on the output of ffprobe -i Ithaca_2022-03-06_00.00.00_Z_01.wav -show_streams -select_streams a:0 on two files: my own, and the example audio that the Vesper docs suggest I use to start and test and instance. I found these results:

My audio:

[STREAM]
index=0
codec_name=pcm_s16le
codec_long_name=PCM signed 16-bit little-endian
profile=unknown
codec_type=audio
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=86400000
duration=3600.000000
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: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
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
[/STREAM]

Example audio:

[STREAM]
index=0
codec_name=pcm_s16le
codec_long_name=PCM signed 16-bit little-endian
profile=unknown
codec_type=audio
codec_tag_string=[1][0][0][0]
codec_tag=0x0001
sample_fmt=s16
sample_rate=22050
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/22050
start_pts=N/A
start_time=N/A
duration_ts=39579750
duration=1795.000000
bit_rate=352800
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
DISPOSITION:captions=0
DISPOSITION:descriptions=0
DISPOSITION:metadata=0
DISPOSITION:dependent=0
DISPOSITION:still_image=0
[/STREAM]

Of which the only difference was this:

➜  Desktop diff testfile.txt ../Downloads/testfile.txt
10c10
< sample_rate=22050
---
> sample_rate=24000
17c17
< time_base=1/22050
---
> time_base=1/24000
20,22c20,22
< duration_ts=39579750
< duration=1795.000000
< bit_rate=352800
---
> duration_ts=86400000
> duration=3600.000000
> bit_rate=384000

I couldn't figure out how to change my WAV file to match the settings, so I scraped the entire Vesper instance and started over. I didn't run into the issue again.

I'm logging this because this isn't the first time I've had a channel issue for my files, which I always record in mono for Vesper and for NFCs. If I run into this again, I'm going to add to this here. For now, there might be some way to check whether the channel error is overfiring.

HaroldMills commented 2 years ago

It sounds like the issue probably doesn't concern your audio file contents or sample rate, but rather the combination of the file name (in particular, the "Ithaca" part) and the station and device metadata that are in your archive. Whenever you import a recording, Vesper uses those metadata and the file name to figure out which station the recording is from and associate a microphone with each recording channel, and the "Could not infer recorder channel numbers for recording file" indicates that it couldn't do that. I'm happy to help debug such problems as they arise. I also plan to eliminate a lot of the device metadata that Vesper currently requires to simplify archive setup. This should make it easier to provide the information that Vesper needs to assign microphones to recording channels, especially for small (e.g. single-station, single-microphone) archives.

RichardLitt commented 2 years ago

the combination of the file name (in particular, the "Ithaca" part) and the station and device metadata that are in your archive.

I agree.

I'm happy to help debug such problems as they arise.

Thanks. In that case, maybe let's close this? No need for a long-standing issue.

I also plan to eliminate a lot of the device metadata that Vesper currently requires to simplify archive setup. This should make it easier to provide the information that Vesper needs to assign microphones to recording channels, especially for small (e.g. single-station, single-microphone) archives.

This will help! Thank you!