Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Playing mpeg audio? (Read 5237 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Playing mpeg audio?

Hi
I have a problem. Lately several podcasts I listen to have started to come in mpeg format instesd of mp3. Foobar doesn't play then (but others like Mediamonkey and WMP do). Why is it so? Might it be because the format seems a little odd, Windows says its a Movie Clip although it only has audio.
Please help, is it possible to play mpeg in foobar?

Playing mpeg audio?

Reply #1
What is the file format, and what is the extension? Often you can re-encapsulate the content (without transcoding, i.e. without any concerns over quality) into a container format that fb2k can read. For an mpeg stream it would most likely be .mp4.

But if it is one of those files containing no audio, merely streaming info ... then fb2k cannot (as of last time I tried) handle those.

Playing mpeg audio?

Reply #2
foobar2000 won't play video files (MPG/MPEG PS/TS).
It's only audiophile if it's inconvenient.

Playing mpeg audio?

Reply #3
check the foobar console found on the view menu.

i rememeber a previous thread about podcasts that had this error....

Code: [Select]
Unable to open item for playback (Unsupported format or corrupted file (invalid box/atom header)):


you can download yamb/mp4box* and this will extract the audio and put it into a new m4a container which will then be playable by foobar. ffmpeg could probably do it as well.

*just to be clear, that's not a choice - it's 2 things you have to download together.

Playing mpeg audio?

Reply #4
foobar2000 won't play video files (MPG/MPEG PS/TS).


?

foobar2000 happily plays the audio part of all my .mp4 video files which contain supported audio. IME it has had its objections to .mkv-encapsulated content, but most work.

Edit: ah, but not .mpg / .mpeg video files.

Playing mpeg audio?

Reply #5
ffmpeg could probably do it as well.


Certainly.

I have a temporary convert-these-files directory, and bat files like e.g. convert-mov-to-mp4.bat with content as follows (replace <path-to-ffmpeg!> with the path):
for /R %%f in (*.mov) DO <path-to-ffmpeg!>\ffmpeg.exe -i "%%f" -codec copy "%%f.mp4"

Double-click the .bat file, and it takes every .mov file in the directory, and reencapsulates into a .mp4 container. The resulting file - playable in fb2k - gets filename like e.g. INFILE.mov.mp4, but that is fine with me - then I know what I got it from. 

If one does not want to use .bat files, merely the command line, replace double percents by single.

For extracting audio only, the parameters are -i INFILE.mp4 -acodec copy - vn -sn OUTFILE.m4a
(-vn removes video and -sn removes subtitle elements).

Just giving ffmpeg -i INFILE - do this in a cmd window then - gives information on the streams with their respective codecs.

.flv and .avi files could contain codecs that - AFAIK - are not supported by an .mp4 container. And I just encountered a quirky file: From http://www.rotting-christ.com/home/media/ , grab the Nemecic video file. It has PCM uncompressed audio content, and I had to go a detour by way of .mov or by way of .mkv in order to convert the PCM to lossless without splitting and joining the streams. But ffmpeg didn't allow me to encode with a lossless-compressed audio codec to .mp4. I could go by way of .mov though, and since FLAC is my lossless codec of choice and I do not have any lossless-audio .mp4's, I ended up storing it as .mkv.

Playing mpeg audio?

Reply #6
For extracting audio only, the parameters are -i INFILE.mp4 -acodec copy - vn -sn OUTFILE.m4a
(-vn removes video and -sn removes subtitle elements).

Just giving ffmpeg -i INFILE - do this in a cmd window then - gives information on the streams with their respective codecs.


I just want to add some emphasis to using "ffmpeg -i" first, to see what streams are in the file. Video files are normally a container format, and inside it are multiple data streams: one video stream, and one or more audio streams, and maybe subtitle pictures as well. So the actual command line for extracting one of the audio streams may not be exactly as shown above. The ".mp4" and ".m4a" suffixes in particular are assuming you have AAC audio in your .mp4 video container.

If you can't figure it out, just post the output of "ffmpeg -i INFILE" here (replace INFILE with the actual filename), and we can help you figure out the right command line to get the audio into a file you can play.

Playing mpeg audio?

Reply #7
The ".mp4" and ".m4a" suffixes in particular are assuming you have AAC audio in your .mp4 video container.


ffmpeg -i is a Good Thing that should be recommended yes, but this statement is not correct?
An .m4a is nothing but an .mp4 container with a different (non-standard-but-everywhere-accepted) file suffix, right? So .m4a can contain any audio that .mp4 can contain? (If it is .flv, then it is different. And I think so for .mov too?)

I do check content yes. For example, an .mp4 or an .m4a can contain MP3 audio - if I want to extract audio, then I extract to (you guessed it) .mp3.
And .mp4 and .m4a can also contain ALAC - I believe that is the most common way to use that codec? Then I export to FLAC, which is my lossless codec of choice, and besides I do not want to mix lossless and lossy, reserving .mp4/.m4a for the latter. For video files with lossless audio - where I want to keep the video file, not merely the audio - I use Matroska.

Playing mpeg audio?

Reply #8
Right, yes... I am assuming the OP is unfamiliar with the nuances of the formats, so I'm just saying that if your original video is a .mpg or .vob then you would not want to try to stuff its mp2, ac3, or pcm audio into a .m4a container.

Playing mpeg audio?

Reply #9
Right, yes... I am assuming the OP is unfamiliar with the nuances of the formats, so I'm just saying that if your original video is a .mpg or .vob then you would not want to try to stuff its mp2, ac3, or pcm audio into a .m4a container.


Yep, and the fact that both .mpg and .mov can contain stuff you cannot fit in .mp4 is somewhat unexpected to a novice. (Well it was unexpected to me ... mp2 fits though, but I don't see the point.)



By the way: how would one go forth to script a Windows .bat which opens a window with the ffmpeg -i information when you  drop a file on it?
Edit: that is asking for trouble: http://stackoverflow.com/questions/1243240...-multiple-files

Playing mpeg audio?

Reply #10
The container of choice is obviously Matroska (MKV, MKA), also because it plays the (first) audio stream fine in foobar2000.
It's only audiophile if it's inconvenient.

Playing mpeg audio?

Reply #11
fb2k cannot tag Matroska :-(

Edit: Huh, it does change some tags although it returns a "Could not update tags (Unsupported format or corrupted file) on:" error.

... ffmpeg writes clean compliant Matroska files, ja?

Playing mpeg audio?

Reply #12
fb2k cannot tag Matroska :-(

Edit: Huh, it does change some tags although it returns a "Could not update tags (Unsupported format or corrupted file) on:" error.
Code: [Select]
ffmpeg -i input.mp3 -acodec copy -vn -sn output.mka
works fine here, and the files can be tagged using foobar2000. But it copies some of the metadata to the wrong fields. TRACKNUMBER became DISCNUMBER, ARTIST became ALBUM ARTIST, TITLE got not copied and some other stuff. I guess the mapping in ffmpeg is broken.

EDIT: Now I get the error as well, time to investigate...

EDIT 2: Aha, I can tag some of the fields, for example ARTIST, but when I try to tag TITLE it shows the error message. So, some of the fields do work, while others produce the error message. After tagging those erroneous files the error message will always be displayed. Also, the metadata fields seem to contain all the information put into them. Very weird.

EDIT 3:
... ffmpeg writes clean compliant Matroska files, ja?
MKVToolNix produces files which are tagable. So I guess ffmpeg creates broken MKVs. Remuxing the ffmpeg created MKVs with MKVToolNix creates tagable files as well. So I guess
Code: [Select]
mkvmerge -o output.mka input.mp3
should be preferred over using ffmpeg for muxing, even though it doesn't copy tags. At least it doesn't copy the tags wrong.

EDIT 4: So a solution to the OPs question would be to remux the videos files into MKV using MKVToolNix/MKVmerge:
Code: [Select]
mkvmerge -o output.mka input.mpg
It's only audiophile if it's inconvenient.

Playing mpeg audio?

Reply #13
EDIT 2: Aha, I can tag some of the fields, for example ARTIST, but when I try to tag TITLE it shows the error message. So, some of the fields do work, while others produce the error message. After tagging those erroneous files the error message will always be displayed. Also, the metadata fields seem to contain all the information put into them. Very weird.


Strange. No issues with only Title here. Genre OTOH ...

Also, fb2k can remove tags (Properties --> Tools --> Remove tags) from the "fresh from ffmpeg" file. Then I can e.g. write RG without errors. But once I hit the Genre field - then I can not even remove tags anymore.


ffmpeg -version:

ffmpeg version N-60797-g76dd01e
built on Feb 20 2014 22:01:52 with gcc 4.8.2 (GCC)
[deleted configuration, which made browser window milewide]
libavutil      52. 65.100 / 52. 65.100
libavcodec    55. 52.102 / 55. 52.102
libavformat    55. 33.100 / 55. 33.100
libavdevice    55. 10.100 / 55. 10.100
libavfilter    4.  1.103 /  4.  1.103
libswscale      2.  5.101 /  2.  5.101
libswresample  0. 17.104 /  0. 17.104
libpostproc    52.  3.100 / 52.  3.100