LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 11-28-2019, 03:50 PM   #1
donatom
Member
 
Registered: Feb 2012
Location: Southern California
Distribution: Archlinux, Debian, Fedora
Posts: 44
Blog Entries: 4

Rep: Reputation: Disabled
Using ffmpeg as a work-around for youtube-dl, especially on raiplay.it site


For the past 2 years I have used youtube-dl to capture streamed video from German sites (ARD.de, ZDF.de) and raiplay.it (an Italian site with many archived videos) with great success. However, recently this open-source software does not work with raiplay.it. When capturing is attempted there is invariable an error thrown ("Failed to parse JSON").

This error has been reported at yt-dl.org but so far nothing has been done to fix the problem. I have therefore started using ffmpeg as a work-around:

Here is the command to capture streams in the mp4 format (such files can be used for plexmediaserver):

Code:
 ffmpeg -f pulse -ac 2 -i default  -f x11grab   -video_size 1154x686 -i :0.0+0,156 -acodec aac -vcodec libx264  -preset ultrafast  -threads 2 -framerate 30 -y -t 01:40:00 Lea.mp4
There are three places where you will have to change the command for your own capturing. First the video_size will have to be modified, as well as information after "-i". "154" represents how far down from top of the desktop the streaming starts. To get this info, I open another instance of firefox and shrink the window to fit in the area of the stream; then I use the command "xwininfo" and click on the firefox window which is covering the stream. Here is how the print-out of the xwininfo command looks:

Code:
 xwininfo: Window id: 0x2400003 "rasperry pi - Google Search - Mozilla Firefox"

  Absolute upper-left X:  5
  Absolute upper-left Y:  155
  Relative upper-left X:  5
  Relative upper-left Y:  29
  Width: 1154
  Height: 686
  Depth: 24
  Visual: 0xca
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x2400002 (installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +5+155  -121+155  -121-183  +5-183
  -geometry 1154x686+0+126
Note: in the event that xwininfo gives you odd numbers, you must convert them into even numbers (subtract 1 from them); otherwise ffmpeg will throw an error. You can see that I changed “Absolute upper-left Y” from 155 to 154.

Modify the length of the stream after -t (my stream was 1 hour, 40 minutes) to correspond to your own stream. Ffmpeg will then stop capturing the stream after the amount of time indicated.

Unfortunately (unlike youtube-dl) you will not be able to use your computer until after the capture is complete.
 
Old 11-29-2019, 01:13 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Great you got it working with ffmpeg.

However, I wonder what version of youtube-dl you are using?
according to version 2019.11.28, RaiPlay is supported:
Code:
youtube-dl --list-extractors |grep -i raiplay
RaiPlay
RaiPlayLive
RaiPlayPlaylist
 
Old 11-29-2019, 01:31 PM   #3
donatom
Member
 
Registered: Feb 2012
Location: Southern California
Distribution: Archlinux, Debian, Fedora
Posts: 44

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
Great you got it working with ffmpeg.

However, I wonder what version of youtube-dl you are using?
according to version 2019.11.28, RaiPlay is supported:
Code:
youtube-dl --list-extractors |grep -i raiplay
RaiPlay
RaiPlayLive
RaiPlayPlaylist
Thanks, ondoho. I just updated youtube-dl to 2018.11.28 via pip. I still get the error:
Code:
$ youtube-dl https://www.raiplay.it/video/2015/09/Non-uccidere-S1E1-8c6cc315-82f3-4677-b68a-07d84d6a84c9.html
[RaiPlay] 8c6cc315-82f3-4677-b68a-07d84d6a84c9: Downloading video JSON
ERROR: 8c6cc315-82f3-4677-b68a-07d84d6a84c9: Failed to parse JSON  (caused by ValueError('No JSON object could be decoded',)); please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see  https://yt-dl.org/update  on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
One raiplay.it/youtube-dl user sent in a bug-report to yt-dl.org/bug and I also chimed in. It has been a month and nothing has changed. So . . .
 
Old 11-30-2019, 01:31 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
I cannot access that video even with my browser, always get a login popup.
Am I missing something here?
 
Old 11-30-2019, 09:52 AM   #5
donatom
Member
 
Registered: Feb 2012
Location: Southern California
Distribution: Archlinux, Debian, Fedora
Posts: 44

Original Poster
Blog Entries: 4

Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
I cannot access that video even with my browser, always get a login popup.
Am I missing something here?
You must sign up in order to watch these movies ("Registratti") and then you must sign on ("Accedi"). The process is free of charge. In order to do this, click on the three lines in the upper right-hand corner on the raiplay.it web-page.

In order to view some videos you have to be (or appear to be) in Italy. I use unlocator.com in order to use the site. Some VPNs will work as well.

Sometimes Firefox doesn't work, so I then try Chrome which seems to always work.

Last edited by donatom; 11-30-2019 at 09:58 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How To Download A YouTube Playlist And Convert It To MP3 Using youtube-dl LXer Syndicated Linux News 0 10-22-2019 06:04 AM
ffmpeg mpeg2 encoding bottleneck, and I can't find a work around. darkstarbyte Linux - Software 2 11-03-2012 06:17 AM
[SOLVED] Compiz glxgears get's around 400 FPS where OpenBox get's around 1300 FPS, Why? MikeyCarter Linux - Software 5 02-14-2011 04:25 PM
Apache site redirects using what rule? foo.site.com -> www.site.com/foo LaughingBoy Linux - Server 2 04-16-2009 09:51 PM
Does the latest version of ffmpeg not work with ffmpeg-php? whitey4900 Linux - Software 0 08-04-2008 05:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 09:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration