Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error parsing ffmpeg stats: strconv.ParseFloat: parsing "N": invalid syntax #24

Open
IoIxD opened this issue Mar 11, 2022 · 6 comments
Open

Comments

@IoIxD
Copy link

IoIxD commented Mar 11, 2022

The error in the title clogs the terminal as the library struggles to play the first few seconds of any audio file without stuttering, and it eventually just outright changes to Voice connection closed, then inevitably timeout waiting for voice, then inevitably it panics with invalid memory address or nil pointer dereference.

A video of the error can be seen here

My code is as follows:

// start the audio session
options := dca.StdEncodeOptions
encodingSession, r := dca.EncodeFile("HOTEL_MARIO_TONE.mp3", options)
er(r)
defer encodingSession.Cleanup()

done := make(chan error)
dca.NewStream(encodingSession, vc, done)
err = <- done
if(err != nil && err != io.EOF) {
	// keep trucking, actually.
	fmt.Println(err)
}

My ffmpeg version is 5.1, however this happened on 5.0 as well. I don't think the audio file is important because this error persists across three of them, but here it is (note that the fact that it's one second long doesn't matter, it does this with many other longer fiels as mentioned previously)

@qwerty22121998
Copy link

Got the same problems, but it doesn't seem to stop the stream, still work fine

@Mariownyou
Copy link

Mariownyou commented Sep 10, 2022

The same problem. Can't covert file. The same error
Error parsing ffmpeg stats: strconv.ParseFloat: parsing "N": invalid syntax

@celian-hamon
Copy link

Same here:
2022/09/11 14:35:16 Error parsing ffmpeg stats: strconv.ParseFloat: parsing "N": invalid syntax

@rudyjcruz831
Copy link

rudyjcruz831 commented Oct 7, 2022

same issue but still works fine:
2022/10/07 14:43:12 Error parsing ffmpeg stats: strconv.ParseFloat: parsing "N": invalid syntax
Playback: 6.98s, Transcode Stats: Time: 0s, Size: 0kB, Bitrate: 0.00kB, Speed: 0.0x

@pechano
Copy link

pechano commented Feb 19, 2023

Getting the same error when encoding to .dca. I think it has something to do with the ffmpeg args from the encode.go file. Maybe fffmpeg syntax has changed since this was released?
I will try it with an older version of ffmpeg from around six years ago: https://ffmpeg.org/releases/

Edit:It has something to do with (at the very least) how the speed stat is read from FFMPEG. It expects a float but get "N/A" instead. I think thats where the "N" in the error comes from.

@toby3d
Copy link

toby3d commented Aug 23, 2023

Similar problem, but in a slightly different place: unrecognized -vol flag. For this I had to vend this package, comment out this flag in this line, and specify "volume=1.0" value in the AudioFilter field of the EncodeOptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants