dca icon indicating copy to clipboard operation
dca copied to clipboard

Sometime, EOF signal send before the stream end

Open qwerty22121998 opened this issue 3 years ago • 4 comments

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

qwerty22121998 avatar Mar 08 '22 17:03 qwerty22121998

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

ggresillion avatar Apr 25 '22 15:04 ggresillion

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

Wolfenheimm avatar May 12 '22 21:05 Wolfenheimm

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 avatar May 24 '22 23:05 Wolfenheimm

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.

Wolfenheimm avatar Sep 24 '22 17:09 Wolfenheimm