V
V
Vladislav2015-03-19 18:47:33
flow player
Vladislav, 2015-03-19 18:47:33

Why, when playing a stream through flash, the sound starts playing immediately, and the picture appears much later?

Good day.
The problem is this: when the page is loaded, the player is initialized, but by clicking on play, the sound starts playing, but the video is not there for about 1/2 of the duration of the video. The shorter the clip, the faster the picture starts to play. Poryskav on the vast expanses of the Internet found the following variant of the problem: moov atom when decoding the mp4 file was placed at the end. Okay, using a simple console script, I checked if it really is:
Atom ftyp @ 0 of size: 28, ends @ 28
Atom moov @ 28 of size: 6281, ends @ 6309
Atom mvhd @ 36 of size: 108, ends @ 144
Atom trak @ 144 of size: 5300, ends @ 5444
Atom tkhd @ 152 of size: 92, ends @ 244
Atom edts @ 244 of size: 36, ends @ 280
Atom elst @ 252 of size: 28, ends @ 280
Atom mdia @ 280 of size: 5164, ends @ 5444
Atom mdhd @ 288 of size: 32, ends @ 320
Atom hdlr @ 320 of size: 49, ends @ 369
Atom minf @ 369 of size: 5075, ends @ 5444
Atom smhd @ 377 of size: 16, ends @ 393
Atom dinf @ 393 of size: 36, ends @ 429
Atom dref @ 401 of size: 28, ends @ 429
Atom stbl @ 429 of size: 5015, ends @ 5444
Atom stsd @ 437 of size: 103, ends @ 540
Atom mp4a @ 453 of size: 87, ends @ 540
Atom esds @ 489 of size: 51, ends @ 540
Atom stts @ 540 of size: 24, ends @ 564
Atom stsc @ 564 of size: 268, ends @ 832
Atom stsz @ 832 of size: 4508, ends @ 5340
Atom stco @ 5340 of size: 104, ends @ 5444
Atom trak @ 5444 of size: 865, ends @ 6309
Atom tkhd @ 5452 of size: 92, ends @ 5544
Atom edts @ 5544 of size: 36, ends @ 5580
Atom elst @ 5552 of size: 28, ends @ 5580
Atom mdia @ 5580 of size: 729, ends @ 6309
Atom mdhd @ 5588 of size: 32, ends @ 5620
Atom hdlr @ 5620 of size: 49, ends @ 5669
Atom minf @ 5669 of size: 640, ends @ 6309
Atom vmhd @ 5677 of size: 20, ends @ 5697
Atom dinf @ 5697 of size: 36, ends @ 5733
Atom dref @ 5705 of size: 28, ends @ 5733
Atom stbl @ 5733 of size: 576, ends @ 6309
Atom stsd @ 5741 of size: 158, ends @ 5899
Atom avc1 @ 5757 of size: 142, ends @ 5899
Atom avcC @ 5843 of size: 37, ends @ 5880
Atom colr @ 5880 of size: 19, ends @ 5899 ~
Atom stts @ 5899 of size: 24, ends @ 5923
Atom stss @ 5923 of size: 20, ends @ 5943
Atom sdtp @ 5943 of size: 38, ends @ 5981
Atom stsc @ 5981 of size: 100, ends @ 6081
Atom stsz @ 6081 of size: 124, ends @ 6205
Atom stco @ 6205 of size: 104, ends @ 6309
Atom wide @ 6309 of size: 8, ends @ 6317 ~
Atom mdat @ 6317 of size: 356148, ends @ 362465
It turned out that moov atom wasn't the problem after all. Application in angular. Directive code snippet:

var options = {
          ratio: 1/1,
          debug: true,
          rtmpt: true,
          rtmp: 'rtmp://'+ ENV.wowza.ip +':'+ ENV.wowza.port +'/vod/',//Location of the Flash streaming server.
          playlist:[],
          key:'******************',
          bufferTime: 0,
          engine: 'html5'
        };
        //load vide from url

        scope.$watch(function(){
          return attr.uploadid;
        }, function(newVal){
          if(newVal && newVal !== '') {
            if ( bowser.ios ) {
              options.playlist.push([{mpegurl: 'http://'+ ENV.wowza.ip +':'+ ENV.wowza.port +'/vod/mp4:'+ attr.uploadid +'/playlist.m3u8'}]);
            } else if ( bowser.android ) {
              if (bowser.chrome && bowser.version >= 36) {
                options.playlist.push([{mpegurl: 'http://'+ ENV.wowza.ip +':'+ ENV.wowza.port +'/vod/mp4:'+ attr.uploadid +'/playlist.m3u8'}]);
              } else {
                options.playlist.push([{mp4: 'rtsp://'+ ENV.wowza.ip +':'+ ENV.wowza.port +'/vod/'+ attr.uploadid}]);
              }
            } else {
              options.playlist.push([{flash: 'mp4:'+attr.uploadid}]);
            }
            
            elem.flowplayer(options);
            var api = flowplayer(elem);            
            

          }
        });

<video-player uploadid="*****************"></video-player>

An example of a bug can be seen here
Has anyone encountered this? I sat today for about 6 hours trying to solve the problem.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question