Wowza Community

Record transcoded stream

I would like to record a transcoded stream (which currently is recorded to flv aswell). I can’t get it to record the transcoded flvs, or at least I’m not seeing it. I have attached part of application.xml and complete transcode.xml. Does anyone have an idea what I’m doing wrong? If you have questions or would like to see other files please let me know.

Transcoding is installed, I can see this in the logs

2012-06-13	13:37:25	CEST	comment	server	INFO	200	-	Transcoder Streams Available: Unlimited
2012-06-13	13:37:25	CEST	comment	server	INFO	200	-	Transcoder Watermark: No

My Application.xml look like this:

<Streams>
			<StreamType>default</StreamType>
			<StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
			<KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
			<LiveStreamPacketizers></LiveStreamPacketizers>
			<Properties>
				<!-- <Property>
					<Name>seekTarget</Name>
					<Value>enhanced</Value>
				</Property> -->
			</Properties>
		</Streams>
		<Transcoder>
			<LiveStreamTranscoder>transcoder</LiveStreamTranscoder>
			<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>

and my transcode.xml:

<Root>
	<Transcode>
		<Encodes>
			<Encode>
				<Enable>true</Enable>
				<Name>large</Name>
				<StreamName>flv:${SourceStreamName}_large</StreamName>
				<Video>
					<!-- H.264, PassThru, Disable -->
					<Codec>H.264</Codec>
					<!-- default, CUDA, QuickSync -->
					<Transcoder>default</Transcoder>
					<GPUID>-1</GPUID>
					<FrameSize>
						<!-- letterbox, fit-width, fit-height, crop, stretch, match-source -->
						<FitMode>fit-height</FitMode>
						<!--<Width>576</Width>-->
						<!--<Height>432</Height>-->
						<!-- <Crop>0,0,0,0</Crop> -->
						<!-- <SourceRectangle>0,0,320,240</SourceRectangle> -->
					</FrameSize>
					<Profile>main</Profile>
					<Bitrate>130000</Bitrate>
					<KeyFrameInterval>
						<FollowSource>false</FollowSource>
						<Interval>2</Interval>
					</KeyFrameInterval>
					<Overlays>
						<Overlay>
							<Enable>false</Enable>
							<Index>0</Index>
							<ImagePath>${com.wowza.wms.context.VHostConfigHome}/content/wowzalogo.png</ImagePath>
							<Opacity>100</Opacity>
							<Location>
								<X>5</X>
								<Y>5</Y>
								<Width>${ImageWidth}</Width>
								<Height>${ImageHeight}</Height>
								<!-- horiz: left, right, hcenter - vert: top, bottom, vcenter -->
								<Align>left,top</Align>
							</Location>
						</Overlay>
					</Overlays>
					<Parameters>
					</Parameters>
				</Video>
				<Audio>
					<!-- AAC, PassThru, Disable -->
					<Codec>AAC</Codec>
					<Bitrate>96000</Bitrate>
				</Audio>
				<Properties>
				</Properties>
			</Encode>
			<!-- Setup for 360p, high bandwith, main profile for desktop -->
			<Encode>
				<Enable>true</Enable>
				<Name>small</Name>
				<StreamName>flv:${SourceStreamName}_small</StreamName>
				<Video>
					<!-- H.264, PassThru, Disable -->
					<Codec>H.264</Codec>
					<!-- default, CUDA, QuickSync -->
					<Transcoder>default</Transcoder>
					<GPUID>-1</GPUID>
					<FrameSize>
						<!-- letterbox, fit-width, fit-height, crop, stretch, match-source -->
						<FitMode>fit-height</FitMode>
						<!-- <Width>384</Width> -->
						<!-- <Height>288</Height> -->
						<!-- <Crop>0,0,0,0</Crop> -->
						<!-- <SourceRectangle>0,0,320,240</SourceRectangle> -->
					</FrameSize>
					<Profile>main</Profile>
					<Bitrate>85000</Bitrate>
					<KeyFrameInterval>
						<FollowSource>false</FollowSource>
						<Interval>1</Interval>
					</KeyFrameInterval>
					<Overlays>
						<Overlay>
							<Enable>false</Enable>
							<Index>0</Index>
							<ImagePath>${com.wowza.wms.context.VHostConfigHome}/content/wowzalogo.png</ImagePath>
							<Opacity>100</Opacity>
							<Location>
								<X>5</X>
								<Y>5</Y>
								<Width>${ImageWidth}</Width>
								<Height>${ImageHeight}</Height>
								<!-- horiz: left, right, hcenter - vert: top, bottom, vcenter -->
								<Align>left,top</Align>
							</Location>
						</Overlay>
					</Overlays>
					<Parameters>
					</Parameters>
				</Video>
				<Audio>
					<!-- AAC, PassThru, Disable -->
					<Codec>AAC</Codec>
					<Bitrate>96000</Bitrate>
				</Audio>
				<Properties>
				</Properties>
			</Encode>
		</Encodes>
		<Decode>
			<Video>
				<Deinterlace>false</Deinterlace>
				<Overlays>
					<Overlay>
						<Enable>false</Enable>
						<Index>0</Index>
						<ImagePath>${com.wowza.wms.context.VHostConfigHome}/content/wowzalogo.png</ImagePath>
						<Opacity>100</Opacity>
						<Location>
							<X>5</X>
							<Y>5</Y>
							<Width>${ImageWidth}</Width>
							<Height>${ImageHeight}</Height>
							<!-- horiz: left, right, hcenter - vert: top, bottom, vcenter -->
							<Align>left,top</Align>
						</Location>
					</Overlay>
				</Overlays>
				<Parameters>
				</Parameters>
			</Video>
			<Properties>
			</Properties>
		</Decode>
		<StreamNameGroups>
			<!-- Note: Play stream using stream name ngrp:[stream-name]. -->
			<StreamNameGroup>
				<Name>${SourceStreamName}_all</Name>
				<Members>
					<Member>
						<EncodeName>large</EncodeName>
					</Member>
					<Member>
						<EncodeName>small</EncodeName>
					</Member>
				</Members>
			</StreamNameGroup>
		</StreamNameGroups>
		<Properties>
		</Properties>
	</Transcode>
