MilliVolt / streamer

streaming process of video and audio
1 stars 1 forks source link

aubio/db error: video_audio_beat_times_lessequal_duration #13

Closed myf closed 8 years ago

myf commented 8 years ago

we have been getting this a lot, the error code reads:

text: 'error: insert into "tft"."video" ("audio_beat_times", "duration", "tags", "url_id", "video_metadata") values ($1, $2, $3, $4, $5) - new row for relation "video" violates check constraint "video_audio_beat_times_lessequal_duration"' }

and i seem to have found the reason for the conflict:

Here in the id 2CSUBgq0t8U the duration is 115 is is rouded up by youtube,

and the last signature from aubio output is 115.205803 which exceeds 115 thus do not get to add to our database.

@vr2262

vr2262 commented 8 years ago

wow -_- thanks youtube

vr2262 commented 8 years ago

well you can either detect that situation and add 1 to the duration or i can change the constraint to handle duration+1

myf commented 8 years ago

i managed to get duration from ffprobe this way

ffprobe -v quiet -print_format compact=print_section=0:nokey=1:escape=csv -show_entries format=duration audio_2CSUBgq0t8U

and this returns:

115.181000

which is smaller than 115.20 that aubio outputs. It's an approximation and I think +1 makes moren sense.

myf commented 8 years ago

by +1 i mean +1 on the constraint

vr2262 commented 8 years ago

OK.