Results 1 to 6 of 6

Thread: Unexpected disconnect event log4j

  1. #1
    Join Date
    Feb 2014
    Posts
    6

    Default Unexpected disconnect event log4j

    Hello,

    I have the log4j system linked to a database, as you may know log4j records all events.
    I am using wowza 3.6 VOD

    When a user starts a video i get a record in the database with the connect and play event.
    If a user stops or pauses the video i will get a stop/disconnect event.

    The problem is when a user plays a video of a extended period of time (5min sometimes) i get a disconnect event even when the user is still playing the video.

    I expect that i get the disconnect event when the user pauses or stops the video.
    Does anyone have a solution to this?

    Could it be that the user buffers the video so much that wowza thinks the user timeout-ed and sends a disconnect?
    Last edited by marcovit; 03-13-2014 at 02:09 AM. Reason: Extra info

  2. #2
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Sounds like RTMP playback. If a user is watching a video, the RTMP session has not disconnected yet. I would try some isolated tests. I suggest you take the database logging part out of it. Instead run Wowza in stand-alone (/bin/startup.bat) if you want to see logging in real-time.

    Richard

  3. #3
    Join Date
    Feb 2014
    Posts
    6

    Default

    Quote Originally Posted by rrlanham View Post
    Sounds like RTMP playback. If a user is watching a video, the RTMP session has not disconnected yet. I would try some isolated tests. I suggest you take the database logging part out of it. Instead run Wowza in stand-alone (/bin/startup.bat) if you want to see logging in real-time.

    Richard
    Hello rrlanham,

    We are using the m3u8 playlist.
    We use the database (external) to limit the maximum amount of watchable videos at the same time for a single user in our application.
    (a user is allowed to watch 2 videos at the same time, not limiting it to IP/device)

    Our application is running on a other server then Wowza.

    If you have a butter suggestion then checking the logs for user access i am happy to hear it.

  4. #4
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    I think I understand what you are seeing: with HLS streams to iOS devices there can be multiple sessions server-side for what is one playback session from the user's point of view. If you need to tie them together for accounting purposes you can use this technique

    Richard

  5. #5
    Join Date
    Feb 2014
    Posts
    6

    Default

    Quote Originally Posted by rrlanham View Post
    I think I understand what you are seeing: with HLS streams to iOS devices there can be multiple sessions server-side for what is one playback session from the user's point of view. If you need to tie them together for accounting purposes you can use this technique

    Richard
    That is the tricked i used yes.

    I made a few modifications for my needs:
    log4j.appender.SQ.layout.Fields=x-sname-query
    log4j.appender.SQ.layout.EventExclude=comment,vhost-stop,vhost-start,server-start,server-stop
    log4j.appender.SQ.sql=INSERT IGNORE INTO accesslog (SELECT NULL AS id, '%X{date} %X{time}}' AS DATETIME, '%X{x-event}' AS EVENT, SUBSTRING_INDEX(SUBSTRING_INDEX('%X{x-sname-query}', '&', 2),'&',1) AS userid, SUBSTRING_INDEX(SUBSTRING_INDEX('%X{x-sname-query}%', '&', -2),'&',1) AS sessionid, SUBSTRING_INDEX(SUBSTRING_INDEX('%X{x-sname-query}%', '&', -1),'&',2) AS videoid, '%X{c-ip}' AS ip FROM ( SELECT NULL AS dummy_column) AS dummy_table WHERE '%X{x-event}' = 'connect' OR '%X{x-event}' = 'disconnect' LIMIT 1 ) ON DUPLICATE KEY UPDATE EVENT = '%X{x-event}'
    I send the userId, sessionId and videoId to Wowza, with that i filter out all the needed data.
    Since wowza has a delay of 30seconds between connect and disconnect i group the users with the session_id so they can freely watch videos in the same browser without getting a notification that they hitted there limit.

    I think that is why i am getting a early disconnect, one of the sessions of a IOS device disconnects and wowza updates that.

    What happens when i just turn of the HLS?

    Edit:
    When i turn off HLS, the iPad stops playing the video
    Last edited by marcovit; 03-13-2014 at 07:12 AM.

  6. #6
    Join Date
    Dec 2007
    Posts
    22,013

    Default

    Accounting for HLS and other HTTP stream types is not as fine as RTMP. A system like yours will have to work with what is available. The player is in control when it comes to creating these sessions, not Wowza. You might be able to use onHTTPSessionCreate and onHTTPSessionDestroy in some way to further manage sessions.

    Richard

Similar Threads

  1. http flashplayer streaming disconnect not sending a disconnect to wowza
    By balajiswaroop in forum Media Players and Devices Discussion
    Replies: 1
    Last Post: 11-25-2013, 08:29 AM
  2. Unexpected rename in ModuleMediaWriterFileMover
    By spiritsoul in forum Server-side Modules and Code Samples Discussion
    Replies: 6
    Last Post: 08-06-2013, 11:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •