question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add option to prevent transcoding of audio files

See original GitHub issue

Checklist

  • I’m reporting a feature request
  • I’ve verified that I’m running youtube-dl version 2021.01.24.1
  • I’ve searched the bugtracker for similar feature requests including closed ones

Description

Downloading a lossless audio file (tested with .wav and .aiff) with the -x flag causes the audio to be transcoded into mp3. For archiving purposes, having the option to prevent all (audio) transcoding would be ideal.

Examples links: https://soundcloud.com/caleesi-sarahkreis/caleesi-sarahkreis-mbr-sao-paulo https://soundcloud.com/caleesi/arutani-caleesi-ennui-original-mix

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pukkandancommented, Jan 31, 2021

I looked through the source code of extractaudio. These are the conversions it does when you don’t give --audio-format:

aac > m4a flac, mp3, opus = untouched vorbis > ogg everything else > mp3

1reaction
inorickcommented, Jan 31, 2021

As @pukkandan wrote, -x flag always transcodes/converts audio;

This is not completely true as using -x on an .mp3 stream will not cause transcoding:

youtube-dl.exe -x https://soundcloud.com/talderverwirrung/caleesi-im-tal-057
[soundcloud] talderverwirrung/caleesi-im-tal-057: Downloading info JSON
[...]
[download] Destination: Caleesi Im Tal - #057-956484631.mp3
[download] 100% of 56.93MiB in 00:04
[ffmpeg] Post-process file Caleesi Im Tal - #057-956484631.mp3 exists, skipping

It looks like the current rule of the flag is “strip video and transcode audio unless it is mp3”.

The current behavior makes it harder to use youtube-dl in a script to extract audio (with minimal transcoding) from multiple sources (e.g. soundcloud + youtube). It would require to set the -x flag for video sites but omit it for audio-only sites.

Having a demux option looks like a way to address this. I would even argue that it should be the default since the name of the --extract-audio flag suggests extraction only. Transcoding should be an optional second step as it decreases quality further.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Avoid Transcoding - Plexopedia
Learning how to avoid transcoding movie files from your Plex server is a common ... The next best option is Direct stream because...
Read more >
How do i avoid transcoding as much as possible? : r/PleX
Hey, im running a Plex media server on a server pc with very Little cpu Power. What can i do to avoid transcoding...
Read more >
How to really disable transcoding? | Forum
Another way, i guess, is to define all "supported formats" in the conf file. Just add any/all file types. ( see DefaultRenderer.conf, or...
Read more >
View and modify audio tracks in Compressor - Apple Support
In Compressor, view audio and video tracks, enable or disable them, and reconfigure them into alternative formats.
Read more >
Compatible media transcoding - Android Developers
Override transcoding defaults This setting determines whether or not the platform controls automatic transcoding. · Enable transcoding · Assume apps support ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found