Results 1 to 5 of 5

Thread: nDVR live streaming and positioning from recording (growing) media file

  1. #1
    Join Date
    Nov 2012
    Posts
    3

    Default nDVR live streaming and positioning from recording (growing) media file

    Hello!

    We are interested to stream a media that is being recorded, media file is growing. Also we want the capability of positioning along the stream.

    We have tried to solve it with ffmpeg and the nDVR AddOn. Ffmpeg reads the growing media file in real-time and streams data to Wowza through rtmp protocol. All this work fine.

    The problem came when the recording has ended. It seams the ffmpeg has streamed all media to Wowza, but the nDVD don't realize of the ffmpeg ending. Always last 10 or 20 segons (chunks file size) are lost, so the player (OSMF or Silverlight player proved) don't show that last 10 or 20 seconds.

    The same behavior has been noted if orignal media is closed, not growing, before starts to stream to Wowza.

    We have seen that last files corresponding to 10 or 20 seconds are not recorded inside the nDVR folder (_definst_\test01.0\0000_00_00).

    ffmpeg command used: ffmpeg\bin\ffmpeg.exe -re -i test01.mxf -vcodec libx264 -ar 44100 -f flv rtmp://192.168.14.225/dvr/test01


    Thank you.

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Do you mean that you are using StreamType "live-record" or the LiveStreamRecord addon or API? Because that is how you would get a single "growing" file. It is not possible to stream that file while it is being recorded. You need to use the nDVR playback methods.

    Richard

  3. #3
    Join Date
    Nov 2012
    Posts
    3

    Default

    Hello Richard,

    I'm using StreamType "live". I've attached the Application.xml of dvr conf. So I'm using nDVR AddOn playback.

    With ffmpeg it's possible to read an growing file (-re option helps to do this) that it is recording. Also, ffmpeg can stream through RTMP to Wowza. Then we can play the recorded (nDVR) stream with the nDVR OSMF Player and Silverlight player that comes with Wowza nDVR sample players.

    The problem is that we can't not play the last 10 seconds, and exactly that duration is lost. It seems that ffmpeg sends all media to Wowza (via RTMP), but Wowza don't save last chunk. But we are not sure. Also, the player is waiting more media in live mode. Only 5 minuts later, when player timeout is done, the player shows the media closed and no live mode is shown. But latest 10 seconds are not accessible.

    Thank you.

    Pepe.


    ------ BEGIN conf\dvr\Application.xml -----------------------------------------------------

    <Root>
    <Application>
    <!-- Uncomment to set application level timeout values
    <ApplicationTimeout>60000</ApplicationTimeout>
    <PingTimeout>12000</PingTimeout>
    <ValidationFrequency>8000</ValidationFrequency>
    <MaximumPendingWriteBytes>0</MaximumPendingWriteBytes>
    <MaximumSetBufferTime>60000</MaximumSetBufferTime>
    <MaximumStorageDirDepth>25</MaximumStorageDirDepth>
    -->
    <Connections>
    <AutoAccept>true</AutoAccept>
    <AllowDomains></AllowDomains>
    </Connections>
    <!--
    StorageDir path variables

    ${com.wowza.wms.AppHome} - Application home directory
    ${com.wowza.wms.ConfigHome} - Configuration home directory
    ${com.wowza.wms.context.VHost} - Virtual host name
    ${com.wowza.wms.context.VHostConfigHome} - Virtual host config directory
    ${com.wowza.wms.context.Application} - Application name
    ${com.wowza.wms.context.ApplicationInstance} - Application instance name
    -->

    <Streams>
    <StreamType></StreamType>
    <StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
    <KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
    <!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater -->
    <LiveStreamPacketizers>dvrstreamingpacketizer,cupertinostreamingpacketizer,smoothstreamingpacketizer ,sanjosestreamingpacketizer</LiveStreamPacketizers>
    <!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
    <Properties>
    </Properties>
    </Streams>
    <Transcoder>
    <!-- To turn on transcoder set to: transcoder -->
    <LiveStreamTranscoder></LiveStreamTranscoder>
    <!-- [templatename].xml or ${SourceStreamName}.xml -->
    <Templates>${SourceStreamName}.xml,transrate.xml</Templates>
    <ProfileDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/profiles</ProfileDir>
    <TemplateDir>${com.wowza.wms.context.VHostConfigHome}/transcoder/templates</TemplateDir>
    <Properties>
    </Properties>
    </Transcoder>

    <DVR>
    <!-- As a single server or as an origin, use dvrstreamingpacketizer in LiveStreamPacketizers above -->
    <!-- Or, in an origin-edge configuration, edges use dvrstreamingrepeater in LiveStreamPacketizers above -->
    <!-- As an origin, also add dvrchunkstreaming to HTTPStreamers below -->

    <!-- To turn on DVR recording set Recorders to dvrrecorder. This works with dvrstreamingpacketizer -->
    <Recorders>dvrrecorder</Recorders>

    <!-- As a single server or as an origin, set the Store to dvrfilestorage-->
    <!-- edges should have this empty -->
    <Store>dvrfilestorage</Store>

    <!-- Window Duration is length of live DVR window in seconds. 0 means the window is never trimmed. -->
    <WindowDuration>0</WindowDuration>

    <!-- Storage Directory is top level location where dvr is stored. e.g. c:/temp/dvr -->
    <StorageDir>${com.wowza.wms.context.VHostConfigHome}/dvr</StorageDir>

    <!-- valid ArchiveStrategy values are append, version, delete -->
    <ArchiveStrategy>version</ArchiveStrategy>

    <!-- If this is a dvrstreamingrepeater, define ChunkOriginURL to point back to origin -->
    <!-- And define Application/Repeater/OriginURL to point back to the origin -->
    <Repeater>
    <ChunkOriginURL></ChunkOriginURL>
    </Repeater>

    <!-- Properties for DVR -->
    <Properties>
    <Property>
    <Name>streamTimeout</Name>
    <Value>300000</Value>
    <Type>Integer</Type>
    </Property>
    <Property>
    <Name>dvrMinimumAvailableChunks</Name>
    <Value>1</Value>
    <Type>Integer</Type>
    </Property>
    <Property>
    <Name>dvrChunkDurationMinimum</Name>
    <Value>1000</Value>
    <Type>Integer</Type>
    </Property>
    <Property>
    <Name>dvrWaitForCodecTime</Name>
    <Value>1000</Value>
    <Type>Integer</Type>
    </Property>
    </Properties>
    </DVR>

    <!-- HTTPStreamers (separate with commas): cupertinostreaming, smoothstreaming, sanjosestreaming, dvrchunkstreaming -->
    <HTTPStreamers>cupertinostreaming,smoothstreaming,sanjosestreaming</HTTPStreamers>

    <SharedObjects>
    <StorageDir></StorageDir>
    </SharedObjects>

    <Client>
    <IdleFrequency>-1</IdleFrequency>
    <Access>
    <StreamReadAccess>*</StreamReadAccess>
    <StreamWriteAccess>*</StreamWriteAccess>
    <StreamAudioSampleAccess></StreamAudioSampleAccess>
    <StreamVideoSampleAccess></StreamVideoSampleAccess>
    <SharedObjectReadAccess>*</SharedObjectReadAccess>
    <SharedObjectWriteAccess>*</SharedObjectWriteAccess>
    </Access>
    </Client>
    <RTP>
    <!-- RTP/Authentication/[type]Methods defined in Authentication.xml. Default setup includes; none, basic, digest -->
    <Authentication>
    <PublishMethod>digest</PublishMethod>
    <PlayMethod>none</PlayMethod>
    </Authentication>
    <!-- RTP/AVSyncMethod. Valid values are: senderreport, systemclock, rtptimecode -->
    <AVSyncMethod>senderreport</AVSyncMethod>
    <MaxRTCPWaitTime>12000</MaxRTCPWaitTime>
    <IdleFrequency>75</IdleFrequency>
    <RTSPSessionTimeout>90000</RTSPSessionTimeout>
    <RTSPMaximumPendingWriteBytes>0</RTSPMaximumPendingWriteBytes>
    <RTSPBindIpAddress></RTSPBindIpAddress>
    <RTSPConnectionIpAddress>0.0.0.0</RTSPConnectionIpAddress>
    <RTSPOriginIpAddress>127.0.0.1</RTSPOriginIpAddress>
    <IncomingDatagramPortRanges>*</IncomingDatagramPortRanges>
    <!-- Properties defined here will override any properties defined in conf/RTP.xml for any depacketizers loaded by this application -->
    <Properties>
    </Properties>
    </RTP>

    <MediaCaster>
    <RTP>
    <RTSP>
    <!-- udp, interleave -->
    <RTPTransportMode>interleave</RTPTransportMode>
    </RTSP>
    </RTP>
    <!-- Properties defined here will override any properties defined in conf/MediaCasters.xml for any MediaCasters loaded by this applications -->
    <Properties>
    </Properties>
    </MediaCaster>

    <MediaReader>
    <!-- Properties defined here will override any properties defined in conf/MediaReaders.xml for any MediaReaders loaded by this applications -->
    <Properties>
    </Properties>
    </MediaReader>

    <MediaWriter>
    <!-- Properties defined here will override any properties defined in conf/MediaWriter.xml for any MediaWriter loaded by this applications -->
    <Properties>
    </Properties>
    </MediaWriter>

    <LiveStreamPacketizer>
    <!-- Properties defined here will override any properties defined in conf/LiveStreamPacketizers.xml for any LiveStreamPacketizers loaded by this applications -->
    <Properties>
    </Properties>
    </LiveStreamPacketizer>

    <HTTPStreamer>
    <!-- Properties defined here will override any properties defined in conf/HTTPStreamers.xml for any HTTPStreamer loaded by this applications -->
    <Properties>
    </Properties>
    </HTTPStreamer>

    <Repeater>
    <OriginURL></OriginURL>
    <QueryString><![CDATA[]]></QueryString>
    </Repeater>

    <Modules>
    <Module>
    <Name>base</Name>
    <Description>Base</Description>
    <Class>com.wowza.wms.module.ModuleCore</Class>
    </Module>
    <Module>
    <Name>properties</Name>
    <Description>Properties</Description>
    <Class>com.wowza.wms.module.ModuleProperties</Class>
    </Module>
    <Module>
    <Name>logging</Name>
    <Description>Client Logging</Description>
    <Class>com.wowza.wms.module.ModuleClientLogging</Class>
    </Module>
    <Module>
    <Name>flvplayback</Name>
    <Description>FLVPlayback</Description>
    <Class>com.wowza.wms.module.ModuleFLVPlayback</Class>
    </Module>
    </Modules>

    <!-- Properties defined here will be added to the IApplication.getProperties() and IApplicationInstance.getProperties() collections -->
    <Properties>
    </Properties>
    </Application>
    </Root>


    ------ END conf\dvr\Application.xml -------------------------------------------------------

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    What version of Wowza are you using? I below, 3.1.2, update to that first:
    http://www.wowza.com/downloads/Wowza....0.x-3.1.2.zip

    Then apply patch 16 over that.
    http://www.wowza.com/downloads/Wowza....2-patch16.zip

    That might, though I do not know that this will help, but it will be necessary to be on the latest before we can look at this from the Wowza side.

    Richard

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Engineering commented that Wowza might be ignoring data after the last key frame is received.

    Can you provide a description of how they are starting/stopping recording.

    Richard

Similar Threads

  1. nDVR Smooth Streaming recording
    By german in forum AddOn: Wowza nDVR
    Replies: 8
    Last Post: 01-03-2012, 09:26 AM
  2. streaming a video file while recording
    By erbora00 in forum General Forum
    Replies: 24
    Last Post: 12-17-2011, 11:31 PM
  3. Live stream recording and file writing
    By videodoctor in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 12-07-2011, 08:19 PM
  4. Recording a live stream to an encrypted file?
    By Geofflee in forum Live Streaming and Encoder Discussion
    Replies: 1
    Last Post: 11-02-2011, 09:02 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
  •