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

Can H264 Video go inside a flv container?


Hi all,
Ive been looking into streaming the video content myself (instead of having to use youtube) and the best way was to keep my current apache webserver and use the xmoov php script. As i understand this only supports flv video and i am after the best quality for file sizes.

Is there a xmoov alterantive that can stream mp4 video files?

Can H264 video sit inside a flv container? I was reading somewhere that a recent version permitted this.

Which program would you use to create the flv video (with either VP6 or H264, all options ive found do not permit for VP6)?

Is VP-6 Video fine or should i really look to use h264?

thanks

Julius

27 Community Answers

JW Player

User  
3 rated :

You can use ffmpeg to mux H.264 video and audio (MP3/AAC) into an MP4 container.

The resulting file plays fine and you can scrub in the downloaded portion of the file.

However, you can't HTTP or "fake" stream with a serverside script because the MP4 file doesn't have a readable metadata array of time/byte-position that is needed for HTTP "fake" streaming.

I've tried adding the metadata with FLVMDI, flvtool2, yamdi, flvtool++, and jflvTool to create and inject the metadata. flvtool2 seems to work, the metadata array is created and injected, however the file does not scrub ahead of the download using HTTP "fake" stream.

See this thread: *http://www.jeroenwijering.com/?thread=7099*

If you want quality, H.264 is the best codec for video.

If you need to stream with a serverside script, then you are limited to FLV for now.

If your server is *nix based, I would install LightTPD which has FLV and H.264 streaming modules and is very fast and works well.. The Windows version is lacking the H.264 streaming module.

JW Player

User  
0 rated :

Thanks for that. The server im using isnt owned by me and ive only got ftp access, no shell access he doesntw ant me breaking anything on the box :P

Which application would you reccomend for encoding videos to flv with the VP6 codec (or whatever is the best?)

Im also having issues with streaming. Running the xmoov script on its own works fine and gives this output:

http://192.168.0.3/files/xmoov.php?file=500k/s2e6.flv&start=1

File: /var/www/apache2-default/vidstrm/500k/s2e6.flv
Seek Position: 1

but when i try to play it from the jw player it just keeps on doing the loading thing (circular movement of the bar). If i point it directly to the flv file without the streamer it works perfectly.

JW Player

User  
0 rated :

Are you using the xmoov script from this thread: *http://www.jeroenwijering.com/?thread=13081*???

If not, get it it works.

You also *_MUST_* have the time/position metadata in your video files to use HTTP "fake" streaming with scripts or LightTPD.

JW Player

User  
0 rated :

@Julius

Your filename should not contain '/' as this breaks the HTTP request and xmoov script can not find the file eventually. You have to put the 'path' part in xmoov script and pass only the filename to xmoov with GET method.

file=something.flv should work if xmoov can find the file with the correct path configuration.

file=somepath/something.flv can not be found because of '/' in the variable.

If you are using Drupal or something, you have to hack some module's php code I am afraid.

If Drupal is the case, php files under /files directory will not work as execution is prohibited there for security reasons. Put xmoov.php to Drupal's root instead and call it accordingly.

JeroenW

JW Player Support Agent  
0 rated :

I second to kLink’s H264 in FLV experiments. It is very simple to mux the stream, and YAMDI now also supports the insertion of keyframes, but seeking still doesn’t work. It seems like the Flash player isn’t able to pick up the stream, and some additional syncing besides the keyframe-startbytes is needed. When http seeking, the video goes black and the audio sounds garbled.

As to MP4 streaming, Lighttpd seems to be the only way so far.

And if you want to convert videos, but cannot install any software on your server, you can use bitsontherun (www.bitsontherun.com). We convert your content to H.264 / FLV, and you can download the conversions again. Below 1GB it’s free.

JW Player

User  
0 rated :

Hello
I'me fine with video encoding with flv/vp6 with php streaming with your player ... it's great ... thanks to jeroenwijering
I have avi or mkv files with h.264 encoding ... how can I stream it ? (I want to keep seek fonctionnality) I want the best quality
May I encoded their ? Install httpdlight ? Could you send me a aware encoder software (On2 Flix Pro works fine but it doesn't have h.264 fonctionnality) ?
Sorry with my stupid questions .. I'm a rooky with streaming question

JW Player

User  
0 rated :

Hi people.
??. tubecup.com..
Their player supports h264-in-flv pseudo streaming!
JeroenW, what`s problem with your player??
Think this is AS3 using issue. That one player written on AS2.
Sorry for my bad English.

JeroenW

JW Player Support Agent  
0 rated :

It is indeed an AS3 issue. The 3.16 player is able to play the videos flawlessly, while the 4.2 player only returns garbled audio and no video.

Some other test H264-in-flv videos Daniel Taylor made are also working fine in AS2 and not at all in AS3.

JW Player

User  
0 rated :

Hi JeroenW,
Do you know how to get JW player work with php streamed mp4-in-flv? I'm using 4.2 it seeks in downloaded area only. When trying ahead the player even does not requests server. I've tried 3.16 too but seems it is not support php streaming (I did not get result with "file=..&streamer=.." syntax)
If it is AS version issue what player version could handle streaming correctly?

JW Player

User  
0 rated :

@JeroenW
I just tried tubecup.com player with my mp4 in flv files (it took some hacking to run player with other host) it is working! I can seek ahead.
So it is definitly matter of player to support streaming with mp4 inside flv.
Do you know how it could be done with JW player?

JeroenW

JW Player Support Agent  
0 rated :

As I said above here, this depends on the actionscript version. In actionscript 2 (3.xx player) it IS possible to do H264-in-FLV and in actionscript 3 (4.xx player) it is NOT possible to do H264-in-FLV. Since all moves to actionscript 3 in time, it might be best to find another http streaming solution than this one.

JW Player

User  
0 rated :

@JeroenW
Thx for answer. Does old 3.xx version support php streaming (i.e. &start= get parameter)? I tried 3.16 but did not get right query to server.
On other solution - do you know any other way except H264-in-FLV or Lighttpd solution? Lighttpd is great but slow seek on big movies.

JW Player

User  
0 rated :

@JeroenW - will this solution now work in the 4.xx Player?

http://h264.code-shop.com/trac#Timeshiftingseek



JW Player

User  
0 rated :

@JeroenW
In actionscript3, I think it is possible to seek H264-in-FLV. Flowplayer has an plugin named pseudostreaming ( http://flowplayer.org/plugins/streaming/pseudostreaming.html ) supports h264-in-FLV, the plugin was written in actionscript3.

Another commerical player in ( hd.tudou.com, a china youtube-like website) also can play h264-in-FLV, which also wriiten in actionscript3. I decompiled the player, and found that it used the mx.controls.videoclasses.VideoPlayer class, since i'am not actionscript expert, I don't know whether it is the point.

JW Player

User  
0 rated :

@zeaphoo - the h.264 module is from the same author who I referenced in the link above http://h264.code-shop.com/trac . It was also news in Jan/2009. I was asking if it has been tested/implemented since then with JW FLV Player. I wonder??

Inorder to use the h.264 module, It is my understanding that he charges a license fee for commercial use, but free for non-commercial use..

Anyone have any experience?



JW Player

User  
0 rated :

Hi Steve,

At the bottom of the following page http://www.longtailvideo.com/support/tutorials/HTTP-Video-Streaming you can see an example of the JW player streaming/seeking H264 with the server-side Lighttpd module.

JW Player

User  
0 rated :

Thanks Arjen,

Included at the bottom of that page,

"With Apache or IIS, you add HTTP streaming through a server side script, which negatively impacts performance. One web server without this performance issue is the Lighttpd web server."

For your module, you wrote here http://h264.code-shop.com/trac

"We have also added support for Apache and Ngingx, next to Lighttpd."

How does the performance now compare with an Apache server (vs. Lighttpd)? Is your update to your module still expected for this month, February?

Thanks.

JW Player

User  
0 rated :

I can tell you from experience (I've been using the modules with LightTPD for a long time), that the performance is very good; much better with the new versions. Even better with nginx.

The v4.4.x players also support nginx.

JW Player

User  
0 rated :

An additional question:

Will there be any quality differences if an FLV container is used versus an MP4 container when encoding using a h264 codec?

JW Player

User  
0 rated :

If you put the same H.264 video stream in a FLV container or a MP4 container, the quality should be about the same, with some minor differences in the way the Adobe Flash Player decodes and displays.

The only reason that you would ever want to do this is so you could use a serverside script to do HTTP pseudostreaming. But since you can't seek into the H.264 in the FLV container (the metadata isn't right), there is no point to putting H.264 into a FLV container.

Better to use one of code-shop's MP4 streaming modules with Apache, LightTPD, or nginx.

Or did I miss something???

JW Player

User  
0 rated :

Thanks, lefTy.

That's exactly what I was looking for. What is missing is that I have a script which injects metadata with FLVtool2 in order to allow for pseudo-streaming. Since FLVtool2 only works with FLV files, the script requires an flv container.

I, however, want the benefits of h264 and will be using ffmpeg with the x264 codec. I will force the flv format to generate the flv container on output. Therefore, I can still use the script with FLVtool2 and benefit from the compression and performance of libx264.

JW Player

User  
0 rated :

flvtool2 will inject the metadata into the FLV container with the H.264 video, but it won't work for pseudostreaming. I've tried & tried & tried & tried.

If you can get ti to work, that will be a real miracle!

And I'd be *_VERY_* happy to see it! :d

JW Player

User  
0 rated :

but why would you use flv when this player can play mp4??

or doesnt it play h264 at all?

JW Player

User  
0 rated :

Some users would like to put H.264 into a FLV container, so they can use HTTP pseudostreaming to deliver the video file.

Then they don't have to use a server that can stream MP4/H.264 using the RTMP protocol or one of the H.264 streaming modules that are available for Apache2, LightTPD, and nginx.

JW Player

User  
0 rated :

I have a webhost account with php/mysql/apache, now I am looking for h264 videos pseudo-streaming too.

Anyone make mp4-in-flv container with JWPlayer skipping working?

JW Player

User  
0 rated :

h264-in-flv scrubbing works fine with JW v3 series, or with Flowplayer v3 series, e.g. You still need to insert keyframe data into the flv with yamdi, e.g.

JW Player

User  
0 rated :

I have files in h.264 in FLV and they play properly in JW Player and adobe media player. But i need to change these back to regular video files h.264 or any other standard format

This question has received the maximum number of answers.