Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

no sound when playing h264/mp3 mp4 file


Hi,

I'm having some trouble playing mp4 files in the latest version of JW's excellent player.

I've converted from various sources (mostly mobile phone vids) to mp4 using ffmpeg:

ffmpeg -i video3.mp4 -sameq -vcodec libx264 -acodec libmp3lame -ab 128k -ar 44100 output6.mp4

And, using the following SWFObject to load the player:

var s1 = new SWFObject("mediaplayer.swf","mediaplayer","400","220","8");
s1.addParam("allowfullscreen","true");
s1.addVariable("width","176");
s1.addVariable("height","144");
s1.addVariable("file","output6.mp4");
s1.addVariable("type","flv");
s1.write("container");

I get video playing fine, but no audio. The audio plays when I play the file in mplayer/vlc/totem/on my friend's Windows machine. Via the player, under linux and windows (latest versions of flash plugin), no sound.

I've tried resampling audio to 22050Hz, and a variety of bitrates, but with no luck. I've also tried type=mp4, but that has no effect either.

I don't, currently, have a demo up anywhere on the web - my webserver is on order, should have arrived today but didn't. :(

If anyone has any helpful suggestions on what I'm doing wrong, your advice would be greatly appreciated.

many thanks,


-mat

12 Community Answers

JW Player

User  
0 rated :

Hello, Mat

I can't listen the youtube sound when i start the video. What i have to do?


thank you!

JW Player

User  
0 rated :

That's pretty much exactly what I did.

Turns out, this morning, every other machine I test on, sound works fine. I think it's my browser. (I'm on a 64-bit linux, so I'm running flash via nspluginwrapper)


doh. am idiot. thanks for the help anyway.

JW Player

User  
0 rated :

Your posted command line, using *libmp3lame*, didn't work for me.bc.. ffmpeg -i video3.mp4 -sameq -vcodec libx264 -acodec *libmp3lame* -ab 128k -ar 44100 output6.mp4
But *libfaac* did work for me.

Does the MP4 with MP3 audio work for you?

JW Player

User  
0 rated :

I don't think it did with JW's player. Although it's a bit hard to tell as I've now found out no flash in my browser has audio. MP4s with mp3 audio played with audio OK on my desktop.

libmp3lame only works if you compiled ffpmeg with --enable-libmp3lame, and have lame installed, obviously.

I'm currently using (via http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/ )

bc.. ffmpeg -i $file -y -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me epzs -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -crf 30 -r 20 -acodec libfaac -ab 96k -ar 22050 output.mp4


and that seems OK. At least, people I know who have working flash plugins assure me it's OK... :)

Now my only problem is making sure that ffmpeg command works with as much video as I can throw at it (application is a video-blogging site, so transcoding needs to be automated).

JW Player

User  
0 rated :

The Windows binaries have all that stuff compiled in; that's why they're so fat.

I tried your command line, but the MP4 won't load, so I'm adding your settings to mine to see what is breaking it.

JW Player

User  
0 rated :

I also could not get it to work with Lame MP3 in a MP4box with x264 video. I encode with MediaCoder, tried lots of different options and browsers, nothing worked. Switching to FAAC worked fine though.

JW Player

User  
0 rated :

I have the same problem with MP4 videos encoded with MeGUI and the x264 encoder. When the video file is muxed with an MP3 audio file I get no sound in the FLV Player (tried versions 3.17 and 4.3), but the sound plays fine in Media Player Classic, Windows Media Player and KM Player.

When I mux it with an AAC audio file the sound plays in the FLV player, but the AAC quality is much inferior to the MP3 quality regardless which settings I use.

What is it that prevents the FLV Player from playing the sound in an MP4+MP3 file?

JW Player

User  
0 rated :

Sampe Problem with MeGUI, plz Help

JW Player

User  
0 rated :

I have found a way to get good AAC quality. Don't use MeGUI/Nero. Use enc_aacplus and make sure to set the speech option. I get very good quality with this command line:
enc_aacplus input.wav output.mp4 --cbr 24000 --speech --mp4box
The wav file must be PCM 44,100 Hz.
MeGUI/Nero is OK for music only tracks (use HE-AAC 48 kbps stereo), but absolutely useless for speech.

JW Player

User  
0 rated :

to stop the speeack working when you got the ear phome pug in what do you do to stop the speack working

JW Player

User  
0 rated :

ffmpegonthecommandlineisabitdifficulttoworkwith.

Fortesting,Iusedatrackthatlookedlikethis:bc.. <track>
<creator><![CDATA[<fontface="Arial">11925-6</font>]]></creator>
<title><![CDATA[<fontface="Arial">MP4</font>]]></title>
<location>/Movies/11925-6.mp4</location>
<metarel='type'>flv</meta>
<info>http://my.domain.com/</info>
<annotation>Track2</annotation>
</track>


Startwithsomethingbasic,testthefile,thenaddmoreswitches:bc.. ffmpeg-ifile.flvfile.mp4
Thisusedlibfaacandlibx264.TheaudiowasOKbutthevideodidn'tshow.


NextItriedspecifyingthevideocodecaslibx264:bc.. ffmpeg-ifile.flv-vcodeclibx264-acodeclibfaac-ar22050file.mp4
Thisproducedworkingvideoandaudio.


NextIaddedtheaudiobitrateanduppedtheaudiosamplingrate:bc.. ffmpeg-ifile.flv-vcodeclibx264-acodeclibfaac-ab128000-ar44100file.mp4
Thisproducedworking video and audiowithanoutputthatlookedlitethis:bc.. FFmpegversionSVN-r12665,Copyright(c)2000-2008FabriceBellard,etal.
configuration:--enable-gpl--enable-postproc--enable-swscale--enable-avfilter-lavf--enable-pthreads--enable-liba52--enable-avisynth--enable-libfaac--enable-libfaad--enable-libgsm--enable-memalign-hack--enable-libmp3lame--enable-libnut--enable-libtheora--enable-libvorbis--enable-libx264--enable-libxvid--cpu=i686--extra-ldflags=-static
libavutilversion:49.6.0
libavcodecversion:51.54.0
libavformatversion:52.13.0
libavdeviceversion:52.0.0
builtonApr2200822:35:11,gcc:4.2.3

Seemsstream0codecframeratediffersfromcontainerframerate:1000.00(1000/1)->25.00(25/1)
Input#0,flv,from'11925.flv':
Duration:00:00:14.1,start:0.000000,bitrate:96kb/s
Stream#0.0:Video:vp6f,yuv420p,480x270,25.00tb(r)
Stream#0.1:Audio:mp3,44100Hz,stereo,96kb/s
Output#0,mp4,to'11925-6.mp4':
Stream#0.0:Video:libx264,yuv420p,480x270,q=2-31,200kb/s,25.00tb(c)
Stream#0.1:Audio:libfaac,44100Hz,stereo,128kb/s
Streammapping:
Stream#0.0->#0.0
Stream#0.1->#0.1
[libx264@00ABC290]widthorheightnotdivisibleby16(480x270),compressionwillsuffer.
[libx264@00ABC290]usingcpucapabilities:MMXMMXEXTSSECache32
Press[q]tostopencoding
frame=6fps=0q=31.0size=1kBtime=0.2bitrate=60.1kbits/s
frame=10fps=9q=31.0size=9kBtime=0.3bitrate=201.7kbits/s
frame=13fps=8q=29.0size=14kBtime=0.4bitrate=257.1kbits/s
frame=15fps=7q=31.0size=21kBtime=0.5bitrate=344.5kbits/s
frame=17fps=6q=31.0size=27kBtime=0.6bitrate=366.4kbits/s
frame=20fps=6q=31.0size=38kBtime=0.7bitrate=436.3kbits/s
frame=23fps=6q=31.0size=52kBtime=0.9bitrate=492.9kbits/s
frame=27fps=6q=31.0size=72kBtime=1.0bitrate=575.4kbits/s
frame=30fps=6q=31.0size=85kBtime=1.1bitrate=608.6kbits/s
frame=34fps=6q=31.0size=101kBtime=1.3bitrate=638.2kbits/s
frame=36fps=6q=31.0size=114kBtime=1.4bitrate=658.9kbits/s
frame=40fps=6q=31.0size=131kBtime=1.5bitrate=698.6kbits/s
frame=44fps=6q=31.0size=147kBtime=1.7bitrate=709.4kbits/s
frame=48fps=6q=31.0size=162kBtime=1.9bitrate=716.3kbits/s
frame=52fps=6q=31.0size=182kBtime=2.0bitrate=738.0kbits/s
frame=55fps=6q=31.0size=190kBtime=2.1bitrate=729.7kbits/s
frame=59fps=6q=31.0size=197kBtime=2.3bitrate=703.0kbits/s
frame=63fps=6q=31.0size=212kBtime=2.5bitrate=706.3kbits/s
frame=67fps=6q=31.0size=219kBtime=2.6bitrate=678.4kbits/s
frame=71fps=6q=31.0size=226kBtime=2.8bitrate=658.2kbits/s
frame=76fps=7q=31.0size=240kBtime=3.0bitrate=661.8kbits/s
frame=81fps=7q=31.0size=245kBtime=3.2bitrate=635.1kbits/s
frame=85fps=7q=29.0size=256kBtime=3.3bitrate=626.6kbits/s
frame=89fps=7q=31.0size=267kBtime=3.5bitrate=619.5kbits/s
frame=94fps=7q=31.0size=273kBtime=3.7bitrate=605.9kbits/s
frame=98fps=7q=31.0size=287kBtime=3.9bitrate=602.8kbits/s
frame=103fps=7q=31.0size=292kBtime=4.1bitrate=582.0kbits/s
frame=109fps=7q=29.0size=296kBtime=4.3bitrate=568.4kbits/s
frame=115fps=7q=31.0size=310kBtime=4.6bitrate=558.7kbits/s
frame=120fps=7q=31.0size=315kBtime=4.7bitrate=545.0kbits/s
frame=125fps=7q=31.0size=328kBtime=4.9bitrate=543.9kbits/s
frame=130fps=7q=31.0size=334kBtime=5.2bitrate=531.4kbits/s
frame=135fps=8q=31.0size=346kBtime=5.3bitrate=533.6kbits/s
frame=141fps=8q=31.0size=355kBtime=5.6bitrate=521.3kbits/s
frame=146fps=8q=31.0size=361kBtime=5.8bitrate=511.9kbits/s
frame=152fps=8q=31.0size=376kBtime=6.0bitrate=512.5kbits/s
frame=157fps=8q=29.0size=383kBtime=6.2bitrate=504.7kbits/s
frame=163fps=8q=31.0size=398kBtime=6.5bitrate=505.3kbits/s
frame=169fps=8q=29.0size=407kBtime=6.7bitrate=498.3kbits/s
frame=174fps=8q=31.0size=421kBtime=6.9bitrate=500.0kbits/s
frame=180fps=8q=31.0size=430kBtime=7.1bitrate=494.1kbits/s
frame=185fps=8q=31.0size=444kBtime=7.3bitrate=495.5kbits/s
frame=189fps=8q=31.0size=449kBtime=7.5bitrate=490.4kbits/s
frame=194fps=8q=31.0size=463kBtime=7.7bitrate=491.5kbits/s
frame=200fps=8q=31.0size=468kBtime=7.9bitrate=482.6kbits/s
frame=205fps=8q=29.0size=472kBtime=8.1bitrate=475.6kbits/s
frame=211fps=8q=31.0size=485kBtime=8.4bitrate=474.4kbits/s
frame=217fps=8q=29.0size=494kBtime=8.6bitrate=470.0kbits/s
frame=223fps=8q=31.0size=510kBtime=8.8bitrate=471.9kbits/s
frame=229fps=8q=29.0size=518kBtime=9.1bitrate=467.2kbits/s
frame=235fps=8q=31.0size=534kBtime=9.3bitrate=468.5kbits/s
frame=240fps=8q=31.0size=541kBtime=9.6bitrate=463.5kbits/s
frame=245fps=8q=31.0size=554kBtime=9.8bitrate=465.4kbits/s
frame=252fps=9q=31.0size=560kBtime=10.0bitrate=458.5kbits/s
frame=257fps=9q=31.0size=574kBtime=10.2bitrate=460.1kbits/s
frame=262fps=9q=31.0size=583kBtime=10.4bitrate=457.7kbits/s
frame=267fps=9q=31.0size=596kBtime=10.6bitrate=460.2kbits/s
frame=273fps=9q=31.0size=604kBtime=10.8bitrate=456.6kbits/s
frame=277fps=9q=29.0size=611kBtime=11.0bitrate=453.9kbits/s
frame=283fps=9q=31.0size=626kBtime=11.3bitrate=455.1kbits/s
frame=289fps=9q=29.0size=634kBtime=11.5bitrate=452.0kbits/s
frame=296fps=9q=31.0size=650kBtime=11.8bitrate=452.6kbits/s
frame=302fps=9q=31.0size=658kBtime=12.0bitrate=448.9kbits/s
frame=308fps=9q=31.0size=672kBtime=12.3bitrate=449.3kbits/s
frame=314fps=9q=31.0size=680kBtime=12.5bitrate=445.8kbits/s
frame=320fps=9q=31.0size=693kBtime=12.7bitrate=445.6kbits/s
frame=327fps=9q=31.0size=708kBtime=13.0bitrate=445.9kbits/s
frame=333fps=9q=31.0size=715kBtime=13.2bitrate=442.3kbits/s
frame=337fps=9q=29.0size=728kBtime=13.4bitrate=445.2kbits/s
frame=340fps=9q=31.0size=745kBtime=13.5bitrate=450.6kbits/s
frame=344fps=9q=31.0size=763kBtime=13.7bitrate=457.1kbits/s
frame=348fps=9q=31.0size=776kBtime=13.8bitrate=459.4kbits/s
frame=354fps=9q=31.0size=783kBtime=14.1bitrate=455.3kbits/s
frame=355fps=9q=-1.0Lsize=793kBtime=14.2bitrate=458.9kbits/svideo:572kBaudio:213kBglobalheaders:1kBmuxingoverhead1.045041%
[libx264@00ABC290]sliceI:31AvgQP:29.69size:7116
[libx264@00ABC290]sliceP:324AvgQP:30.63size:1126
[libx264@00ABC290]mbII16..4:47.9%0.0%52.1%
[libx264@00ABC290]mbPI16..4:8.2%0.0%0.0%P16..4:21.5%0.0%0.0%0.0%0.0%skip:70.4%
[libx264@00ABC290]finalratefactor:-11.59
[libx264@00ABC290]SSIMMeanY:0.9535529
[libx264@00ABC290]kb/s:329.9


Continuebuildingthecommandlineuntilitbreaks,thenfigureoutwhatswitchorsettingdoesworkandcontinue.

JW Player

User  
0 rated :

See: *http://kb2.adobe.com/cps/402/kb402866.html* Specifically, the note below the second table and the third table. H.264 + AAC in the MP4 container is supported. H.264 + MP3 in the MP4 container is not supported.

This question has received the maximum number of answers.