FFMPEGMediaPlayer not playing mp3 under Windows

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

FFMPEGMediaPlayer not playing mp3 under Windows

klubi
Hello again guys,

here I am again after a longer time. This time having a problem under Windows7.
Using the GLMediaPlayer to play audio only (works on my Raspberry only thanks to your help) does not seem to work on my Windows PC 64bit.
I tried libav as well as ffmpeg and pointed the native libraries folder in the jogl project to where the libav dlls are deployed. Then I try to use the CrossFadePlayer (or my similar version of it, that I provided in my last topic here).

It all seems to work fine until playing starts. No sound of course :) and a few debug statements which bother me a bit (mostly because I don't understand them):

*********************************************
GLMediaPlayer[Uninitialized, vSCR 2147483647, frames[p 0, d 0, t 0 (0.0 s), z 0 / 0], speed 1.0, 0 bps, hasSW false, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0x1908, fmt 0x1908, type 0x1401], Video[id -1, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id -1, <unknown>, 0 bps, 0 frames], uri <undefined stream>]
Created new player: jogamp.opengl.util.av.impl.FFMPEGMediaPlayer
filename = res/test.mp3
file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3
State of player: Uninitialized

...initializing stream...
initStream: p1 GLMediaPlayer[Uninitialized, vSCR 2147483647, frames[p 0, d 0, t 0 (0.0 s), z 0 / 166], speed 1.0, 0 bps, hasSW false, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0x1908, fmt 0x1908, type 0x1401], Video[id -2, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id -1, <unknown>, 0 bps, 0 frames], uri file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3]
initStream: p2 preferred AudioDataFormat[sampleRate 44100, sampleSize 16, channelCount 2, signed true, fixedP true, packed, little-endian], GLMediaPlayer[Uninitialized, vSCR 2147483647, frames[p 0, d 0, t 0 (0.0 s), z 0 / 166], speed 1.0, 0 bps, hasSW false, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0x1908, fmt 0x1908, type 0x1401], Video[id -2, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id -1, <unknown>, 0 bps, 0 frames], uri file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3]
initStream: p3 cameraPath null, isCameraInput false
initStream: p3 stream file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3 -> C:\Prog\git\raspimusic\raspberry\res\test.mp3 -> C:\Prog\git\raspimusic\raspberry\res\test.mp3
initStream: p3 vid -2, sizes null, reqVideo -1x-1@-1, aid -1, aMaxChannelCount 8, aPrefSampleRate 44100
AudioSink.isSupported: true: av[fmt S16, rate 44100, chan 2] -> AudioDataFormat[sampleRate 44100, sampleSize 16, channelCount 2, signed true, fixedP true, packed, little-endian]
audio: id 0, fmt S16, AudioDataFormat[sampleRate 44100, sampleSize 16, channelCount 2, signed true, fixedP true, packed, little-endian], aFrameSize/fc 0
video: id -2, fmt 0x0, null, planes 0, bpp 0/0, usesTexLookupShader false
video: p[0]: 0
video: p[1]: 0
video: p[2]: 0
video: total tex 0x0

GLMediaPlayer[Uninitialized, vSCR 2147483647, frames[p 0, d 0, t 0 (0.0 s), z 0 / 166], speed 1.0, 0 bps, hasSW false, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0x1908, fmt 0x1908, type 0x1401], Video[id -2, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id -1, <unknown>, 0 bps, 0 frames], uri file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3]
XXX Initialize @ updateAttributes: GLMediaPlayer[Initialized, vSCR 2147483647, frames[p 0, d 0, t 0 (250.2 s), z 0 / 166], speed 1.0, 203204 bps, hasSW true, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0x1908, fmt 0x1908, type 0x1401], Video[id -2, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id 0, <Audio: mp3, 44100 Hz, 2 channels, s16p, 203 kb/s>, 203129 bps, 0 frames], uri file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3]

***
Event mask changed: 7471105
Timestamp: 1413354534748
State of player: Initialized

Duration: 250200ms
Volume: 1.0
player.initGL()...
initGL: p3 avChosen AudioDataFormat[sampleRate 44100, sampleSize 16, channelCount 2, signed true, fixedP true, packed, little-endian]
initGL: p4 chosen AudioDataFormat[sampleRate 44100, sampleSize 16, channelCount 2, signed true, fixedP true, packed, little-endian]
initGL: p4 chosen jogamp.opengl.util.av.NullAudioSink@b71888d

