Skip to main content

Topic: Convert mp4 Youtube video to lossless audio file (Read 30456 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • 320kbp/s
  • [*]
Convert mp4 Youtube video to lossless audio file
Hey guys, I try to convert some of my favorite songs from Youtube video file (.mp4) to lossless music, but the best result is only 320kbp/s.
Could you please show me a software that we can convert mp4 file from Youtube to lossless form like wav or flac, ...
Thank you very much !

  • probedb
  • [*][*][*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #1
There's no point converting it to lossless, it's already compressed, it'll just take up more space for no gain in quality over the aac (?) in the .mp4 container.

Just demux the mp4 and keep the audio separate.

  • 320kbp/s
  • [*]
Convert mp4 Youtube video to lossless audio file
Reply #2
Quote
Just demux the mp4 and keep the audio separate

Okay, thanks, but how can I seperate them ? Could you please show me a software ? I use Audioro Zune HD Converter and I did converted some of my videos to mp3 320kbp/s.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Convert mp4 Youtube video to lossless audio file
Reply #3
You could try MP4Box. Check its documentation to be sure, but IIRC you'll need to run -info to determine the ID of the audio track, then run -extract with that ID to dump it to a new file. There are probably GUI programs (or frontends for MP4Box) that can also do this, if you prefer that; have a search.

As said already there's no point converting to MP3. You'll just lose quality and space. This applies to any format, even lossless ones (though in this case you just lose space).
  • Last Edit: 17 June, 2010, 04:44:03 PM by dv1989

  • splice
  • [*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #4
Avidemux (http://avidemux.org) will extract the audio from a .MP4 file and write it to a WAV file.
As others have pointed out, the recommended method is to first determine what format the audio is in already within the MP4 file. If you can use it in that format, then just split it out to a file using Avidemux or similar.
Regards,
   Don Hills

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Convert mp4 Youtube video to lossless audio file
Reply #5
Avidemux (http://avidemux.org) will extract the audio from a .MP4 file and write it to a WAV file.

This would be suboptimal. However, if I have interpreted the remainder of your post correctly, it seems that you acknowledge this:

Quote
As others have pointed out, the recommended method is to first determine what format the audio is in already within the MP4 file. If you can use it in that format, then just split it out to a file using Avidemux or similar.

According to Wikipedia, all YouTube videos have their audio in AAC format. Thus it should be trivial to extract the raw AAC. However, I forgot to mention above that you'll want to add a new MP4 container to the resulting raw AAC file with the -add option. I can't edit my above post--so here's what I hope is a slightly more descriptive, accurate, and hopefully useful list of steps:

mp4box -info youtubefile.mp4 = Get TrackID of the audio track
mp4box -raw TrackID = Extract this track to a raw AAC file
mp4box -add resultingfile.aac yournewfile.m4a = Add to this raw file an MP4 container (needed by many apps, including iTunes which 'prefers' the file extension m4a for audio-only files)
  • Last Edit: 17 June, 2010, 08:09:00 PM by dv1989

  • 320kbp/s
  • [*]
Convert mp4 Youtube video to lossless audio file
Reply #6
Thank you very much dv1989 !
However I tried using Mp4box gui, I see from the youtube.mp4 info that quality of the AAC file is only 96 or 100kbp/s. It's quite small than the others I got from Audioro Zune HD Converter. So the problem is, is that 320kbp/s getting from Audioro Zune HD Converter faked ?  Sorry for my English and may be stupid questions 
More details :




  • Last Edit: 17 June, 2010, 11:26:45 PM by 320kbp/s

Convert mp4 Youtube video to lossless audio file
Reply #7
Converting any audio file to MP3 will mean quality is lost. The resulting MP3 will always be inferior to the original.

This means the 96 kbps AAC track will be superior to the 320 kbps MP3.

By extracting the AAC audio, the original quality is preserved, regardless of file size.
  • Last Edit: 18 June, 2010, 02:02:07 AM by Compact Dick

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Convert mp4 Youtube video to lossless audio file
Reply #8
However I tried using Mp4box gui, I see from the youtube.mp4 info that quality of the AAC file is only 96 or 100kbp/s. It's quite small than the others I got from Audioro Zune HD Converter. So the problem is, is that 320kbp/s getting from Audioro Zune HD Converter faked ?

Yes, it simply transcodes the lossy AAC file to a higher-bitrate lossy MP3 file. As Compact Dick and I have said, converting any lossy format to another will decrease quality. If the bitrate is higher you will lose disk space as well as quality. Transcoding to lossless will preserve quality but waste even more space. So as CD said, you must settle for the low-bitrate AAC/M4A track. Or you could buy the song(s) in a better format . . .

  • enry2k
  • [*][*]
Convert mp4 Youtube video to lossless audio file
Reply #9
Did you try Yamb, another Ui for MP4Box, you can extract the aac track to .m4a file which can be played by your Zune wihtout any recoding loss

Enrico

  • Artie
  • [*][*]
Convert mp4 Youtube video to lossless audio file
Reply #10
According to Wikipedia, all YouTube videos have their audio in AAC format. Thus it should be trivial to extract the raw AAC. However, I forgot to mention above that you'll want to add a new MP4 container to the resulting raw AAC file with the [font= "Courier New"]-add[/font] option. I can't edit my above post--so here's what I hope is a slightly more descriptive, accurate, and hopefully useful list of steps:

[font= "Courier New"]mp4box -info youtubefile.mp4[/font] = Get TrackID of the audio track
[font= "Courier New"]mp4box -raw TrackID[/font] = Extract this track to a raw AAC file
[font= "Courier New"]mp4box -add resultingfile.aac yournewfile.m4a[/font] = Add to this raw file an MP4 container (needed by many apps, including iTunes which 'prefers' the file extension m4a for audio-only files)


I'm just learning MP4Box myself, but doesn't the command:

mp4box -single TrackID youtubefile.mp4

. . . automatically combine those last two commands into one?

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Convert mp4 Youtube video to lossless audio file
Reply #11
Now that I check the documentation, it appears to, so that’s a good point.

  • mixminus1
  • [*][*][*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #12
The end result isn't exactly the same, though...files that are created via the "-single" method display a bitrate of "Unknown" in iTunes, whereas files made via the two-step method display the correct bitrate, so there appears to be some difference in how the metadata is written.
"Not sure what the question is, but the answer is probably no."

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Convert mp4 Youtube video to lossless audio file
Reply #13
Ah, thanks. I know there’s an ‘issue’ where if one names the file whatever.mp4 (instead of m4a) iTunes identifies a 0 kbps video track; does that have any effect on this?
  • Last Edit: 20 October, 2010, 10:36:49 AM by dv1989

  • romor
  • [*][*][*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #14
320kbp/s

what's the point of "p" in the name?
It's either metric Kb/s or american kbps or even kb/s, but kbp/s is wrong

  • mixminus1
  • [*][*][*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #15
Interesting...with the .mp4 extension, iTunes will display the correct bitrate of the "-single" file (as well as reporting a video track with resolution of 0x0), but now the sample rate is "Unknown", and the "Sample Rate" field doesn't even show up in the "Get Info" dialog box...still plays correctly, though.

Strange things are afoot at the Circle K...
"Not sure what the question is, but the answer is probably no."

  • Chef
  • [*]
Convert mp4 Youtube video to lossless audio file
Reply #16
You could try MP4Box. Check its documentation to be sure, but IIRC you'll need to run -info to determine the ID of the audio track, then run -extract with that ID to dump it to a new file. There are probably GUI programs (or frontends for MP4Box) that can also do this, if you prefer that; have a search.

As said already there's no point converting to MP3. You'll just lose quality and space. This applies to any format, even lossless ones (though in this case you just lose space).

This is a silly supposition, but if you think converting to lossless will not cause a decrease in quality when converting from a lossy format, and you think (presumably) converting lossless to lossy accrues no special loss of quality (other than that is already specified by the lossy format, then does it logically follow that were converting lossy to lossy causes many problems, converting lossy to lossless and then to another lossy format should not have any special losses of quality? This is not supposing that you can make a 128 kb/s file a 196 kb/s file (in terms of the quality they are associated with), but that a 320 kb/s mp3 that someone might want to convert to at 192 kb/s mp3 would be better done with this middle step due extra problems involved in directly converting lossy to lossy formats.

Anyone tried this extensively? I'd be interested to know... An abcx test of a lossless to lossy to lossy, a lossy to lossless to lossy, and the original lossless, would be interesting, if I understand the issues with lossy to lossy conversion correctly.

  • mixminus1
  • [*][*][*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #17
...if I understand the issues with lossy to lossy conversion correctly.

No, you don't.

Once again, lossless=lossless=lossless...loss...less...no loss...etc.

Any lossy->lossy process necessarily involves an intermediate "lossless" step, i.e. the source lossy file MUST be decompressed to straight PCM, and then that PCM data is encoded into a new lossy file.

Whether that intermediate PCM data is stored in a RAM buffer or as a lossless file on a disk, it is the exact same data (barring memory or disk corruption, of course) and it must exist.

As such:

Quote
lossless to lossy to lossy, a lossy to lossless to lossy,


are one and the same, assuming that the first lossy file in the second process was encoded from the same lossless file at the beginning of the first process.

edit:  Wow, strange things are indeed afoot at the Circle K...dv1989 and I posted essentially the exact same answer one minute apart...which should give you some idea of how often this issue comes up...I think it's something like n+1  .
  • Last Edit: 20 October, 2010, 11:57:34 AM by mixminus1
"Not sure what the question is, but the answer is probably no."

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Convert mp4 Youtube video to lossless audio file
Reply #18
For the trillionth time, there is no such thing as a direct conversion between audio formats. The source file is always decompressed to PCM before being fed into the encoder of the destination file. What seems to confuse some people and lead to questions like yours is that some applications hide this fact.

So, yes, I’m afraid that is a silly supposition. Lossless is lossless; that is, it is exactly the same as the decompressed PCM fed to the destination encoder.

  • Miramis
  • [*]
Convert mp4 Youtube video to lossless audio file
Reply #19
XMedia Recode can be used to extract the audio. Select Copy Audio (= audio will not be recoded).
Rhythmbox, Flac + Vorbis, Sennheiser HD650 + Sony MDR-XB1000

  • Artie
  • [*][*]
Convert mp4 Youtube video to lossless audio file
Reply #20
For the trillionth time, there is no such thing as a direct conversion between audio formats. The source file is always decompressed to PCM before being fed into the encoder of the destination file. What seems to confuse some people and lead to questions like yours is that some applications hide this fact.


Thanks for that clarification. I've always wondered about that.

So, supposing that I don't care about iTunes, (and I don't), is the "-single" command ok to use in all other aspects? I don't mind using the 3-command format if thats better in some way.


  • mixminus1
  • [*][*][*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #21
FWIW, personally, I've only processed a handful of files using the "-single" method (about a dozen), and thus far, I haven't encountered any problems outside of iTunes not being able to read the bitrate.

iTunes can play them just fine, and foobar2000 also plays them fine and displays the correct bitrate.
  • Last Edit: 20 October, 2010, 04:09:49 PM by mixminus1
"Not sure what the question is, but the answer is probably no."

  • Artie
  • [*][*]
Convert mp4 Youtube video to lossless audio file
Reply #22
Thanks mix. Still, it makes you wonder whats going on deep down inside, so to speak.

  • db1989
  • [*][*][*][*][*]
  • Global Moderator
Convert mp4 Youtube video to lossless audio file
Reply #23
Interesting...with the .mp4 extension, iTunes will display the correct bitrate of the "-single" file (as well as reporting a video track with resolution of 0x0), but now the sample rate is "Unknown", and the "Sample Rate" field doesn't even show up in the "Get Info" dialog box...still plays correctly, though.

Strange things are afoot at the Circle K...
Wait, so that’s with the extension mp4? I meant that iTunes prefers m4a, which doesn't lead to the 0x0 video track being shown in Properties. So your unknown bitrate issue was with the extension m4a?

I also wonder what the technical reason is for the difference between the 3- and 2-command methods, and whether it really matters in the end, but I personally would probably use the former, just to get maximum correctitude from my kibilops (and the superior breathability it confers on my audio, duh!)

  • mixminus1
  • [*][*][*][*][*]
Convert mp4 Youtube video to lossless audio file
Reply #24
Correct:

- .m4a extension on "-single" produced file: iTunes displays "Unknown" for the bitrate, all other (meta)data is correct

- .mp4 extension on "-single" produced file: iTunes displays the correct bitrate (as well as the empty video track), but then displays "Unknown" for the sample rate - note that it also does this with the 2-step produced file

I had been using source files encoded with iTunes, so I tried using Nero's CLI encoder to produce one, and got the exact same results.
"Not sure what the question is, but the answer is probably no."