Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Download only Audio bytes #9754
Comments
Is there an existing command line tool for this? I don't think MP4 parsing is something trivial. |
|
Related: #9302 |
|
I don't know if there is, anyway by searching a bit i found a project that seems to do that. https://github.com/feribg/audiogetter/blob/master/audiogetter/src/main/java/com/github/feribg/audiogetter/tasks/download/VideoTask.java |
|
On https://github.com/feribg/audiogetter it says:
And I indeed got non-trivial compile errors. Do you have a working example? |
|
Just tried and it is working. But it doesn't support files over HTTP.
|
|
@WiS3 Regarding the idea: I have downloaded a 10 minute mp4 from YT. When I open it in an app called Mp4Explorer to show the mp4 moov structure, it lists 1.269 "chunk box offsets" for the audio track. Based on the audiogetter source code long[] chunkOffsets = chunkOffsetBox.getChunkOffsets();
...
for (int i = 0; i < chunkOffsets.length; i++) {
...
chunks.add(new Chunk(i, chunkStartOffset, chunkEndOffset, offsetInFile));
}it looks like one has to do a http range-request for every chunk to download the audio data. That would be overkill if correct and would probably get ip banned pretty fast. |
I want to download from YouTube the best Audio Quality possible.
Since the Audio Only files are at low bitrate (usually 128k), i have to download the whole Audio+Video (format 22 usually has the best audio), and then extract the audio.
But i don't want to download the entire video file to only get the audio.
I know it is possible to download only Audio bytes by parsing the format header and skip all video frames to save bandwidth.
For example 4K Video Downloader does this with YouTube to get the best Audio quality from a video.
It parses the MP4 header, and download only the audio bytes.
it is possible to implement this functionality?