Ssl write failed

On Tue, Oct 7, 2008 at 3:21 PM, Kon W. [email protected] wrote:

On Tue, Oct 7, 2008 at 3:16 PM, Thomas [email protected] wrote:

Yes it will work. The only question is, if there is an encoder out yet that
can save h264 video in flv. I know the ffmpeg guys were working on it.
Is it coming from the metadata that is positionned at the end of the
video file instead of at the beginning?

Did anyone manage to create a streamable flv video with h264 format?

I’ve placed two examples on Megaupload encoded with Flash Media
Encoder 3.0. H264 Video with MP3 Audio in a f4v container (this is the
new container format used by Adobe). These are not multibitrate
streams.

http://www.megaupload.com/?d=9LS45ZZB - baseline h264 profile,
500kbps, 10sec KFI
http://www.megaupload.com/?d=A3CQSI41 - main h264 profile, 500kbps,
10sec KFI

Cheers
Kon

Yes it will work. The only question is, if there is an encoder out yet that
can save h264 video in flv. I know the ffmpeg guys were working on it.

On that topic, I tried making a .flv video that uses h264 format. The
video was encoded using mencoder and x264. The video plays fine with
VLC, but when I want to inject metadata in the video using flvtool2, I
get the following error message:

ERROR: IO is not a FLV stream. Wrong signature.

Is it coming from the metadata that is positionned at the end of the
video file instead of at the beginning?

Did anyone manage to create a streamable flv video with h264 format?

Dear Thomas,

I have implementated an H.264 streaming module, you can download it from
http://218.244.191.134:8081/mp4.tar.bz2

install & compile

  1. wget http://218.244.191.134:8081/mp4.tar.bz2
  2. tar xfj mp4.tar.bz2
  3. mv mp4 your_path/nginx-0.7.17/src/http/modules
  4. cd your_path/nginx-0.7.17/src/http/modules
  5. ./configure --with-http_flv_module --add-module=src/http/modules/mp4
  6. make
  7. make install

a simple demo
http://218.244.191.134:8081/playertest/mp4_streaming_nginx_test.html

Enjoy it!

Best Regard,

Peng Wu
2008-10-08

Tech. VP
http://www.openv.com
26th Floor, Block 16, jianwai SOHO,
No.39 Middle East Third Ring Rd
Chaoyang District Beijing 100022
China
Tel: (010)5878 7828
Fax: (010)5878 7900
Email : [email protected]

·¢¼þÈË£ºThomas
·¢ËÍÈÕÆÚ£º2008-10-08 06:33:12
ÊÕ¼þÈË£º[email protected]
³­ËÍ£º
Ö÷Ì⣺Re: h.264 streaming support?

Yes it will work. The only question is, if there is an encoder out yet that
can save h264 video in flv. I know the ffmpeg guys were working on it.

On that topic, I tried making a .flv video that uses h264 format. The
video was encoded using mencoder and x264. The video plays fine with
VLC, but when I want to inject metadata in the video using flvtool2, I
get the following error message:

ERROR: IO is not a FLV stream. Wrong signature.

Is it coming from the metadata that is positionned at the end of the
video file instead of at the beginning?

Did anyone manage to create a streamable flv video with h264 format?

Dear all,

  1. cd your_path/nginx-0.7.17/src/http/modules
    should be
  1. cd your_path/nginx-0.7.17

Best Regard,

Peng Wu
2008-10-08

Tech. VP
http://www.openv.com
26th Floor, Block 16, jianwai SOHO,
No.39 Middle East Third Ring Rd
Chaoyang District Beijing 100022
China
Tel: (010)5878 7828
Fax: (010)5878 7900
Email : [email protected]

·¢¼þÈË£ºÎéÅô
·¢ËÍÈÕÆÚ£º2008-10-08 08:42:19
ÊÕ¼þÈË£º[email protected]
³­ËÍ£º
Ö÷Ì⣺Re: Re: h.264 streaming support?

Dear Thomas,

I have implementated an H.264 streaming module, you can download it from
http://218.244.191.134:8081/mp4.tar.bz2

install & compile

  1. wget http://218.244.191.134:8081/mp4.tar.bz2
  2. tar xfj mp4.tar.bz2
  3. mv mp4 your_path/nginx-0.7.17/src/http/modules
  4. cd your_path/nginx-0.7.17/src/http/modules
  5. ./configure --with-http_flv_module --add-module=src/http/modules/mp4
  6. make
  7. make install

a simple demo
http://218.244.191.134:8081/playertest/mp4_streaming_nginx_test.html

