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

Allow custom ffmpeg rtmp output #8940

Closed
ghost opened this issue Mar 22, 2016 · 6 comments
Closed

Allow custom ffmpeg rtmp output #8940

ghost opened this issue Mar 22, 2016 · 6 comments

Comments

@ghost
Copy link

@ghost ghost commented Mar 22, 2016

I want youtube-dl to push a youtube livestream via ffmpeg with rtmp module to custom rtmp url.

D:\Programs\ffmpeg\bin>youtube-dl.exe --verbose -f best "https://www.youtube.com/watch?v=*VIDEO_NUMBER*" --no-part --encoding -c copy -f flv "rtmp://MY_SERVICE/MY_KEY_HERE"

I get an error "LookupError: unknown encoding: -c"

Is there a way to work it arond and force custom ffmpeg settings inside youtube-dl?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 22, 2016

That is not possible but you can extract stream URL with youtube-dl -g ... and then call ffmpeg yourself.

@ghost
Copy link
Author

@ghost ghost commented Mar 22, 2016

Ok, I managed to grab video only so far by:

ffmpeg -i https://manifest.googlevideo.com/LONG_GOOGLE_URL/playlist/index.m3u8 -c copy -bsf:a aac_adtstoasc -f flv rtmp://MY_SERVICE/MY_KEY_HERE

But there are two flaws - there's no audio, and it plays stream since the beginning of vsh 4 hours.
So, please help to enable audio and grab it from realtime, not past, please.

Disabling VSH allows to capture realtime, and recording to localhost saves sound, but streaming with rtmp just breaks sound.

@ghost
Copy link
Author

@ghost ghost commented Mar 22, 2016

Found a solution:

ffmpeg -i https://manifest.googlevideo.com/LONG_GOOGLE_URL/playlist/index.m3u8 -c copy -acodec aac -strict -2 -bsf:a aac_adtstoasc -f flv rtmp://MY_SERVICE/MY_KEY_HERE

Should manually encode to aac, but that seems to fix the issue. Thanks for help.

@ghost ghost closed this Mar 22, 2016
@dstftw
Copy link
Collaborator

@dstftw dstftw commented Mar 22, 2016

-acodec copy should be enough.

@ghost
Copy link
Author

@ghost ghost commented Mar 22, 2016

Ok, I'll have to polish it later. Thank you for sending me to "-g". :-)

@ghost
Copy link
Author

@ghost ghost commented Mar 23, 2016

Tested it. -acodec copy doesn't work. But that doesn't matter either.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.