Skip to main content

Topic: Support of audio from MPG/MPEG/M2V files. (Read 4121 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • EpicForever
  • [*][*][*][*][*]
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?

  • Rollin
  • [*][*][*][*]
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

  • CoRoNe
  • [*][*][*]
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?
DC-Bass Source Mod: http://reino.degeelebosch.nl

  • EpicForever
  • [*][*][*][*][*]
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...

  • CoRoNe
  • [*][*][*]
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)
  • Last Edit: 23 January, 2013, 05:10:54 PM by CoRoNe
DC-Bass Source Mod: http://reino.degeelebosch.nl

  • EpicForever
  • [*][*][*][*][*]
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...
  • Last Edit: 23 January, 2013, 05:29:04 PM by EpicForever

  • CoRoNe
  • [*][*][*]
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]
  • Last Edit: 23 January, 2013, 05:27:36 PM by CoRoNe
DC-Bass Source Mod: http://reino.degeelebosch.nl

  • EpicForever
  • [*][*][*][*][*]
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
  • Last Edit: 23 January, 2013, 06:09:06 PM by EpicForever

  • EpicForever
  • [*][*][*][*][*]
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...

  • Rollin
  • [*][*][*][*]
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
  • Last Edit: 02 February, 2013, 01:34:20 PM by Rollin

  • EpicForever
  • [*][*][*][*][*]
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 ?
  • Last Edit: 02 February, 2013, 02:15:50 PM by EpicForever

  • Rollin
  • [*][*][*][*]
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.

  • EpicForever
  • [*][*][*][*][*]
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...

  • Peter
  • [*][*][*][*][*]
  • Administrator
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.

  • EpicForever
  • [*][*][*][*][*]
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.

  • EpicForever
  • [*][*][*][*][*]
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
  • Last Edit: 03 February, 2013, 01:40:45 PM by EpicForever