***
Event mask changed: 8
Timestamp: 1413354534748
State of player: Paused

player.play()...
setPlaySpeed(1.0): Paused, 1.0 -> 1.0, GLMediaPlayer[Paused, vSCR 2147483647, frames[p 0, d 0, t 0 (250.2 s), z 0 / 166], speed 1.0, 203204 bps, hasSW true, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0xffffffff, fmt 0xffffffff, type 0xffffffff], Video[id -2, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id 0, <Audio: mp3, 44100 Hz, 2 channels, s16p, 203 kb/s>, 203129 bps, 0 frames], uri file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3]
mp.setPlaySpeed(1f) returned: true
Audio: mp3, 44100 Hz, 2 channels, s16p, 203 kb/s
Seek(0): Paused, frames[(p 0, d 0) / 0, 250.2 s, z 0 / 166], speed 1.0, dAV -2147483648, vSCR 2147483647, vpts 0, dSCR[-2147483647, avrg 0], aSCR 2147483647, apts -2147483648 ( 1 ), AudioSink[frames [p 0, q 0, f 1, c 0], time 0, bytes 0], Texture[count 0, free 0, dec 0]
Seek(0): Paused -> Paused, GLMediaPlayer[Paused, vSCR 2147483647, frames[p 0, d 0, t 0 (250.2 s), z 0 / 166], speed 1.0, 203204 bps, hasSW true, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0xffffffff, fmt 0xffffffff, type 0xffffffff], Video[id -2, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id 0, <Audio: mp3, 44100 Hz, 2 channels, s16p, 203 kb/s>, 203129 bps, 0 frames], uri file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3]
libav play err: -40

***
Event mask changed: 4
Timestamp: 1413354534749
State of player: Playing

playing...
GLMediaPlayer[Playing, vSCR 2147483647, frames[p 0, d 0, t 0 (250.2 s), z 0 / 166], speed 1.0, 203204 bps, hasSW true, Texture[count 0, free 0, dec 0, tagt 0xde1, ifmt 0xffffffff, fmt 0xffffffff, type 0xffffffff], Video[id -2, <unknown>, 0x0, glOrient false, 0.0 fps, 0.0 fdur, 0 bps], Audio[id 0, <Audio: mp3, 44100 Hz, 2 channels, s16p, 203 kb/s>, 203129 bps, 0 frames], uri file:/C:/Prog/git/raspimusic/raspberry/res/test.mp3]
jogamp.opengl.util.av.NullAudioSink@b71888d
Info: Has avresample 1, swresample 0, device 1, refCount 0
[mp3 @ 000000000044ed80] max_analyze_duration 5000000 reached
Input #0, mp3, from 'C:\Prog\git\raspimusic\raspberry\res\test.mp3':
  Metadata:
    encoded_by      : LAME 3.90.3 Modified
    album_artist    : Razorlight
    track           : 4
    artist          : Razorlight
    TBPM            : 90
    album           : Razorlight
    title           : America
    genre           : Rock
    date            : 2006
  Duration: 00:04:10.20, start: 0.000000, bitrate: 203 kb/s
    Stream #0.0: Audio: mp3, 44100 Hz, 2 channels, s16p, 203 kb/s
