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

Downloading video file and converting to mp3 error #168

Open
JustinMarchi opened this issue Dec 5, 2020 · 5 comments
Open

Downloading video file and converting to mp3 error #168

JustinMarchi opened this issue Dec 5, 2020 · 5 comments
Labels

Comments

@JustinMarchi
Copy link

I've tried to reinstall and insure correct filepath in my system environment variables for FFMPEG however every time I try to convert a YouTube link to an mp3 I'm given a "pipe:0: Invalid data found when processing input"

Any insight?

Thanks!

@TimeForANinja
Copy link

how exactly are you calling ffmpeg?

@jimmy5312
Copy link

Same issue here. Was working fine few days ago, then got this issue "pipe:0: Invalid data found when processing input"

Tried running the given example
ytdl http://www.youtube.com/watch?v=_HSylqgVYQI | ffmpeg -i pipe:0 -b:a 192K -vn myfile.mp3
, same error.

Save to file
ytdl "http://www.youtube.com/watch?v=_HSylqgVYQI" > myvideo.mp4
, then the resulting myvideo.mp4 is corrupted and cannot be opened.

However, the other format of save to file
ytdl -o "myvideo.mp4" "http://www.youtube.com/watch?v=_HSylqgVYQI"
actually works.

So my temporary workaround

ytdl -o "myvideo.mp4" "http://www.youtube.com/watch?v=_HSylqgVYQI" ; ffmpeg -i myvideo.mp4 -b:a 192K -vn "myvideo.mp3" ; rm myvideo.mp4

package.json

"ytdl": "^1.4.1",
"ytdl-core": "^4.1.4"

@TimeForANinja
Copy link

TimeForANinja commented Dec 15, 2020

🤔 can't replicate on Linux

@jimmy5312
Copy link

Hi, not sure is it my configuration issue, upon further checking, it seems this issue only arise when I use Windows PowerShell to execute the commands. Running the command from normal cmd.exe and from Mac terminal is fine.

@fent fent added the bug label Dec 18, 2020
@fent
Copy link
Owner

fent commented Dec 18, 2020

ytdl uses process.stdout.isTTY to know if the program is piping to a terminal. if that property is false, it will assume the program is being piped to another program, so will print the video output directly. in contrast, if it is piping to a terminal, then it will print a few video details plus a progress bar. which is i think is what's being printed, and then piped to ffmpeg.

so there might be some sort of incompatibility with powershell and the isTTY check

if this check can't be fixed, i could add a special output like --output=- that could instruct ytdl to pipe output directly to stdout.

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

No branches or pull requests

4 participants