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

Sometime, EOF signal send before the stream end #22

Open
qwerty22121998 opened this issue Mar 8, 2022 · 4 comments
Open

Sometime, EOF signal send before the stream end #22

qwerty22121998 opened this issue Mar 8, 2022 · 4 comments

Comments

@qwerty22121998
Copy link

qwerty22121998 commented Mar 8, 2022

I notice that sometime the EOF signal is sent before the video was done make the song lost a part of it's end

@ggresillion
Copy link

I am also having this issue, I believe with all streams coming from ytdl

@Wolfenheimm
Copy link

Also getting the same issue - trying to debug to see why it's getting EOF before it should

@Wolfenheimm
Copy link

To anyone having these problems, make sure you don't use a for loop containing a select -> this is deprecated/is no longer the right method. Also, check for EOF manually. I'm getting little to no EOF issues anymore by doing it this way. Try:

for err := range done {

		// Something horrible happened...
		if err != nil && err != io.EOF {
			log.Println("FATA: An error occured", err)
		}

		// Hit EOF, cleanup & stop
		if err == io.EOF {
			// Clean up incase something happened and ffmpeg is still running
			encodeSession.Cleanup()
			break
		}
	}

@Wolfenheimm
Copy link

Wolfenheimm commented Sep 24, 2022

To anyone having these problems, make sure you don't use a for loop containing a select -> this is deprecated/is no longer the right method. Also, check for EOF manually. I'm getting little to no EOF issues anymore by doing it this way. Try:

for err := range done {

		// Something horrible happened...
		if err != nil && err != io.EOF {
			log.Println("FATA: An error occured", err)
		}

		// Hit EOF, cleanup & stop
		if err == io.EOF {
			// Clean up incase something happened and ffmpeg is still running
			encodeSession.Cleanup()
			break
		}
	}

deprecated - issue seems fixed with the new usage in the readme.

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

3 participants