View Full Version : H.264 won't play in flash using mencoder
FokeyJoe
3rd March 2008, 00:58
Hiya,
I'm using mencoder to generate H.264/AAC MP4 files. I can generate files that mplayer and VLC can play - but I want them to work on web pages in flash. The files I create work in flash on linux, but not on windows. I would like to know what setting(s) I've got that are causing it not to be compatible?
At the moment I build the MP4 with mencoder, but I have also tried mp4creator (the files are big, so I'm avoiding mp4box). I get the 'Error decoding SEI message' warning, though the file seems playable but makes no difference.
These are my mencoder config settings (P1 is pass 1, P2 is pass 2):
[x264net_p1]
ovc=x264=1
x264encopts=bitrate=250:keyint=400:bframes=4:b_pyramid:pass=1:turbo=2:threads=auto:partitions=all:subq=1:mixed_refs=1:trellis=0:me=dia
sws=9
vf=scale=-11:352
oac=copy=1
nosound=1
of=lavf=1
lavfopts=format=mp4
aspect=16/9
[x264net_p2]
ovc=x264=1
x264encopts=bitrate=250:subq=5:frameref=5:keyint=400:bframes=4:b_pyramid:pass=2:turbo=1:threads=auto:partitions=all:mixed_refs=1:trellis=1:me=umh:level_idc=30:global_header=1
sws=9
vf=scale=-11:352
oac=faac=1
srate=22050
faacopts=br=128:mpeg=4:tns=1:object=2:raw=1
af-adv=force=1
of=lavf=1
lavfopts=format=mp4
aspect=16/9
Source is from analogue TV BT8x8 to an FFV1-encoded raw file.
TIA :)
FokeyJoe
3rd March 2008, 01:04
More info: I'm using gentoo with mencoder v1.0_rc2_p25993, x264lib as of 20070924.
DarkZell666
4th March 2008, 10:35
Did the mp4 muxer in mencoder get fixed ? Since when does it output b-frame-capable mp4 ? ... o_O. Great news if it has anyway :D !
OTOH mixed_refs or b_pyramid could be a problem when streaming, but you say it works on linux ...
Is the actual flash plugin on linux from adobe ? Or is it 3rd party ?
Are you actually trying on windows for real ? Or is it a hacked copy of IE inside Wine ?
Also does the problem occur both inside FF and IE on windows ?
Dark Shikari
4th March 2008, 10:42
Try remuxing in mp4box.
Mixed-refs is unrelated to streaming (it controls whether p8x8 partitions can independently select references), and from what I heard b-pyramid works just fine.
surfchen
5th March 2008, 03:38
try lavfopts=format=mov
DarkZell666
7th March 2008, 08:51
According to this thread, the mp4 muxer still hasn't been fixed, even though they have removed the i_certify_<blahblah>_b_frames option : http://forum.doom9.org/showthread.php?t=133926 (the 4 first posts are relevant to your problem).
So +1 for Dark Shikari's and surfchen's tips.
If you've tried them, how did they work out ?
FokeyJoe
9th March 2008, 02:39
1) Tried lavfopts=format=mov but made no difference except not to work on linux flash either.
2) mp4box produces this error:
(BitStream Not Compliant)Cannot find H264 start code
Error importing myvid.264: BitStream Not Compliant
That sounds like it's not constructing the video stream properly, or maybe -dumpvideo isn't the appropriate way to extract the video stream.
3) It's true windows xp pro, I mainly use FF, but IE6 does the same
4) On linux, it is the official adobe flash 9 plugin binary (didn't know there was an alternative - if there is, there ain't an ebuild for it!)
surfchen
10th March 2008, 08:21
mencoder a.rmvb -o a.mov -of lavf -lavfopts format=mov -oac lavc -lavcopts aglobal=1:acodec=libfaac:abitrate=64 -ovc x264 -x264encopts bitrate=300:qp_min=15:qp_max=51:qcomp=0.8:cabac:deblock:subq=7:keyint=300:frameref=6:partitions=all:b_pyramid:8x8dct:global_header:me=umh -srate 22050 -vf scale=640:-3 -sws 3 -ofps 24
Above is my code to generate mp4 playing in flash.It works find on my mac(ff,opera,safari) and xp(ff,ie).
I use mov as container since mp4 not works.(mov is a type of mp4 as I know)
FokeyJoe
15th March 2008, 01:24
Those settings don't seem to work for me, either, okay in linux, not on win32. It does seem very odd - but more likely that something's up with my flash on win32 (I've tried it on different machines as well), FF and IE.
surfchen
17th March 2008, 11:25
Why not complie mencoder and x264 from latest svn?
There are many improvement and bug fixed in the svn.
FokeyJoe
19th March 2008, 01:54
Well there has been a recent update to the gentoo ebuilds... mencoder is now at 1.0_rc2_p25993-r1, and x264 is at 20080301. Are these up to date enough? I've tried these but there is no difference. I'm afraid I only do ebuilds, I don't build stuff myself.
surfchen
19th March 2008, 03:18
The x264 is up to date enough,while the mencoder is a bit old..
In your case,the problem is mp4 muxer,not the h264 encoder.So you should try to build mencoder from svn.
It is not hard to compile mencoder,why not build one from svn by youself?
FokeyJoe
20th March 2008, 01:29
Well, I had a go and built mplayer dev-SVN-r26265-4.1.2 - you're right, compiling is a lot easier than it used to be, thanks to it autodetecting everything. But alas, this build made no difference (that's using the mov settings you sent in an earlier post) :(
surfchen
20th March 2008, 03:28
Here is a mp4 playing with flash:http://www.verycd.com/files/3aa4f6d19f2cf0dde6a322f2899aa22530021585.
Can you play it?
This mp4 generated by the command I posted above.
FokeyJoe
21st March 2008, 18:48
Thanks for the link, Surf, it's helped me suss out what the problem was, because it worked fine. I was accessing my test page as a local link on a samba share (ie. file://///linux-pc/share/flvplayer.html), flash must not like trying to call across url's like this. I must've been testing it on my apache server earlier in the testing stages, then switched to accessing it directly. I feel such a n00b :rolleyes:
Thanks again for your help :)
:thanks:
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.