Streams: 1, req vid -2 aid -1
Stream: 0: is-video 0, is-audio 1
Found vid -2, aid 0
A channels 2 [l 3], sample_rate 44100, frame_size 0, frame_number 0, [afps -1.#IND00, cfps 44100.000000, sfps 14112000.000000], nb_frames 0, [maxChan 8, prefRate 44100, req_chan_layout 0, req_chan 0], sink-support 1
Info: Need resample 1, Use avresample 0, swresample 0
SEEK: vid -2, aid 0, pos0 0, pos1 0, pts: 0 -> 0
SEEK.0: pre  : s 0 / 0 -> t 0 / 0
SEEK: post : res -2, u 0

*********************************************

Do you have any idea, what could be wrong with this output? The only thing I can see is:
Info: Need resample 1, Use avresample 0, swresample 0
Althoug the avresample seems to load.

Once again I am at the limit with my knowledge and thank you for your support in advance.

Cheers,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: FFMPEGMediaPlayer not playing mp3 under Windows

gouessej
Administrator
Hi

Are you really sure you want to use MP3? Using Ogg would be a lot easier with Paul Lamb Sound Library, its JOAL plugin and its Ogg codec. Moreover, you wouldn't need FFMPEG and you wouldn't have to use other native libraries except those of JOAL.

I see nothing wrong in your logs, the audio sample seems to be supported.
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: FFMPEGMediaPlayer not playing mp3 under Windows

Sven Gothel
Administrator
In reply to this post by klubi
On 10/15/2014 08:47 AM, klubi [via jogamp] wrote:
> Duration: 250200ms
> Volume: 1.0
> player.initGL()...
> initGL: p3 avChosen AudioDataFormat[sampleRate 44100, sampleSize 16,
> channelCount 2, signed true, fixedP true, packed, little-endian]
> initGL: p4 chosen AudioDataFormat[sampleRate 44100, sampleSize 16,
> channelCount 2, signed true, fixedP true, packed, little-endian]
> initGL: p4 chosen jogamp.opengl.util.av.NullAudioSink@b71888d

Here we go, the JOAL/OpenAL audio sink is not in use.

Either by not having JOAL available, or maybe JOAL's native
openal library is missing.

'-Djogl.debug.AudioSink' may help,
or better use the full debug flags
and pipe it out (-> stderr/stdout, see Wiki/FAQ).

~Sven



signature.asc (828 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: FFMPEGMediaPlayer not playing mp3 under Windows

klubi
In reply to this post by gouessej
Hi gouessej,

under any other circumstances I would love to use Ogg and I'm aware if its benefits :) But as this little projects needs to become a music player and is supposed to be used on mp3s, I have little choice.

Regarding to the debug output, I also see the statement "libav play err: -40"
No idea what that means, but I looked a little more and found out what happens after calling the play() method. Almost immediately after starting play there is an EVENT_CHANGE_EOS+EVENT_CHANGE_PAUSE in the GLMediaEventListener, even I call seek(0) before calling play().

And I am also wandering why, when I call getAudioSink on the media player, I get "jogamp.opengl.util.av.NullAudioSink@b71888d". I would expect the JavaSound implementation, but that is just a guess.

Oh, and by the way, the CrossFadePlayer demo gives the same results, as I would expect as it is pretty much the same code as this (my early version):
https://github.com/dudewithasock/raspimusic/blob/master/raspberry/src/MediaPlayer.java


Cheers,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: FFMPEGMediaPlayer not playing mp3 under Windows

gouessej
Administrator
Have you correctly installed JOAL?
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: FFMPEGMediaPlayer not playing mp3 under Windows

klubi
I followed the installation description and set up a jogl project in Eclipse as described.
My "player" project depends on the jogl project. Seems pretty simple, but I will check this evening. Maybe I forgot something, you never know. Is there some cool way how to verify the joal installation (other than CrossFadePlayer)? I gues some simple wav tutorial should do it. Again, will check later this evening.

After deploying the libav libraries to some folder, I specified this folder as the Native libraries folder under the jogl entry (jogl as the required project on the build path in my "player"). I'm not sure about this procedure, but it does not seem to be the problem as GLMediaPlayerFactory loads all the other native libraries (avcodec, avformat, ...). Or am I missing something?

Martin
Reply | Threaded
Open this post in threaded view
|

Re: FFMPEGMediaPlayer not playing mp3 under Windows

klubi
So I just sat down after a few days of doing other stuff and looked at my problem with a pair of fresh eyes...
And there you go, took me 2 minutes to realize.
Installation notes on jogl mention only jogl and gluegen, what a surprise :) What I was missing of course was the joal library on the build path and in the exports of my "jogl" project in Eclipse, which I use in this "MediaPlayer" project. Now everything works fine.
Thanks guys for pointing me in the right direction. You are amazing as usual, KUDOS!

Cheers,
Martin
Reply | Threaded
Open this post in threaded view
|

Re: FFMPEGMediaPlayer not playing mp3 under Windows

gouessej
Administrator
Hi

Yes you can't use the OpenAL audio sink without JOAL.

Edit.: We have to fix the installation notes, thanks.
Julien Gouesse | Personal blog | Website