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: Support of audio from MPG/MPEG/M2V files. (Read 10179 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Support of audio from MPG/MPEG/M2V files.

I looked through forums for information about such plugin, but I found only old questions (asked in 2006-2009...). Does anyone knows about existing plugin that will let me play just audio stream from .mpg/.mpeg/.m2v files? I DON'T need any support for video stream. I found old Haali's plugin for some DirectShow files (foo_input_ds) that allows to play audio from .avi and .mkv as well as .ts/.m2ts files files after adding them in configuration dialog. But it can't handle .mpg files even when added in config. Surprisingly it can even play audio from .mpg files with extension changed to .avi, but I don't want to do such change in all my mvids for compatibility reasons (with TV and BluRay player).
So? Anyone uses such .mpg plugin and can link to it?

Support of audio from MPG/MPEG/M2V files.

Reply #1
foo_input_exe + ffmpeg.exe and you can play audio from almost any video file

Support of audio from MPG/MPEG/M2V files.

Reply #2
Decode command: ffmpeg.exe -i %s -f wav %d
File type mask: *.mpg; *.mpeg; *.m2v; *.vob

This works for these file types, but is it the correct decode command?
Would this decode command, with %d, be the only way to get a song length at all, or is there some ffmpeg command I can use to get a song length while piping the output instead?

Support of audio from MPG/MPEG/M2V files.

Reply #3
I came here to ask for exact command line as going through ffmpeg documentation scared me a bit... So thanks CoRoNe for asnwering my question before I even asked it, and let me join in your question  . How to get lenght of track without using temp wavs?
Other question is - if foobar uses FFmpeg code to decode some audio formats now, then isn't it possible to let foobar to catch audio (and only audio) from all video formats that are supported by FFmpeg by some simple code tweak/change? This question goes to foobar developers of course...

Support of audio from MPG/MPEG/M2V files.

Reply #4
For your 2nd question...after some testing, I'd say:

Code: [Select]
Format name: ffmpeg
Decode command: ffmpeg.exe -i %s -f wav -
File type mask: *.avi; *.mpeg; *.vob; *.ts; *.m2ts; *.mp4; *.mov; *.ogm; *.mkv; *.flv; *.rm
Decoder output format: wav

Notes:
- At the moment Foobar always unsuccesfully uses its own resources to open mpg[mp2]-files. Adding *.mpg to the "File type mask" doesn't make a difference. Renaming to .mpeg does help for now.
- Foobar supports mp4[aac] just fine. *.mp4 is for everything not aac. (in my collection of test files I had a mp4[nellymoser]- and a mp4[als]-file for instance)
- Rename ogg[theora(or any other video format)+vorbis]-files to .ogm. Although ffmpeg/ffplay can handle/play them just fine, Foobar can't open them, no matter if you add *.ogg to the "File type mask" or not.
[edit]- *.webm isn't necessary. Foobar can play the Vorbis-soundtrack. *.mkv is for just in case. I've had some Matroska files Foobar itself couldn't open.[/edit]
- *.wmv isn't necessary. Foobar can play all the soundtracks.
- Everything else plays just fine!  (without a clip length or the ability to time-seek though)

Support of audio from MPG/MPEG/M2V files.

Reply #5
Well something is strange...
I used your command and at first it worked fine. It showed time of track and .mpg files played fine. But I noticed that there was something that changed in configuration of foo_input_ds - *.mpg was added to file mask. What is completely strange foobar doesn't ask me for ffmpeg localisation... I wanted to check something and I deleted my "MPEG Video" profile. When check has failed I recreated profile and... everything stopped working. .mpg files won't play or (not all the time) foobar throws that it can't find specified decoder... What happened? how files were played at the begining? how should I point foobar to ffmpeg executable? where are temporary wavs stored? I couldn't find them anywhere.

EDIT:
OK so how it works for me:
I got foo_input_ds from Haali installed. When I add "*.mpg" to it's "Supported file types " list in foobar's "Advanced settings/DirectShow Input Settings" and create "MPEG Video" profile in Command-line Decoder Wrapper settings with just decode command: "ffmpeg.exe -i %s -f wav %d" and  file type mask: "*.mpg; *.mpeg; *.m2v; *.vob" AND restart foobar - everything works fine. .mpg files are played fine and got length displayed. Before I restart foobar application throws that it cannot find decoder and any MPEG-PS file can not be played. After foobar restart everything works fine - tell me how foobar finds ffmpeg on my PC then? And how it works if I can't catch ffmpeg process in Windows Task Manager (Admin account, "show all processes" checked)? I can't also localize any temp wav files - even with Unlocker. Problem that occured when I first deleted and recreated my profile in Command Line Decoder was that in foobar's  "Advanced settings/DirectShow Input Settings/Supported file types" I got " *mpg" instead of "* .mpg" (that small dot matters...). Now everyting works fine again. When I add " *.mpeg" and " *.m2v" to "Advanced settings/DirectShow Input Settings/Supported file types" they also play fine and show length... For .flv files I use foo_flv - you can find it here on foobar's forum - in 3rd party plugins section or upload section. .ts, .m2ts, .mts, .m2t and .mkv works just fine with just foo_input_ds - as well as .avi files. Additionally .vob files work - at current config (foo_input_ds + .vob added in it's config and added in Command Line Decoder Wrapper config - same as with .mpg and .m2v).

EDIT2:
However .mpg files sometimes just skip and can't play after certain time point. Some of them play with glitches throughout whole track. Also, strange thing is that format description is just file extension (I set is in Command Line Decoder Wrapper settings as " MPEG Video"), that bitrate of audio isn't diplayed, but bit depth is... Mostly it's 16bit, but I found one file that shows 32 bits... Bit depth in lossy transform coding... so it have to be that wav bit depth but how about bitrate? Sample rate is displayed... Mostly 48k, but also 44k is often... Something is strange.

EDIT3:
This configuration seems to be bit unstable. After working for more than hal an hour foobar stopped playing .mpg files and started producing glithes - like there were no profiles in CLDW and no input_ds installed. Restart of application solved this problem. Also I can't play .mov files. I can't even add them into playlist.

EDIT4:
Looks like every change to configuration (adding or deleting file extension into/from CLDW profile or into/from "Advanced settings/DirectShow Input Settings/Supported file types") requires restart of foobar. Otherwise after changing settings and changing track foobar throws that it can't find decoder...

Support of audio from MPG/MPEG/M2V files.

Reply #6
First of all, I don't use and have never used foo_input_ds, so I can't help you with that.

how should I point foobar to ffmpeg executable?
Quote
Use the bottom pane of the preferences page to specify folders containing your decoder binaries. If your binaries are present in %PATH%, there's no need to do so.

where are temporary wavs stored? I couldn't find them anywhere.
I'm still on WinXP and I found them in C:\Documents and Settings\Admin\Local Settings\temp.

Also, strange thing is that format description is just file extension...
[edit]I guess that's all foo_input_exe is forwarding from ffmpeg for Foobar to use. You could ask Peter.[/edit]

Support of audio from MPG/MPEG/M2V files.

Reply #7
I found another glitch in my current config. As I said before, certain .mpg/.mpeg/.m2v files play only partially or with glitches/crackles. Other thing is that in every .mpg/.mpeg/.m2v file that I played, when I tried to seek to distant point from current play position playback was interrupted and then track was automatically changed. This does not affect .ts/.m2ts,..., .mp4, .vob, .avi and .mkv files - all that are natively supported by foo_input_ds (.ts/.m2ts,..., .avi and .mkv)+ .mp4 and .vob

Support of audio from MPG/MPEG/M2V files.

Reply #8
I found ghosts on my PC. Ghots are playing audio from my video files sometimes instead of ffmpeg. Above you can find my configuration. What I've noticed that I could never found temp wav file and I was never asked by my firewall weather foobar can run ffmpeg. Sometimes I couldn't play audio from my videos and sometimes everything worked fine. Today something changed. At first I couldn't play any audio from my MPG files. I've tried change some config and restart foobar but it didn't work. Suddenly, about 15 minutes ago for the first time my firewall asked if foobar can run ffmpeg.exe... For the first time I found temp wav file... For the first time I understand how it works... Then my question is - how it worked before? Output with ffmpeg wasn't set to stdout - never. It was always set to output temp wavs which never could be found. ffmpeg wasn't run. Then how it worked? :/  I don't like ghosts on my PC...

Support of audio from MPG/MPEG/M2V files.

Reply #9
I found ghosts on my PC. Ghots are playing audio from my video files sometimes instead of ffmpeg.


What file types? *.mpg and *.mkv can be handled by foobar itself. But for me *.mpg is always played with glitches when it is handled by foobar.
If you have foo_input_exe and foo_input_ds installed together, maybe one time your files was handled by foo_input_ds and other time - by foo_input_exe

Support of audio from MPG/MPEG/M2V files.

Reply #10
And the other time by foobar itself - that was the moments which I described as "sometimes I couldn't play audio from my videos" - there were glitches. These are mpg/m2v/mpeg files. What causes that randomnes in handling these files? I thought that detection of components and other opening and decoding routines are quite unambiguous algorithms... What can I do to make handling of mpg/m2v/mpeg files bounded with foo_input_exe+ffmpeg only? or with foo_input_ds only ? That makes me corious. Currently I see ghosts that are chosing randomly between 3 kinds of handling available in foobar...

EDIT:
So it looks like quite long time my mpg/m2v/mpeg files were handled by foo_input_ds (when they were working) or by internal foobar routines (when they were not working) and today, for the very first time ffmpeg was used, despite it was properly configured since begining... So again -  what can I do to make handling of mpg/m2v/mpeg files bounded with foo_input_exe+ffmpeg only? or with foo_input_ds only ?

Support of audio from MPG/MPEG/M2V files.

Reply #11
That makes me corious. Currently I see ghosts that are chosing randomly between 3 kinds of handling available in foobar...

The same for me  But my "ghost" is choosing between 2 kinds of handling available in foobar, because I not use foo_input_ds.
I tested it many, many times and it seems completely random. You better ask Peter about this.

Support of audio from MPG/MPEG/M2V files.

Reply #12
Should I bother him via PM or should I just wait patiently for his look on this thread? I really want it to be solved...

Support of audio from MPG/MPEG/M2V files.

Reply #13
When there are multiple handlers for some format, the behavior is kept random by design as there's no logic for foobar2000 to decide which handler is "better".

.MPG will be excluded from the standard MP2/MP3 decoder in version 1.2.3.
Microsoft Windows: We can't script here, this is bat country.

Support of audio from MPG/MPEG/M2V files.

Reply #14
Thank you  . I think it's good choice  . Then I will use just foo_input_ds instead of ffmpeg.

Support of audio from MPG/MPEG/M2V files.

Reply #15
As an answer to my own question, from the title of the thread: yes it is easily possible with first file from this url:  http://haali.su/fb2k/ - just install it via Components Manager or copy it to "foobar2000\components" directory. Additionally, in foobar's configuration under "Advanced\DirectShow input settings" you should enter this line: *.mkv;*.mka;*.avi;*.ts;*.mts;*.m2ts;*.m2t;*.mpg;*.mpeg;*.m2v;*.vob
And everything works just fine

Re: Support of audio from MPG/MPEG/M2V files.

Reply #16
Hi @EpicForever . The Haali Matroska Splitter foobar component doesn't seem to be downloadable anymore and I can't find it.
I'm trying to achieve the same thing as you : read audio and display total length, from a variety of video formats (I say "total length" because I want to disregard the chapters).
Right now I have fb2k 1.4b6 with foo_input_ffmpeg, which works fine for MKV and MP4 (with the "Support chapters" option unticked for each format), but doesn't seem to work for AVI, etc.. (unless I misconfigured it of course)
Can you please help ? Thanks.

Re: Support of audio from MPG/MPEG/M2V files.

Reply #17
Ok, let me go back to my "big box" (my desktop PC instead of that annoying Android device that I am using right now). Then I will try to provide some download link for foo_input_ds.dll. Give me up to 2 days.

By the way @Peter : for about 5 weeks I am trying to go to foo mobile forum and give my opinion about certain foo mobile functionalities (mostly regards playlist creation). In short - I would like foobar to be more like Sony's built in Music app in terms of how playlists work (creating it with checkboxes on the list of detected files). But I treasure foobar's ReplayGain capabilities and the fact that it allows me to play my music from microSD without creating playlist. And that it is the foobar2000... So I would like to use foobar but these playlist make me use Sony's app more often... Easiness of picking same moods in playlists and RG capabilities of foobar - that would be great...


Re: Support of audio from MPG/MPEG/M2V files.

Reply #19
Right now I have fb2k 1.4b6 with foo_input_ffmpeg, which works fine for MKV and MP4 (with the "Support chapters" option unticked for each format), but doesn't seem to work for AVI, etc.. (unless I misconfigured it of course)
You definitely misconfigured something.

Re: Support of audio from MPG/MPEG/M2V files.

Reply #20
@arch21 : thanks !

@Rollin : I'd be happy to know what I misconfigured then, since I didn't really "configure" anything :
- I only added two config lines for foo_input_ffmpeg : *.MKV and *.MP4 (for both of them, with chapters disabled). That works.
- But adding, say, a third line for *.AVI just doesn't work.
- I also put FFmpeg decoder on top of priority, following Case's advice.
See attached screen caps.

Feel free to share your configuration tips to help me make it work. If I can do everything with foo_input_ffmpeg without the need of foo_input_ds, all the better ! Thanks in advance. :)

Re: Support of audio from MPG/MPEG/M2V files.

Reply #21
it's fine here. what is the error message?

Re: Support of audio from MPG/MPEG/M2V files.

Reply #22
Indeed, your configuration seems fine.
Open console and see what is written there when you are trying to play avi.
Also, stupid question: have you tried to restart fb2k after adding avi to foo_input_ffmpeg settings?

Re: Support of audio from MPG/MPEG/M2V files.

Reply #23
It works now !
Actually your question wasn't stupid at all : restarting foobar after adding AVI did the trick.
I didn't think about restarting it, because as far as I remember, adding MKV and MP4 didn't require a restart.
Thanks !