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

Hide ffmpeg output when capturing stream. #9335

Closed
fergie4000 opened this issue Apr 28, 2016 · 2 comments
Closed

Hide ffmpeg output when capturing stream. #9335

fergie4000 opened this issue Apr 28, 2016 · 2 comments

Comments

@fergie4000
Copy link

@fergie4000 fergie4000 commented Apr 28, 2016

Make sure you are using the latest version: run youtube-dl --version and ensure your version is 2016.04.24. 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.04.24

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

I'll start by saying I'm no expert with Python so I've probably overlooked something simple. I'm using youtube-dl as a module to capture Chaturbate streams and no matter what I do I can't stop ffmpeg output being shown in the terminal. Have included the code I'm trying for now.

from __future__ import unicode_literals
import os, sys

# These print
print('test out')
sys.stderr.write('test error\n')

# Redirect output to null
f = open(os.devnull, 'w')
sys.stdout = f
sys.stderr = f

from youtube_dl import YoutubeDL

# These don't print
print('another test out')
sys.stderr.write('another test error\n')

options = {
}

url = 'https://chaturbate.com/sexydea/'
with YoutubeDL(options) as ydl:
    ydl.download([url])

This produces the following output.

$ python pstest.py 
test out
test error
ffmpeg version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
  configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/i386-linux-gnu --incdir=/usr/include/i386-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv --disable-i686
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100

  ...etc

Any ideas what I'm missing?

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Apr 28, 2016

ffmpeg's output is not controller by the process running youtube-dl. Python in this case. You can add 'postprocessor_args': ['-loglevel', 'panic'] to options.
Another approach is requested (but not implemented yet) in #8571: suppress ffmpeg outputs if 'quiet': True is specified in options.

@yan12125 yan12125 closed this Apr 28, 2016
@fergie4000
Copy link
Author

@fergie4000 fergie4000 commented Apr 29, 2016

I ended up needing external_downloader_args instead, but thanks a lot for pointing me in the right direction.

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
2 participants
You can’t perform that action at this time.