LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-15-2021, 07:15 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
recording from youtube.com with youtube-dl, ffmpeg fails to merge


i am working on a separate, totally different, project involving youtube-dl and ffmpeg. i get only separate video (mp4) and audio (webm) files and an empty that i suspect is the intended merge.

i am trying to download my brother's wedding video at https://www.youtube.com/watch?v=yakmwIqa8cs

i get the follow error messages:

Code:
[download] 100% of 45.58MiB in 01:05
[ffmpeg] Merging formats into "Howard Wedding-yakmwIqa8cs.mp4"
[debug] ffmpeg command line: ffmpeg -y -loglevel repeat+info -i 'file:Howard Wedding-yakmwIqa8cs.f137.mp4' -i 'file:Howard Wedding-yakmwIqa8cs.f251.webm' -c copy -map 0:v:0 -map 1:a:0 'file:Howard Wedding-yakmwIqa8cs.temp.mp4'
ERROR:   Stream #1:0 -> #0:1 (copy)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/YoutubeDL.py", line 2075, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 523, in run
    self.run_ffmpeg_multiple_files(info['__files_to_merge'], temp_filename, args)
  File "/usr/local/lib/python3.6/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 235, in run_ffmpeg_multiple_files
    raise FFmpegPostProcessorError(msg)
youtube_dl.postprocessor.ffmpeg.FFmpegPostProcessorError:   Stream #1:0 -> #0:1 (copy)
i've also tried merging into mkv with a similar failure. does anyone know what is going on with youtube-dl and ffmpeg? i have gotten merge files from several weeks ago and an attempt back in 2017, but they all have no audio. play this in a browser works fine (i hear audio). playing the webm file plays audio only. thus, i suspect youtube-dl doesn't know how to record all youtube.com videos. how is this one different if it can record other videos?

and, no, i am not in it. so don't bother trying to guess who i am.

Last edited by Skaperen; 01-15-2021 at 07:17 PM.
 
Old 01-16-2021, 04:05 AM   #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
Full command line, full output please.
 
Old 01-16-2021, 05:44 AM   #3
lvm_
Member
 
Registered: Jul 2020
Posts: 948

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
1. update youtube-dl to the latest version (sudo youtube-dl -U), also make sure that ffmpeg and python are updated
2. run youtube-dl with -k to keep downloaded files and then run ffmpeg manually as specified at '[debug] ffmpeg command line:' to diagnose the issue further

I was able to download and merge your video into mkv using ffmpeg post-processing without issues, so the problem is with your setup, not with youtube-dl.
 
Old 01-16-2021, 11:52 AM   #4
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
it must be something in my local script that runs youtube-dl then. i always wrap major things with a script so that things like arguments and option are consistent and deliberate. that i don't forget something the next i run the command. running my script looks like this:
Code:
ytdl https://www.youtube.com/watch?v=yakmwIqa8cs
what will be relevant is how the script then runs youtube-dl. it forms the command it is about to do in a list and calls print to display it just before it executes it. i can optionally enable a differ wedge script by setting execute permission on it. it is in ~/cmd which is in the PATH list ahead of /usr/bin. so, i need to get a full output as ondoho requested. i'll need to run it, again, as the virtual work space i previously run it on has been scrolled with other stuff. will post again with that.
 
Old 01-16-2021, 01:03 PM   #5
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i stumbled onto the problem. it's in mplayer. the merged video did have audio. if the previous video it played was muted when it quit, that mute setting, wherever it was set (maybe in pulseaudio?), was still in effect on the next video it played, even though mplayer's own state for mute was disabled. pressing "m" twice (enabled then disabled) fixes it. but ffplay works correctly. my guess is that mplayer needs to either silence itself if it set mute on pulseaudio or initialize things more appropriately.

i am not going to follow up on mplayer, though i should be sure i have the latest version i may learn to use ffplay.
 
Old 01-16-2021, 01:48 PM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i think i am getting different projects mixed up in my head. i need to focus on one for a while. the wedding project was having a different issue that i am now unable to reproduce even though i has happened a few times before. maybe i need to rewrite these scripts. youtube-dl seems to be working OK, now.
 
Old 01-17-2021, 02:42 AM   #7
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Originally Posted by Skaperen View Post
youtube-dl seems to be working OK, now.
That utility is updated so often that my weekly zypper checks for update aren't sufficient. I wound up writing a small script to update just youtube-dl via cron. I don't use it all that often but until I started looking for updates daily, it seemed it was always out of date. I feel for the maintainer.
 
