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

Cannot convert audio to mp3 while embedding thumbnail #11780

Closed
revolter opened this issue Jan 19, 2017 · 3 comments
Closed

Cannot convert audio to mp3 while embedding thumbnail #11780

revolter opened this issue Jan 19, 2017 · 3 comments

Comments

@revolter
Copy link
Contributor

@revolter revolter commented Jan 19, 2017

Please follow the guide below

  • You will be asked some questions and requested to provide some information, please read them carefully and answer honestly
  • Put an x into all the boxes [ ] relevant to your issue (like that [x])
  • Use Preview tab to see how your issue will actually look like

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

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

The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your issue


If the purpose of this issue is a bug report, site support request or you are not completely sure provide the full verbose output as follows:

Add -v flag to your command line you run youtube-dl with, copy the whole output and insert it here. It should look similar to one below (replace it with your log inserted between triple ```):

> youtube-dl --audio-format mp3 --embed-thumbnail -v https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: [u'--audio-format', u'mp3', u'--embed-thumbnail', u'-v', u'https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.01.18
[debug] Python version 2.7.13 - Darwin-16.3.0-x86_64-i386-64bit
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2
[debug] Proxy map: {}
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Resolving id
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Downloading info JSON
[soundcloud] 187777451: Downloading track url
[soundcloud] 187777451: Checking download video format URL
[soundcloud] 187777451: Checking http_mp3_128_url video format URL
[soundcloud] 187777451: Downloading thumbnail ...
[soundcloud] 187777451: Writing thumbnail to: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.jpg
[debug] Invoking downloader on u'https://api.soundcloud.com/tracks/187777451/download?client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA'
[download] Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav has already been downloaded
[download] 100% of 34.34MiB
ERROR: Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.
Traceback (most recent call last):
  File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 1837, in post_process
    files_to_delete, info = pp.run(info)
  File "/usr/local/bin/youtube-dl/youtube_dl/postprocessor/embedthumbnail.py", line 90, in run
    raise EmbedThumbnailPPError('Only mp3 and m4a/mp4 are supported for thumbnail embedding for now.')
EmbedThumbnailPPError

Description of your issue, suggested solution and other information

Explanation of your issue in arbitrary form goes here. Please make sure the description is worded well enough to be understood. Provide as much context and examples as possible.
If work on your issue requires account credentials please provide them or explain how one can obtain them.

Passing --audio-format mp3 and --embed-thumbnail, I expected it to convert the audio file to .mp3 and then try to embed the thumbnail into it.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 19, 2017

--audio-format has not effects without -x

$ youtube-dl -x --audio-format mp3 --embed-thumbnail -v https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix
[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-x', '--audio-format', 'mp3', '--embed-thumbnail', '-v', 'https://soundcloud.com/nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2017.01.18
[debug] Git HEAD: 1076858f7
[debug] Python version 3.6.0 - Linux-4.9.0-1-ARCH-x86_64-with-arch-Arch-Linux
[debug] exe versions: ffmpeg 3.2.2, ffprobe 3.2.2, rtmpdump 2.4
[debug] Proxy map: {}
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Resolving id
[soundcloud] nucrri-tika/vlad-dobrescu-noaptea-mintii-nctk-remix: Downloading info JSON
[soundcloud] 187777451: Downloading track url
[soundcloud] 187777451: Checking download video format URL
[soundcloud] 187777451: Checking http_mp3_128_url video format URL
[soundcloud] 187777451: Downloading thumbnail ...
[soundcloud] 187777451: Writing thumbnail to: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.jpg
[debug] Invoking downloader on 'https://api.soundcloud.com/tracks/187777451/download?client_id=fDoItMDbsbZz8dY16ZzARCZmzgHBPotA'
[download] Destination: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav
[download] 100% of 34.34MiB in 00:03
[debug] ffmpeg command line: ffprobe -show_streams 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav'
[ffmpeg] Destination: Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3
[debug] ffmpeg command line: ffmpeg -y -i 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav' -vn -acodec libmp3lame -q:a 5 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3'
Deleting original file Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.wav (pass -k to keep)
[ffmpeg] Adding thumbnail to "Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3"
[debug] ffmpeg command line: ffmpeg -y -i 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.mp3' -i 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.jpg' -c copy -map 0 -map 1 -metadata:s:v 'title="Album cover"' -metadata:s:v 'comment="Cover (Front)"' 'file:Vlad Dobrescu - Noaptea Mintii (NCTK remix,Cuts -Dj.Sfera)-187777451.temp.mp3'
@yan12125 yan12125 closed this Jan 19, 2017
@revolter revolter mentioned this issue Jan 19, 2017
4 of 8 tasks complete
@revolter
Copy link
Contributor Author

@revolter revolter commented Jan 19, 2017

Even if it the file is already an audio only file? It already knows it's a .wav file.

@yan12125
Copy link
Collaborator

@yan12125 yan12125 commented Jan 20, 2017

--audio-format is designed as an option for --extract-audio. You may have noticed that extract is a verb yet audio-format just describes a property.

Another semantic consistent approach is allowing --recode-video to convert files to mp3:

diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py
index dfa4ae839..0739855a9 100644
--- a/youtube_dl/__init__.py
+++ b/youtube_dl/__init__.py
@@ -197,7 +197,7 @@ def _real_main(argv=None):
         if not opts.audioquality.isdigit():
             parser.error('invalid audio quality specified')
     if opts.recodevideo is not None:
-        if opts.recodevideo not in ['mp4', 'flv', 'webm', 'ogg', 'mkv', 'avi']:
+        if opts.recodevideo not in ['mp4', 'flv', 'webm', 'ogg', 'mkv', 'avi', 'mp3']:
             parser.error('invalid video recode format specified')
     if opts.convertsubtitles is not None:
         if opts.convertsubtitles not in ['srt', 'vtt', 'ass']:
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.

2 participants
You can’t perform that action at this time.