Enjoy it!

Best Regard,

Peng Wu
2008-10-08

Tech. VP
http://www.openv.com
26th Floor, Block 16, jianwai SOHO,
No.39 Middle East Third Ring Rd
Chaoyang District Beijing 100022
China
Tel: (010)5878 7828
Fax: (010)5878 7900
Email : [email protected]

·¢¼þÈË£ºThomas
·¢ËÍÈÕÆÚ£º2008-10-08 06:33:12
ÊÕ¼þÈË£º[email protected]
³­ËÍ£º
Ö÷Ì⣺Re: h.264 streaming support?

Yes it will work. The only question is, if there is an encoder out yet that
can save h264 video in flv. I know the ffmpeg guys were working on it.

On that topic, I tried making a .flv video that uses h264 format. The
video was encoded using mencoder and x264. The video plays fine with
VLC, but when I want to inject metadata in the video using flvtool2, I
get the following error message:

ERROR: IO is not a FLV stream. Wrong signature.

Is it coming from the metadata that is positionned at the end of the
video file instead of at the beginning?

Did anyone manage to create a streamable flv video with h264 format?

Dear all,

I have implemented an H.264 pseudo streaming module. And now I want to
add cache feature to this module.

My situation is that we have some data centers across country, and each
data center has some servers to provide video clips to our users.
Because we want to simplify the management of the storage and video
files synchronization problem, we maintain only one central storage. The
servers on edge data centers should cache the most visited video clips
based on LRU algorithm.

I read the ngx_httpd_proxy_module.c file, and I think it is a good
starting point. I know a simplified module capable of this cache feature
should work like this:
Step 1.if the requested file has been found on local disk, return the
file
Step 2.if the requested file has not been found on local disk, proxy
this request to original server and send the response to user and save
the file to local disk.

I know I can implement Step 1 on ngx_http_proxy_handler function. For
Step 2 I know I should create the proxy request on
ngx_http_proxy_create_request function, but I do NOT know on which
function I can save the response file to local disk and how. Should I
implement this feature on ngx_http_proxy_finalize_request function? And
which data structure contains the returned file data, is it
u->buffering?

Thank you very much!

You can download the H.264 pseudo streaming module from
http://218.244.191.134:8081/mp4.tar.bz2

compile & intall

  1. wget http://218.244.191.134:8081/mp4.tar.bz2
  2. tar xfj mp4.tar.bz2
  3. mv mp4 your_path/nginx-0.7.17/src/http/modules
  4. cd your_path/nginx-0.7.17
  5. ./configure --with-http_flv_module --add-module=src/http/modules/mp4
  6. make
  7. make install
  8. kill -HUP cat /usr/local/nginx/logs/nginx.pid

a simple demo
http://218.244.191.134:8081/playertest/mp4_streaming_nginx_test.html

Enjoy!

Best Regard,

Peng Wu
2008-10-08

Tech. VP
http://www.openv.com
26th Floor, Block 16, jianwai SOHO,
No.39 Middle East Third Ring Rd
Chaoyang District Beijing 100022
China
Tel: (010)5878 7828
Fax: (010)5878 7900
Email : [email protected]

Dear all,

nginx.conf example

location ~ .mp4$ {
mp4;
}

Best Regard,

Peng Wu
2008-10-08

Tech. VP
http://www.openv.com
26th Floor, Block 16, jianwai SOHO,
No.39 Middle East Third Ring Rd
Chaoyang District Beijing 100022
China
Tel: (010)5878 7828
Fax: (010)5878 7900
Email : [email protected]

·¢¼þÈË£ºÎéÅô
·¢ËÍÈÕÆÚ£º2008-10-08 11:20:07
ÊÕ¼þÈË£º[email protected]
³­ËÍ£º
Ö÷Ì⣺about h.264 streaming cache support

Dear all,

I have implemented an H.264 pseudo streaming module. And now I want to
add cache feature to this module.

My situation is that we have some data centers across country, and each
data center has some servers to provide video clips to our users.
Because we want to simplify the management of the storage and video
files synchronization problem, we maintain only one central storage. The
servers on edge data centers should cache the most visited video clips
based on LRU algorithm.

I read the ngx_httpd_proxy_module.c file, and I think it is a good
starting point. I know a simplified module capable of this cache feature
should work like this:
Step 1.if the requested file has been found on local disk, return the
file
Step 2.if the requested file has not been found on local disk, proxy
this request to original server and send the response to user and save
the file to local disk.

I know I can implement Step 1 on ngx_http_proxy_handler function. For
Step 2 I know I should create the proxy request on
ngx_http_proxy_create_request function, but I do NOT know on which
function I can save the response file to local disk and how. Should I
implement this feature on ngx_http_proxy_finalize_request function? And
which data structure contains the returned file data, is it
u->buffering?

Thank you very much!

You can download the H.264 pseudo streaming module from
http://218.244.191.134:8081/mp4.tar.bz2

compile & intall

  1. wget http://218.244.191.134:8081/mp4.tar.bz2
  2. tar xfj mp4.tar.bz2
  3. mv mp4 your_path/nginx-0.7.17/src/http/modules
  4. cd your_path/nginx-0.7.17
  5. ./configure --with-http_flv_module --add-module=src/http/modules/mp4
  6. make
  7. make install
  8. kill -HUP cat /usr/local/nginx/logs/nginx.pid

a simple demo
http://218.244.191.134:8081/playertest/mp4_streaming_nginx_test.html

Enjoy!

Best Regard,

Peng Wu
2008-10-08

Tech. VP
http://www.openv.com
26th Floor, Block 16, jianwai SOHO,
No.39 Middle East Third Ring Rd
Chaoyang District Beijing 100022
China
Tel: (010)5878 7828
Fax: (010)5878 7900
Email : [email protected]

Dear Thomas,

I think it will work on nginx 0.6.32.
I tested the H.264 pseudo streaming module only on my 64bit machine. I
do not know weather it will compile or work on a 32bit machine. If it
works, please let me know.

Best Regard,

Peng Wu
2008-10-08

Tech. VP
http://www.openv.com
26th Floor, Block 16, jianwai SOHO,
No.39 Middle East Third Ring Rd
Chaoyang District Beijing 100022
China
Tel: (010)5878 7828
Fax: (010)5878 7900
Email : [email protected]

·¢¼þÈË£ºThomas
·¢ËÍÈÕÆÚ£º2008-10-08 18:10:49
ÊÕ¼þÈË£º[email protected]
³­ËÍ£º
Ö÷Ì⣺Re: Re: Re: h.264 streaming support?

@Kon W.: thank you very much for providing the f4v file,
unfortunately the video didn’t play. I run flvtool2 to inspect the
video file, and as expected, I got the same error that I had when
encoding with mencoder: IO is not a FLV stream. Wrong signature. So
either Nginx flv module and/or the JW FLV player I am using don’t know
how to use the file.

@Peng Wu: xie xie ni, I will have a look at your module. Is it
compatible with the stable latest release of Nginx 0.6.32? The video
quality is truely amazing, good ole’ VP6 is completely left behind,
and my poor ole’ iBook is struggling to play the video :stuck_out_tongue:

@Kon W.: thank you very much for providing the f4v file,
unfortunately the video didn’t play. I run flvtool2 to inspect the
video file, and as expected, I got the same error that I had when
encoding with mencoder: IO is not a FLV stream. Wrong signature. So
either Nginx flv module and/or the JW FLV player I am using don’t know
how to use the file.

@Peng Wu: xie xie ni, I will have a look at your module. Is it
compatible with the stable latest release of Nginx 0.6.32? The video
quality is truely amazing, good ole’ VP6 is completely left behind,
and my poor ole’ iBook is struggling to play the video :stuck_out_tongue:

On Wed, Oct 8, 2008 at 2:50 AM, Thomas [email protected] wrote:

@Kon W.: thank you very much for providing the f4v file,
unfortunately the video didn’t play. I run flvtool2 to inspect the
video file, and as expected, I got the same error that I had when
encoding with mencoder: IO is not a FLV stream. Wrong signature. So
either Nginx flv module and/or the JW FLV player I am using don’t know
how to use the file.

Then your tools are broken. As I said before this is created by the
latest version of FME’s output. It is playable on new versions of FMS
which are as of yet unreleased. IF you want to support VOD delivery
for the new flash format then you will have to decode this format in
the future.

Cheers
Kon

Hi Peng Wu, I tried compiling your module on my PowerPC dev machine,
and it crashed with the following error message:

src/http/modules/mp4/ngx_http_mp4_module.c: In function
‘ngx_http_mp4_handler’:
src/http/modules/mp4/ngx_http_mp4_module.c:463: error:
‘ngx_open_file_info_t’ has no member named ‘directio’
src/http/modules/mp4/ngx_http_mp4_module.c:463: error: ‘struct
ngx_http_core_loc_conf_s’ has no member named ‘directio’
src/http/modules/mp4/ngx_http_mp4_module.c:516: error: ‘struct
ngx_http_request_s’ has no member named ‘root_tested’
cc1: warnings being treated as errors
src/http/modules/mp4/ngx_http_mp4_module.c:551: warning: comparison
between signed and unsigned
src/http/modules/mp4/ngx_http_mp4_module.c:581: warning: passing
argument 4 of ‘moov_seek’ from incompatible pointer type
src/http/modules/mp4/ngx_http_mp4_module.c: In function
‘atom_read_header’:
src/http/modules/mp4/ngx_http_mp4_module.c:777: warning: cast from
pointer to integer of different size
make[1]: *** [objs/addon/mp4/ngx_http_mp4_module.o] Error 1
make: *** [build] Error 2

Sorry I have no C knowledge to help with.

great!

Hi,

I checked the changelog for Nginx, and indeed the directio function
was introduced in 0.7.7. So I tried compiling with 0.7.17, and now I
get the following error message:

src/http/modules/mp4//ngx_http_mp4_module.c: In function
‘ngx_http_mp4_handler’:
src/http/modules/mp4//ngx_http_mp4_module.c:551: warning: comparison
between signed and unsigned
src/http/modules/mp4//ngx_http_mp4_module.c:581: warning: passing
argument 4 of ‘moov_seek’ from incompatible pointer type
src/http/modules/mp4//ngx_http_mp4_module.c: In function
‘atom_read_header’:
src/http/modules/mp4//ngx_http_mp4_module.c:777: warning: cast from
pointer to integer of different size
make[1]: *** [objs/addon/mp4/ngx_http_mp4_module.o] Error 1
make: *** [build] Error 2

I recall a former post on this topic:

I’m not sure manipulating mp4 files is a good idea in a single process
server. Also Adobe released a new FLV specification a few days ago
that supports h264, so there is no real need for supporting mp4 files,
because the flv streaming module already works.

Sergej

Has anyone experienced any problem about that? If I understand
correctly, the mp4 file format was not designed to be streamed online.

Dear Thomas,

I updated the source code today and removed some junk code.
I recommand you download a new version
http://218.244.191.134:8081/mp4.tar.bz2 and compile again, and then tell
me the compiler output.
Please tell me you machine 32bit or 64bit, what CPU type, your os and
version, and your compile version.
I guess you use a 32bit machine, so I added some code to deal with this
issue, maybe I have already solved the compile error and warnings.
Because I do not a 32bit test box, you could download the new version
code and tell me your result.

Best Regard,

Peng Wu
2008-10-09


·¢¼þÈË£ºThomas
·¢ËÍÈÕÆÚ£º2008-10-09 18:39:55
ÊÕ¼þÈË£º[email protected]
³­ËÍ£º
Ö÷Ì⣺Re: Re: Re: h.264 streaming support?

Hi,

I checked the changelog for Nginx, and indeed the directio function
was introduced in 0.7.7. So I tried compiling with 0.7.17, and now I
get the following error message:

src/http/modules/mp4//ngx_http_mp4_module.c: In function
‘ngx_http_mp4_handler’:
src/http/modules/mp4//ngx_http_mp4_module.c:551: warning: comparison
between signed and unsigned
src/http/modules/mp4//ngx_http_mp4_module.c:581: warning: passing
argument 4 of ‘moov_seek’ from incompatible pointer type
src/http/modules/mp4//ngx_http_mp4_module.c: In function
‘atom_read_header’:
src/http/modules/mp4//ngx_http_mp4_module.c:777: warning: cast from
pointer to integer of different size
make[1]: *** [objs/addon/mp4/ngx_http_mp4_module.o] Error 1
make: *** [build] Error 2

I recall a former post on this topic:

I’m not sure manipulating mp4 files is a good idea in a single process
server. Also Adobe released a new FLV specification a few days ago
that supports h264, so there is no real need for supporting mp4 files,
because the flv streaming module already works.

Sergej

Has anyone experienced any problem about that? If I understand
correctly, the mp4 file format was not designed to be streamed online.

Dear Thomas,

cc1: warnings being treated as errors

Sorry I have no C knowledge to help with.

I think you can give nginx 0.7.17 a chance.
I guess these errors are caused by the extented data structure of nginx
0.7 out of nginx 0.6.
nginx 0.7.17 is rather stable on my box, so maybe you want to play with
it.
I am so sorry I did not test this module on nginx 0.6.32.

Best Regard,

Peng Wu
2008-10-09

I tried compiling on my PowerPC G4 32bits cpu running Tiger with
Xcode, gcc version is 4.0.1, and it still fails with the following
error message:

cc1: warnings being treated as errors
src/http/modules/mp4//ngx_http_mp4_module.c: In function
‘ngx_http_mp4_handler’:
src/http/modules/mp4//ngx_http_mp4_module.c:443: warning: comparison
between signed and unsigned
src/http/modules/mp4//ngx_http_mp4_module.c:473: warning: passing
argument 4 of ‘moov_seek’ from incompatible pointer type
make[1]: *** [objs/addon/mp4/ngx_http_mp4_module.o] Error 1
make: *** [build] Error 2

On a Debian Etch 32bits I get the same error message.

On a Debian Etch 64bits it compiles fine and I am now able to stream
mp4 files and jump around in the timeline. However I find that
scrubbing takes a lot of time for the video to start playing from its
new position, do you know where the problem could come from? I saw on
your new video which is the trailer of Pan Labyrinth, the scrubbing is
faster, did you tweak anything in the video? Is it because of the size
of the video? Does Nginx have to go through the whole video to find
the new seekpoint? The latter could be a big problem.

Anyway I am very happy with the module right now, let us know if we
can do anything to help you improve it. Making it compile on a 32bits
could be a nice advantage for developpers who are still on these
systems.

Dear Thomas,

I will find a 32bit machine and try to fix the compile problem.

However I find that
scrubbing takes a lot of time for the video to start playing from its
new position, do you know where the problem could come from? I saw on
your new video which is the trailer of Pan Labyrinth, the scrubbing is
faster, did you tweak anything in the video? Is it because of the size
of the video? Does Nginx have to go through the whole video to find
the new seekpoint? The latter could be a big problem.

I did not tweak anything in the video.
Maybe you can use the test file on

the file is http://content.bitsontherun.com/videos/cdqMNeoG.m4v
and I will use ffmpeg to encode a new longer test video for you, it will
take 2 hours.

Best Regard,

Peng Wu
2008-10-10

Dear mike,

You can always install a 32 bit os in a VM :slight_smile:
I will try to release some disk space on my notebook :slight_smile:

of the video? Does Nginx have to go through the whole video to find
the new seekpoint? The latter could be a big problem.

I did not tweak anything in the video.
Maybe you can use the test file on
JW Player: End-to-End Solution for Streaming & Monetizing Video
the file is http://content.bitsontherun.com/videos/cdqMNeoG.m4v
and I will use ffmpeg to encode a new longer test video for you, it
will take 2 hours.
I just realize the mp4 pseudo streaming module can NOT support m4v file
right now.
It needs some modify to support m4v files. sorry.

Best Regard,

Peng Wu
2008-10-10

You can always install a 32 bit os in a VM :slight_smile:

Dear Thomas,

I make a new video for you.
http://218.244.191.134:8081/playertest/mp4_streaming_nginx_test.html

Best Regard,

Peng Wu
2008-10-11

On a Debian Etch 64bits it compiles fine and I am now able to stream
mp4 files and jump around in the timeline. However I find that
scrubbing takes a lot of time for the video to start playing from its
new position, do you know where the problem could come from? I saw on
your new video which is the trailer of Pan Labyrinth, the scrubbing is
faster, did you tweak anything in the video? Is it because of the size
of the video? Does Nginx have to go through the whole video to find
the new seekpoint? The latter could be a big problem.

Dear all,

I have implemented an H.264 pseudo streaming module. And now I want to add cache feature to this module.
Forget it!
I made a silly mistake, after reading docs over and over and now I
realize this is unnecessary.
Using proxy module’s proxy_store directive and some scripts, I can do
everything I want.
No new code should be written.
Nginx is a great product, it has almost every feature I want. I love it.
Thank you Igor.

My situation is that we have some data centers across country, and each data center has some servers to provide video clips to our users. >Because we want to simplify the management of the storage and video files synchronization problem, we maintain only one central storage. >The servers on edge data centers should cache the most visited video clips based on LRU algorithm.

I read the ngx_httpd_proxy_module.c file, and I think it is a good starting point. I know a simplified module capable of this cache >feature should work like this:
Step 1.if the requested file has been found on local disk, return the file
Step 2.if the requested file has not been found on local disk, proxy this request to original server and send the response to user and >save the file to local disk.

I know I can implement Step 1 on ngx_http_proxy_handler function. For Step 2 I know I should create the proxy request on >ngx_http_proxy_create_request function, but I do NOT know on which function I can save the response file to local disk and how. Should I >implement this feature on ngx_http_proxy_finalize_request function? And which data structure contains the returned file data, is it >u->buffering?

Best Regard,

Peng Wu
2008-10-12