nginx-rtmp-module icon indicating copy to clipboard operation
nginx-rtmp-module copied to clipboard

recorded videos with bad datas stop playing before end

Open alotela opened this issue 13 years ago • 14 comments

Hi,

when we record video (h264/speex) in flv container, sometimes, the video stop playing before the end. The recorded video is good. If I delete meta data we inject with yamdi, I can play it locally, without any problem. But for jwplayer, we need metadata. So I run video into yamdi, and then the video stop playing before the end. I checked the video with flvmeta -C option, and this what I have : 0x0006decc: warning W20018: tag body length is zero 0x0000000d: warning W80062: datasize should be 1082, got 449167 0x0000000d: warning W80062: audiosamplerate should be 5500, got 0 0x0000000d: warning W80062: audiosamplesize should be 16, got 1 0x0000000d: warning W81071: invalid keyframes arrays length

on a good video, I have this : 0x001773a9: warning W20018: tag body length is zero

do you think this might come from the recording from nginx rtmp ? If so, is there any way to fix it ?

Thank you.

alotela avatar Sep 03 '13 09:09 alotela

Can you give me any files to test?

arut avatar Sep 03 '13 10:09 arut

sure. This one is 13s, but plays only 5 seconds

https://www.dropbox.com/s/bk9i9k28krvpj9a/605.broadcast.meta.flv

alotela avatar Sep 03 '13 12:09 alotela

is this the original file or after yamdi? I need original

arut avatar Sep 03 '13 13:09 arut

it's after yamdi. I make a new one...

alotela avatar Sep 03 '13 13:09 alotela

ok, so you were right to suggest the original file. I should have made more tests. Here my results: https://www.dropbox.com/s/vknupxhdb5tak5u/608.broadcast.meta.flv.flvmeta https://www.dropbox.com/s/77abo2d28txebt2/608.broadcast.meta.flv.nginxrtmp https://www.dropbox.com/s/7zhngowcq975i4p/608.broadcast.meta.flv.yamdi

the nginx rtmp is the original. No meta since nginx rtmp does not include meta, so it plays well on my local machine, but still stops after few seconds on jwplayer.

The errors:

  • after yamdi : 0x0005bdc4: warning W20018: tag body length is zero 0x0000000d: warning W80062: datasize should be 938, got 375319 0x0000000d: warning W80062: videodatarate should be 265.107304217, got 266.321671621 0x0000000d: warning W80062: audiosamplerate should be 5500, got 0 0x0000000d: warning W80062: audiosamplesize should be 16, got 1 0x0000000d: warning W81071: invalid keyframes arrays length
  • after flvmeta : 0x0005bd63: warning W20018: tag body length is zero

but both videos stops after few seconds, but the metadata are good.

alotela avatar Sep 03 '13 14:09 alotela

if you need, this our server config: rtmp { server {

    listen 1935;
    chunk_size 4096;
    publish_time_fix on;

    application myapp {
        interleave on;
        live on;
        wait_key on;
        wait_video on;
        record all;
        record_path /tmp;
        sync 100ms;

alotela avatar Sep 03 '13 14:09 alotela

Hi Arut,

it seems that these bad videos do not start at the beginning. I have half a second delay when I try to sync them with others videos, no matter if it is flv or I converted it to mp4 with ffmpeg and libfdak aac (just copying video track). I will try to setup a project for you to test in the same conditions as we do.

alotela avatar Sep 04 '13 07:09 alotela

Cannot download https://www.dropbox.com/s/77abo2d28txebt2/608.broadcast.meta.flv.nginxrtmp

arut avatar Sep 05 '13 10:09 arut

https://www.dropbox.com/s/77abo2d28txebt2/608.broadcast.meta.flv.nginxrtmp.flv

alotela avatar Sep 05 '13 10:09 alotela

What I found

  • flvmeta fixes the problem
  • ffmpeg (-c copy) fixes the problem
  • yamdi does not fix the problem

The fixes made by flvmeta/ffmpeg are (except metadata injection)

  • Speex 5.5 kHz -> 11 kHz - wrong audio from publisher
  • Changed timestamps

arut avatar Sep 05 '13 12:09 arut

It looks like the publisher sends Speex 11 KHz but says it's 5.5kHz. Please try changing sound rate at publisher and see what changes.

arut avatar Sep 05 '13 12:09 arut

can you tell me what command line you use with flvmeta and ffmpeg ? and version ?

Thank you.

alotela avatar Sep 05 '13 16:09 alotela

flvmeta is the latest

flvmeta input.flv output.flv
ffmpeg -i input.flv -c copy output.flv

arut avatar Sep 05 '13 17:09 arut

ok it's good. I used options with flvmeta :/

Thank you!

alotela avatar Sep 05 '13 17:09 alotela