Generated H264/AAC files doesn't work in flash player

About encoding, codec settings, muxers and filter usage
kenzo1982
New Cone
New Cone
Posts: 7
Joined: 08 Jul 2008 09:56

Generated H264/AAC files doesn't work in flash player

Postby kenzo1982 » 06 Oct 2008 17:39

Hi,

In my application, VLC does transcoding from an MPEG4-SP/alaw real time input source via RTP to generate a H.264/AAC output. I send the output to Wowza Media Server (http://www.wowzamedia.com/) vía RTP module, generating a SDP file, to publish it, and simultaneously to a file (with mp4 container), to save it, using standart module. I also publish SDP vía RTSP to test generated output stream. This is the command to do this:

Code: Select all

vlc --reset-config -vvv -I dummy -I http --http-host=192.168.1.33:10000 --http-src /opt/vlc/share/vlc/http --file-logging --logfile=/home/vlc/vlc.log rtsp://192.168.1.50/VideoInput/1/mpeg4/1 --sout "#transcode{threads=4,vcodec=h264,vb=768,scale=1,fps=25,deinterlace,acodec=mp4a,ab=64,samplerate=44100,channels=1}:duplicate{dst=std{access=file,mux=mp4,dst=/home/vlc/vlc.mp4},dst=rtp{dst=127.0.0.1,port=10000,port-video=9998,port-audio=9996,sdp=rtsp://10.95.123.103:10000/vlc.sdp,sdp=file://$WOWZADIR/content/vlc.sdp}}"
Using flash player I can connect correctly to the real time stream generated by Wowza (it only does a protocol conversion, rtp->rtmp). However, the generated H264/AAC files doesn't work fine with flash player (audio sounds but any image is rendered). It's seems it's due to a container problem, or related to codification parameters, but the same flow, in real time, is decodec/displayed OK by the player. I also try with FMS and doesn't either work, so I discard the problem could be related to the streaming server.

Could the problem be caused by x264 lib of VLC? flash player limitation playing some H264 videos?

Thanks in advance.

(PS. I'm working under ubuntu server 8.04 in a Intel Quad Core Xeon proccessor)
Last edited by kenzo1982 on 08 Jun 2010 09:29, edited 1 time in total.

kittivud
Blank Cone
Blank Cone
Posts: 13
Joined: 13 Mar 2006 11:25
Location: Bangkok, Thailand
Contact:

Re: Generated H264/AAC files doesn't work in flash player

Postby kittivud » 09 Oct 2008 09:04

hello,
i found this message in wowza forum (http://www.wowzamedia.com/forums/showthread.php?t=182)
..... Note: There is currently an issue with JW Player 4.0 and RTP/MPEG-TS player. When using JW Player 4.0 to playback one of these two methods of live streaming the video will not be present. The problem is that JW Player currently requires that the width and height values to be set properly in the onMetaData event. When streaming using RTP/MPEG-TS Wowza Pro does not have access to the width and height information for the stream. I am currently working with the developer of JW Player to see if there is a way to work around this issue. In the meantime you can download the source code for JW Player from here: http://code.jeroenwijering.com/trac/browser/tags (filename: mediaplayer-4-0.zip) ....


After a few days of testing, i found the solution to stream h264 to flash: vlc (rtp,h264,mp4a) ->Wowza -> JW Flash.
My vlc command and JS code is below.


:sout=#transcode{vcodec=h264,vb=256,width=528,height=432,acodec=mp4a,ab=32,channels=2}:duplicate{dst=display,dst=rtp{dst=127.0.0.1,port=1234,port-audio=1230,port-video=1232,sdp=file://c:/temp/mystream.sdp}}


<html>
<body>
<p id='preview'>The player will show in this paragraph</p>
<script type='text/javascript' src='swfobject.js'></script>
<script type='text/javascript'>
var s1 = new SWFObject('player.swf','player','568','432','9');
s1.addParam('allowfullscreen','true');
s1.addParam('allowscriptaccess','always');
s1.addParam("flashvars","fullscreen=true&streamer=rtmp://localhost/rtplive&file=mystream.sdp&type=video");
s1.write('preview');
</script>
</body>
</html>

Hope it help.
Kittivud E.
Digitalcom Thailand

kenzo1982
New Cone
New Cone
Posts: 7
Joined: 08 Jul 2008 09:56

Re: Generated H264/AAC files doesn't work in flash player

Postby kenzo1982 » 14 Nov 2008 15:00

Finally I resolved the issue. VLC std module generated files contains some undefined atoms in the MP4 container for the flash visor. I solve this by creating a new file with the same generated a/v and a new container with correct atoms.

Regards

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Generated H264/AAC files doesn't work in flash player

Postby Jean-Baptiste Kempf » 14 Nov 2008 15:30

Finally I resolved the issue. VLC std module generated files contains some undefined atoms in the MP4 container for the flash visor. I solve this by creating a new file with the same generated a/v and a new container with correct atoms.

Regards
Details?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

fredbuhl
New Cone
New Cone
Posts: 2
Joined: 18 Nov 2008 02:42

Re: Generated H264/AAC files doesn't work in flash player

Postby fredbuhl » 18 Nov 2008 02:47

Kenzo, I'd like to know how you're getting around this as well; I have the same darn problem--pretty vexing, since the Flash player is what I'm targeting.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Generated H264/AAC files doesn't work in flash player

Postby Jean-Baptiste Kempf » 18 Nov 2008 07:37

Usually, the moov atom needs to be at the beginning, but well.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

kenzo1982
New Cone
New Cone
Posts: 7
Joined: 08 Jul 2008 09:56

Re: Generated H264/AAC files doesn't work in flash player

Postby kenzo1982 » 19 Nov 2008 11:59

We try with the mp4creator utility to analize VLC H264/AAC generated files. The program gives full information about the container and all streams in the file. We observed that it detects an 'Unknow profile' with video stream, and a not exactly fps value:

Code: Select all

ReadChildAtoms: finished Track Type Info 1 audio MPEG-4 AAC LC, 183.341 secs, 64 kbps, 44100 Hz 2 video H264 Unknown Profile 40@5.1, 183.108 secs, 1028 kbps, 720x576 @ 24.979793 fps
Using this application, we simply demux audio and video streams in separated files and mux this in a new file, setting exactly value of fps and mpeg4 video profile to main@5.1 (or level you setted when creating the file with vlc). It also change the order of the streams (video firstly):

Code: Select all

ReadChildAtoms: finished Track Type Info 1 video H264 Main@5.1, 182.960 secs, 1028 kbps, 720x576 @ 25.000000 fps 2 audio MPEG-4 AAC LC, 182.392 secs, 64 kbps, 44100 Hz
We're managing all transcoding/streaming process with custom application.that cover VLC and other applications implieds. This application launch VLC to get and MPEG4-SP stream from an hw encoder, transcode it to H264 and send the output to:
- real time stream published vía sdp to Wowza Server
- a file in certain folder
Our custom app executes a script over the generated file just when VLC stop runs to, using mp4creator tool, do the steps I describe above (it takes some seconds, depending of the file size and disk system, but it's basically a read/write to disk). When it finished, the file is ready to be served with Wowza :D

PD. The positions of the atoms at the end of the file will cause that flash client has to dowload entire file to start play it. But in our case, the file was never played in the flash client.

fredbuhl
New Cone
New Cone
Posts: 2
Joined: 18 Nov 2008 02:42

Re: Generated H264/AAC files doesn't work in flash player

Postby fredbuhl » 20 Nov 2008 17:39

Kenzo: thanks for the information!

J-B: is this problem trouble-ticket worthy?

It would be wonderful if VLC could directly create flash-compatible h264 files, and I would think "Unknown Profile" issue might cause problems with other players as well.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Generated H264/AAC files doesn't work in flash player

Postby Jean-Baptiste Kempf » 20 Nov 2008 20:25

Kenzo: thanks for the information!

J-B: is this problem trouble-ticket worthy?

It would be wonderful if VLC could directly create flash-compatible h264 files, and I would think "Unknown Profile" issue might cause problems with other players as well.
Yes, but that doesn't solve the problem.
moov atom must move to the beginnning and noone has done that in VLC yet.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 21 guests