Skip to main content
Topic: Videoless MP4 conversion possible? (Read 3256 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Videoless MP4 conversion possible?

I downloaded a concert -- contains both motion-picture video and audio -- from YouTube that is 480P (audio 253kbps) mp4. Size: 594MB.

Of course, Foobar plays this fine, minus video.

I converted it to MP3-320, via Foobar Convert Util.,  which sounds very good to my ears.

Still, I can't help but wonder how leaving it in it's native MP4 format, but just "subtracting" the video (permanently, via conversion re-coding), would impact the SQ. Foobar's native Convert utility does not seem to contain this feature. Dunno if an ad-hoc Foobar-based plug-in, for just such a conversion, exists.

For BEST audio-only playback, what's my best option? E.g., just leave it in MP4, video and bigger size and all, and simply use it for AUDIO only. My iPod is fine with that.

That said, I wouldn't mind a slightly smaller size. The MP3-320 file I converted it so is a bit over 200MB and sounds quite similar to MP4.

Thx!!!



Videoless MP4 conversion possible?

Reply #3
There's also the Firefox extension "Complete YouTube Saver" which can save the audio stream from the DASH formats directly as an M4A (AAC) and/or an OGG (Vorbis) file:
https://addons.mozilla.org/en-US/firefox/ad...-youtube-saver/

For reference, the audio for the the HD DASH formats actually use higher bitrates than the all-in-one non-DASH video files.

Videoless MP4 conversion possible?

Reply #4
If you want to use a GUI program to do this, then I recommend TAudioConverter by ozok (a member of HA forum). It really is turning out to be THE best GUI tool for these tasks.

---

If you want to do it via command-line . . . .

Using FFMPEG.EXE to extract raw audio stream from video file without re-encoding:

First we determine the exact audio type in the video file, so we run this command-line:
Code: [Select]
==> ffmpeg.exe -i "Talk Talk Live at Montreux 1986.mp4"

FFMPEG reports this to the console:
Code: [Select]
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2014-03-07 19:37:29
  Duration: 01:26:49.61, start: 0.000000, bitrate: 510 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 480x360 [SAR 1:1 DAR 4:3], 412 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 95kb/s
    Metadata:
      creation_time   : 2014-03-07 19:38:55
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
  At least one output file must be specified

The audio is aac, so now can we run our extraction command:
Code: [Select]
==> ffmpeg.exe -i "Talk Talk Live at Montreux 1986.mp4" -vn -acodec copy "Talk Talk Live at Montreux 1986.aac"


---

I'm not 100% sure about this, but I have a feeling you can set up foobar2000 converter to run that FFMPEG command-line.
You could forget about determining the file-type and just have all output renamed to "some filename.xxx".

Unfortunately, it seems foobar2000 has some missing playback functionality whereby it will not guess if a file is a playable audio file no matter what the file extension.
If I drag a AAC file renamed as "Talk Talk Live at Montreux 1986.xxx" into VLC Media Player, it WILL start playing.
If I drag a AAC file renamed as "Talk Talk Live at Montreux 1986.xxx" into foobar2000, it WILL NOT start playing and foobar2000 error window pops up.

I am wondering if there is a way to configure foobar2000 to guess and play a file if it has unknown file extension and is a playable audio file.
Does anyone here have more info on this?

Videoless MP4 conversion possible?

Reply #5
Anyone: the OP mentions fb2k, does anyone have a suggested syntax for a "custom encoder" that demuxes out audio?


Still, I can't help but wonder how leaving it in it's native MP4 format, but just "subtracting" the video (permanently, via conversion re-coding), would impact the SQ.


As others have pointed out, you want to "demux" rather than convert. The .mp4 file is a container, it can contain video streams and audio streams, and you can extract the audio stream. Most utilities that do this, utilize ffmpeg - if you are not afraid of the command line, a small .bat file can be used to, e.g., extract audio from each mp4 file in the directory.  Most applications support the .m4a suffix on an audio-only mp4 file, maybe a good idea if you have both. (I actually convert concert.mp4 to concert.mp4.m4a, then I know it came from the concert.mp4 file.)

Demuxing is what you SHOULD do - avoid transcoding lossies as long as you can. (If you "can" not, say, if you have an mp3 player that plays mp3 but not AAC-in-mp4, then keep the original.) Demuxing is also sometimes referred to as to "re-encapsulate" - this taking as understood that you put the stream into some new container, e.g. you end up with an .m4a rather than an .aac - for most purposes you do not want raw AAC files, the format is quite featureless.

By the way, the (Chromium-based) Torch browser does download from Youtube and extract to .aac. Which is a bit dumb yes.
Memento: this is Hydrogenaudio. Do not assume good faith.

Videoless MP4 conversion possible?

Reply #6
Using FFMPEG.EXE to extract raw audio stream from video file without re-encoding:

First we determine the exact audio type in the video file, so we run this command-line:

[...]

The audio is aac, so now can we run our extraction command:
Code: [Select]
==> ffmpeg.exe -i "Talk Talk Live at Montreux 1986.mp4" -vn -acodec copy "Talk Talk Live at Montreux 1986.aac"


For mp4 files, I would have done this in one single step (do I need the "-sn"?)

Code: [Select]
==> ffmpeg.exe -i "Talk Talk Live at Montreux 1986.mp4" -vn -sn -acodec copy "Talk Talk Live at Montreux 1986.m4a"


Why?

- I don't really want raw .aac. I want something useable. The mp4 container is adequate for AAC files.
- In fact, .m4a is adequate for whatever is in the .mp4. (OK, if it were an MP3 stream, they also fit in .mp4, then I could reconsider ...)

There is always this issue of what to put the stream into, hence your two-step procedure - but for .mp4, I know it fits the MP4 container.
Derailing the thread a bit: I have tried to find whether there is any way to specify a list of preferred file formats by codec, so that I do not have to read the info for each  file; I would want ffmpeg to default to .m4a if it finds an AAC stream, to .mp3 if it finds an MP3 stream, to .ogg if it finds a Vorbis stream. Any tools, anyone?



Derailing the thread even further:

Unfortunately, it seems foobar2000 has some missing playback functionality whereby it will not guess if a file is a playable audio file no matter what the file extension.

It seems also to reject too badly damaged files. E.g., make a .txt file, rename it to .mp3, and fb2k does not recognize it. Which means I cannot trust the integrity verifier unless I actually see the files showing up - too damaged files will not even be imported, and hence they will not be tested, and hence not give any error message.
Memento: this is Hydrogenaudio. Do not assume good faith.

Videoless MP4 conversion possible?

Reply #7
Demuxing is what you SHOULD do - avoid transcoding lossies as long as you can. (If you "can" not, say, if you have an mp3 player that plays mp3 but not AAC-in-mp4, then keep the original.) Demuxing is also sometimes referred to as to "re-encapsulate" - this taking as understood that you put the stream into some new container, e.g. you end up with an .m4a rather than an .aac - for most purposes you do not want raw AAC files, the format is quite featureless.
I orig used JDownloader2 to grab and DL the concert from YT. I forgot that JD2 automatically demuxes (I think) and audio-only file along with the standard *.MP4 a/v file.
The audio-only file-type is a *.m4a, and it's 162.157MB 256kbps.

I'll try out some of the demux utils you guys mentioned, and see how it compares with the one native to JD2.

Videoless MP4 conversion possible?

Reply #8
The orig. 600MB non-demux a/v mp4 --> MP-320 (using Foobar's Lame conv.) does result in an MP3 sounding a bit louder and not as clear.

The demux m4a file (the one JD2 spits out automagically along with the mp4 for its usual DL) sounds same as non-demux a/v mp4.

What sucks is that my DAP (Teclast T-51) does not want to play the m4a file. It didn't even recognize the file. I changed the file-type to mp4. That got the T-51 to recognize it as a "video" file but it won't play it! It plays std a/v mp4 files fine -- both audio and video. But that sucks up a lot of juice -- not ideal for portable use!

Videoless MP4 conversion possible?

Reply #9
More weird stuff (well weird for me)...
(The following tests were all in Foobar, not in my DAP)

I used Foobar Convert to convert JD2's demuxed m4a (256k) audio-only file to mp3-320. And it sounds better (quieter) than Foobar Convert non-demuxed a/v mp4 to mp3-320. But just a tad worse than playing m4a or mp4

I ran the DR Meter to confirm a few things. So, my subjective assessment that the louder mp4 --> mp3-320 seems louder is correct.

=== BELOW are two files, which I converted to mp3-320 using Foobar: (1) mp4 --> mp3-320; (2) m4a --> mp3-320 ===

DR        Peak        RMS    Duration Track
--------------------------------------------------------------------------------
DR11      -0.30 dB  -13.78 dB  1:26:50 ?-Talk Talk - Live At Montreux (1986) DVDRip
DR12      -6.58 dB  -21.20 dB  1:26:50 ?-Talk Talk Live  at Montreux 1986 (256kbit)
--------------------------------------------------------------------------------

Number of tracks:  2
Official DR value: DR11

Samplerate:        44100 Hz
Channels:          2
Bitrate:          320 kbps
Codec:            MP3
===============

=== BELOW is the JD2-demuxed m4a 256kbps file ====
--------------------------------------------------------------------------------

                Left              Right

Peak Value:    -6.91 dB  ---    -6.58 dB 
Avg RMS:      -21.19 dB  ---    -21.22 dB 
DR channel:    11.65 dB  ---    11.54 dB 
--------------------------------------------------------------------------------

Official DR Value: DR12

Samplerate:        44100 Hz
Channels:          2
Bitrate:          254 kbps
Codec:            AAC
================================

======BELOW is the non-demux 600MB mp4 a/v file===

foobar2000 1.1.11 / Dynamic Range Meter 1.1.1
log date: 2014-04-08 03:53:22

--------------------------------------------------------------------------------
Statistics for: ?-Talk Talk Live  at Montreux 1986 (480p)
Number of samples: 229761044
Duration: 1:26:50
--------------------------------------------------------------------------------

                Left              Right

Peak Value:    -6.91 dB  ---    -6.58 dB 
Avg RMS:      -21.19 dB  ---    -21.22 dB 
DR channel:    11.65 dB  ---    11.54 dB 
--------------------------------------------------------------------------------

Official DR Value: DR12

Samplerate:        44100 Hz
Channels:          2
Bitrate:          254 kbps
Codec:            AAC
================================================================================

Videoless MP4 conversion possible?

Reply #10
What sucks is that my DAP (Teclast T-51) does not want to play the m4a file. It didn't even recognize the file. I changed the file-type to mp4. That got the T-51 to recognize it as a "video" file but it won't play it! It plays std a/v mp4 files fine -- both audio and video. But that sucks up a lot of juice -- not ideal for portable use!


Oh. You need to generate a low-quality easily-decodable black screen for video part?  Well to check if that is the issue: try to remux the mp4 into an mp4. If your T-51 refuses to play that, then it is likely a header thing.


Re the dynamic range measurements: they could be unreliable for lossies, if they measure peak-to-RMS. A lossy can have a very loud single sample (you won't notice that) if that is more economical with the bits than encoding a "limit this peak".

Memento: this is Hydrogenaudio. Do not assume good faith.

Videoless MP4 conversion possible?

Reply #11
Re the dynamic range measurements: they could be unreliable for lossies, if they measure peak-to-RMS. A lossy can have a very loud single sample (you won't notice that) if that is more economical with the bits than encoding a "limit this peak".
Like I noted, the increased (subjective) loudness I heard in the Foobar-converted mp4-->mp3  file did (later) confirm when I DR'd it.
I have run several DR Meter tests of lossless vs. lossy ... and usually they match up.
Also, the dr-loudness website database contains quite a few lossy entries that pretty much match up to the same albums/tracks of their lossless versions.

They don't sound the same, of course, so that's one "limitation" of the DR Meter, I suppose

Videoless MP4 conversion possible?

Reply #12
Just a quick query...

(Assume file size is a non-issue)

Since the demuxed m4a is 256kbit AAC....
...and I can only use MP3 in my DAP (or upconvert it to DAP-friendly lossless, like WAV or FLAC)...
... is it best to convert to mp3-256k? I.e., does "upconverting" to MP3-320 subtract audio fidelity/quality.

Thanks!

Videoless MP4 conversion possible?

Reply #13
Just a quick query...

(Assume file size is a non-issue)

Since the demuxed m4a is 256kbit AAC....
...and I can only use MP3 in my DAP (or upconvert it to DAP-friendly lossless, like WAV or FLAC)...
... is it best to convert to mp3-256k? I.e., does "upconverting" to MP3-320 subtract audio fidelity/quality.

Thanks!

Hmm,

Some comments. AAC to MP3 will, by definition, produce a "distorted" sound - whether it sounds "better" or "worse" is purely a matter of taste.

AAC to WAV or FLAC should sound no worse than the original AAC audio - assuming that the converter does not add artifacts.

A related point re ffmpeg. In general, ffmpeg should be able to extract the audio stream and hopefully convert faithfully it to WAV. However, this is not always the case.

I have a MP4 where the audio is AC-3 256 Kbps, 48 KHz, 16 bit, stereo - ffmpeg did not convert the file properly to WAV. Sure, it played OK - but the dynamic range was shot to bits - basically it was compressed.

However, using ffmpeg to demux - and then play the AC-3 file to the amplifier via fb2k and SPDIF was fine. ffmpeg is usually great - but not always :-(

Re: Videoless MP4 conversion possible?

Reply #14
Hi there. I have same problem, need to convert youtube video to audio. I convert youtube videos to mp3 usually with Youtube source and Lame and it works pretty well. This is for vlogs / talking videos, so coverting lossy-to-lossy doesn't matters.
But I want to make process a bit faster, so demuxing is better idea.

I made conversion pattern. After finish foobar returns the error
Code: [Select]
1 out of 1 tracks converted with major problems.

Source: "www.youtube.com/watch?v=neE_IZYhpjs"
  An error occurred while transferring attached pictures (invalid box/atom header) : "E:\watchv=neE_IZYhpjs.mp4"

Also, file 5-minute file is 37 MB, too big for audio. What's wrong?

Re: Videoless MP4 conversion possible?

Reply #15
But I want to make process a bit faster, so demuxing is better idea. I made conversion pattern. After finish foobar returns the error
fb2k's converter can't be used for demuxing.


Re: Videoless MP4 conversion possible?

Reply #17
For program demuxing is convertation with special parameters, isn't it?
No. foobar2000 always decodes input audio, and %s is not a source audio. It's a temporary WAV file with decoded audio.

 

Re: Videoless MP4 conversion possible?

Reply #18
foobar2000 can't do that, it will decode the audio before sending it to the "encoder".

 
SimplePortal 1.0.0 RC1 © 2008-2018