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

A way to pass additional arguments to rtmpdump? #10266

Closed
ghost opened this issue Aug 9, 2016 · 8 comments
Closed

A way to pass additional arguments to rtmpdump? #10266

ghost opened this issue Aug 9, 2016 · 8 comments

Comments

@ghost
Copy link

@ghost ghost commented Aug 9, 2016

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.08.07. If it's not read this FAQ entry and update. Issues with outdated version will be rejected.

  • I've verified and I assure that I'm running youtube-dl 2016.08.07

Before submitting an issue make sure you have:

  • At least skimmed through README and most notably FAQ and BUGS sections
  • Searched the bugtracker for similar issues including closed ones

What is the purpose of your issue?

  • Bug report (encountered problems with youtube-dl)
  • Site support request (request for adding support for a new site)
  • Feature request (request for a new functionality)
  • Question
  • Other

Add a way to pass additional arguments to rtmpdump in script
E.g. I have a case, where i need to pass " -y mp4:k2hq/10/100/00818/0061.mp4:0_1 -R" to rtmpdump for it to be able to successfully download the media.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 9, 2016

Currently it's impossible. Which video requires these options?

@ghost
Copy link
Author

@ghost ghost commented Aug 9, 2016

this is the video stream where that argument will download at least a bit of video: rtmp://kanal2-egress.cdn.mind.ee/kanal2vod/k2hq/10/100/00818/0061.mp4:0_1

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 9, 2016

Did you get this URL from some web page? -y, which is an abbreviation of --playpath, (roughly) indicates the full path to a video file. This information is usually available on the web page.

@ghost
Copy link
Author

@ghost ghost commented Aug 9, 2016

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 9, 2016

Duplicate of #3651.
If you already know the playpath and the URL, you can use rtmpdump directly:

rtmpdump --verbose --playpath k2hq/10/100/00818/0061.mp4:0_0 -r rtmp://kanal2-egress.cdn.mind.ee:80/kanal2vod -o output.flv

What youtube-dl should do is parsing the XML. There's no need to provide an option to passing additional parameters in this case.

@yan12125 yan12125 closed this Aug 9, 2016
@ghost
Copy link
Author

@ghost ghost commented Aug 9, 2016

sorry if i forgot to mention but i'm making a script, and that's where i need to pass additional arguemnts to rtmpdump

def _real_extract(self, url):
        video_id = self._match_id(url)
        xmlfile = self._download_xml(update_url_query('http://kanal2.postimees.ee/video/playerPlaylistApi', {'id': video_id}), video_id)

        title = xpath_text(xmlfile, './playlist/video/name')

        for stream in xmlfile.findall('./playlist/video/streamItems/streamItem'):
          url = xmlfile.find('./playlist/video/streamItems').get('host') + stream.get('streamName').replace('k2lq','k2hq')#.replace(':0_1','')
          break

        return {
            'id': video_id,
            'title': title,
            'url': url,
            'rtmpdumpargs': " -y mp4:k2hq/10/100/00818/0061.mp4:0_1 -R" }

notice the last line of code, that's the thing i don't find any way to do

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Aug 9, 2016

Oh, you need:

'play_path': 'mp4:k2hq/10/100/00818/0061.mp4:0_1',
'rtmp_real_time': True,

See youtube_dl/downloader/rtmp.py for more possible parameters.

@ghost
Copy link
Author

@ghost ghost commented Aug 9, 2016

Thanks, I was looking at that file before but must've looked over these

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.