1 members found this post helpful.
Old 01-17-2021, 08:17 AM   #8
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833Reputation: 1833
Quote:
it seemed it was always out of date. I feel for the maintainer.
I do too. That's because utube changes all the time, on purpose. They change a keyword just a little in the source so that you have to change the script to parse the json. They also deliver different source for different user_agents. They have to respond to a recent googlebot user agent though. Otherwise they could not index it.
 
Old 01-17-2021, 02:33 PM   #9
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
so, i should upgrade youtube-dl whenever something fails, and try again.
 
Old 01-17-2021, 04:42 PM   #10
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554
Quote:
Originally Posted by Skaperen View Post
so, i should upgrade youtube-dl whenever something fails, and try again.
That's what I do.

Unlike others, I find it can vary anywhere from 3 weeks to 3 months between upgrades - my guess is it depends on the videos involved.

 
Old 01-18-2021, 12:58 AM   #11
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
Quote:
Originally Posted by boughtonp View Post
Unlike others, I find it can vary anywhere from 3 weeks to 3 months between upgrades - my guess is it depends on the videos involved.
For youtube-dl?
At least for youtube itself, updates come in about weekly, sometimes more often, if there is a need. (There was a lull during the RIAA desaster, though.) Other sites can take much longer.
I hope you're not relying on your distro's packaged youtube-dl. No, you must use the version straight from their site, or from github, and be able to pull in updates yourself. youtube-dl even has a "-U" option for that.
 
Old 01-18-2021, 02:29 AM   #12
lvm_
Member
 
Registered: Jul 2020
Posts: 948

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Quote:
Originally Posted by ondoho View Post
At least for youtube itself, updates come in about weekly, sometimes more often, if there is a need.
Any software in active development is updated fairly frequently but it doesn't mean there is a *need* for that. I use youtube-dl fairly often and mostly for youtube but update it only when something stops working, and that happens nowhere near to what you are saying - couple of times a year or so.
 
Old 01-18-2021, 07:42 AM   #13
boughtonp
Senior Member
 
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 3,616

Rep: Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554Reputation: 2554
Quote:
Originally Posted by ondoho View Post
For youtube-dl?
At least for youtube itself, updates come in about weekly, sometimes more often, if there is a need.
Yes, youtube-dl from their site, downloading from YouTube. I'm not saying there aren't changes - the release notes show how often the youtube extractor is updated - but my use of youtube-dl apparently does not encounter breaking issues as frequently as others appear to.

 
Old 01-18-2021, 05:33 PM   #14
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684

Original Poster
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
i suppose youtube-dl updates could be from just one site in the huge list needing a scraper update. so each update might fix what just a fraction of users need to be fixed. to the extent that updates are expensive, just update when needed. how do you know when that is? :-)
 
Old 01-19-2021, 12:40 PM   #15
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
Quote:
Originally Posted by lvm_ View Post
Any software in active development is updated fairly frequently but it doesn't mean there is a *need* for that. I use youtube-dl fairly often and mostly for youtube but update it only when something stops working, and that happens nowhere near to what you are saying - couple of times a year or so.
That is not my experience at all, at least for youtube.com itself.
The ability to download videos breaks every now and then (*), because effing googlevideo changed the site layout again, with that specific purpose. The problem is that it rarely breaks completely, only for certain videos, certain countries, only for playlists etc.etc.
youtube-dl is keeping abreast by updating its code all the time. This is not comparable to updates in other software development in general.
You can update often, pre-emptively so to speak, or only after you hit a snag - the outcome is the same in the end.

(*) I can't say exactly because I do update pre-emptively, but even so it happens every couple'o months or so, that I cannot download, update youtube-dl, then can download.
 
  


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
[SOLVED] how do i merge mp4 video files using ffmpeg ? dEnDrOn Linux - Software 2 02-04-2012 06:17 AM
Merge many files in to one big file. like 20 file merge in one big file Jmor Linux - Newbie 2 10-29-2008 09:41 PM
LXer: kgdb, To Merge Or Not To Merge LXer Syndicated Linux News 0 02-05-2008 06:10 PM
LXer: KHTML Vs Webkit: To Merge or Not To Merge LXer Syndicated Linux News 0 10-27-2007 06:41 AM
convert and merge a fat32 to ext3 and then merge w/ another ext3? nkoplm Linux - General 3 03-23-2006 10:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:47 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