</Root>

Hi Dennis,

Two things I notice:

  1. Your application.xml specifies the “default” StreamType which is only for VOD streaming. The transcoder as far as I know only works with “live” StreamTypes. Are you transcoding sucessfully with a “default” StreamType?

  2. The StreamType should be one of the *record StreamTypes mentioned in the Wowza User Guide. Are you trying to record using some other method?

Wowza is not going to be able to improve the stream for fast movement in the Transcoder. You should set frame rate, and key frame frequency on the encoder side.

Richard

Technically, only the application needs to be restarted. (I think) But, when testing it’s good practice just to restart Wowza.

Ahh, I think I understand now. You’re using ActionScript commands in your Flash app like so: nsPublish.publish (“myStream”, “record”); In that case, “default” is correct.

“If I change the streamtype to live-record it doesn’t record anymore.”

If you omit the “record” part in your publish command, it should work. Take a look at the flash source in this example for how to integrate Flash publishing and the Wowza Transcoder.

Sorry Dennis,

Check the property in your transcoder template. Check the Wowza tutorials Transcoder section for more info.

Some hints for flash encoding: Try lowering your stream bitrate, for example, by increasing the keyframe interval, lowering quality (or explicit bitrate), and decreasing framerate. 30fps seems too high for webcams and home user upload bandwidth, in my opinion. Try 15 FPS. FYI, I see flash encoding drop down to 4-5FPS frequently.

Did you want a keyframe every 2 frames, or every 2 seconds?

There is some confusion here. Why do you need to “sync recorded videos”? Synching usually applies to multi-bitrate switching between different bitrate versions of a single video. The Wowza transcoder will easily produce keyframe aligned video for this purpose.

“It doesn’t seem to matter what interval I set, it stays the same as the original video.”

It might be defaulting to match-source since you commented out the width and height in your template. You have “fit-height” but the transcoder doesn’t know what height to fit to.

Keyframe interval of 1 (i.e. 30 keyframes a second) is not going to work for a stream bitrate of 85kbps. It would need to be around 1700kbps at 384/288 resolution to do what you’re asking.

Probably your real question here is how to seek between keyframes. You can do this by changing “SeekTarget” to “enhanced” in your Application.xml.

You’ll need a StreamType of live-record, as Randall highlights above, as the Transcoder and recoding only acts on live streams.

You’ll also need to omitt the “record” part in your publish command.

To record to flv, you just need to specify flv: at the beginning of your StreamName in FMLE or Wirecast. That will take care of the

input stream at least. To record Transcoded streams to .flv you need to specify the prefix of flv: (instead of mp4:) for each StreamName in the transcoder/templates

files (such as transrate.xml or transcode.xml).

Example:

from:

mp4:${SourceStreamName}_160p

To:

flv:${SourceStreamName}_160p

Hi Randall,

We are currently recording a rtmp stream from the flash player, this gets recorded to an flv with the above settings. This works, but I want to transcode the stream because I need more and above all consistent keyframes in the .flv, but I can’t get it to work. If I change the streamtype to live-record it doesn’t record anymore. Should the server be restarted?

The install is handled by our hosting provider, but they don’t support the settings and transcoding.

Hi Randall,

recording from flash is not my issue, but getting transcoded flvs in the content folder is. It has been recording flvs, but I also need another transcoded flv in the content folder. I’ve checked all the documentation and my Actionscript is the same as your example. The only thing I’ve found is the streamtype and a patch used in your example. Should I change the streamtype (currently default)? Should we try the patch? Is it something else?

Well, we’ve managed to get transcoding up and running. BUT, the keyframe interval can’t be set higher then the initial stream. Is there something we’re doing wrong? I want a keyframe every 2 frames, but when I set “this._camera.setKeyFrameInterval(60);” in AS. It seems impossible to get more keyframes from transcoding because from AS it is unreliable. It drops keyframes when the clients doesn’t have enough upstream. I was told in another thread that it would be possible with transcoding, but how?

Hi Randall,

I need high image quality and a high framerate to record fast movement. And I need a lot of keyframes to time and synch the recorded videos. I’ve deliberately set the keyframeinterval to 60 in flash so I could test if transcoding would produce videos with a desired interval of 2. It doesn’t seem to matter what interval I set, it stays the same as the original video. Is there another setting I’m missing?