I am trying to get my videos to play properly using Azure Media Services. Videos that are taken in Portrait mode do not play properly, they are not rotated. here is my codes (taken from the Azure Media Services Sample)
Dim filenamewithpath As String = Server.MapPath("." & "\video2.mp4")
Dim filename As String = Path.GetFileName(filenamewithpath)
Dim preset As String = "H264 Adaptive Bitrate MP4 Set 720p"
FileVideo.SaveAs(filenamewithpath)
' Create and cache the Media Services credentials in a static class variable.
Dim assetName = "UploadSingleFile_" + DateTime.UtcNow.ToString()
Dim asset As IAsset = _context.Assets.Create(assetName, AssetCreationOptions.None)
Dim assetFile = asset.AssetFiles.Create(filename)
Dim accessPolicy As IAccessPolicy = _context.AccessPolicies.Create(assetName, TimeSpan.FromDays(30), _
AccessPermissions.Write Or AccessPermissions.List)
Dim locator As ILocator = _context.Locators.CreateLocator(LocatorType.Sas, asset, accessPolicy)
assetFile.Upload(filenamewithpath)
' Declare a new job.
Dim job As IJob = _context.Jobs.Create(preset + " encoding job")
Dim mediaProcessors = _context.MediaProcessors.Where(Function(p) p.Name.Contains("Media Encoder")).ToList()
Dim latestMediaProcessor = mediaProcessors.OrderBy(Function(mp) New Version(mp.Version)).LastOrDefault()
' Create a task with the encoding details, using a string preset.
Dim task As ITask = job.Tasks.AddNew(preset + " encoding task", latestMediaProcessor, preset, Microsoft.WindowsAzure.MediaServices.Client.TaskOptions.ProtectedConfiguration)
' Specify the input asset to be encoded.
task.InputAssets.Add(asset)
' Add an output asset to contain the results of the job.
task.OutputAssets.AddNew("Output asset", AssetCreationOptions.None)
job.Submit()
' Check job execution and wait for job to finish.
Dim progressJobTask As Task = job.GetExecutionProgressTask(CancellationToken.None)
progressJobTask.Wait()
' If job state is Error the event handling
' method for job progress should log errors. Here we check
' for error state and exit if needed.
If job.State = JobState.[Error] Then
Throw New Exception(vbLf & "Exiting method due to job error.")
End If
Dim MP4Asset As IAsset = job.OutputMediaAssets(0)
' BuildSasUrlForMP4File creates a SAS Locator
' and builds the SAS Url that can be used to
' progressively download the MP4 file.
Dim fullSASURL As String = BuildSasUrlForMP4File(MP4Asset)
Dim streamingURL As String _
= GetStreamingOriginLocatorURL(MP4Asset)
fullSASURL = "http://aka.ms/azuremediaplayeriframe?url=" & fullSASURL _
& "&autoplay=false"
In this link:
http://azure.microsoft.com/blog/2014/08/21/advanced-encoding-features-in-azure-media-encoder/
It shows that Azure Media Services can rotate automatically with:
<Presets Rotation="Auto">
<Preset
Version="5.0">
But I can't figure out how to incorporate this in my code.
Thanks
OK, here is at least one solution that I have been able to dig up:
1) Obtain the XML for the preset you are trying to use. In my case, I was using the present for "H264 Adaptive Bitrate MP4 Set 720p". In my code above, this was in the string "preset".
2) Instead of using this string, use the entire XML file for the preset.
3) Change the xml Presets tag to Presets Rotation="Auto"
Here is link to get the presets (there may be others)
https://github.com/AzureMediaServicesSamples/Encoding-Presets/tree/master/VoD/Azure%20Media%20Encoder
Create a new XML file with (I put mine in the root directory of my website -named config1.xml). Here is the XML for my preset:
<Presets Rotation="Auto">
<Preset
Version="5.0">
<Job />
<MediaFile
DeinterlaceMode="AutoPixelAdaptive"
ResizeQuality="Super"
AudioGainLevel="1"
VideoResizeMode="Stretch">
<Metadata
MergeCollection="True">
<Item
Name="WM/EncodedBy"
Value="Azure Media Encoder 4 - H264 Adaptive Bitrate MP4 Set 720p, 07/30/2014 " />
</Metadata>
<OutputFormat>
<MP4OutputFormat
StreamCompatibility="Standard">
<VideoProfile>
<MainH264VideoProfile
BFrameCount="3"
EntropyMode="Cabac"
RDOptimizationMode="Speed"
HadamardTransform="False"
SubBlockMotionSearchMode="Speed"
MultiReferenceMotionSearchMode="Balanced"
ReferenceBFrames="False"
AdaptiveBFrames="False"
SceneChangeDetector="False"
FastIntraDecisions="False"
FastInterDecisions="False"
SubPixelMode="Quarter"
SliceCount="0"
KeyFrameDistance="00:00:02"
InLoopFilter="True"
MEPartitionLevel="EightByEight"
ReferenceFrames="4"
SearchRange="64"
AutoFit="True"
Force16Pixels="False"
FrameRate="0"
SeparateFilesPerStream="True"
SmoothStreaming="False"
NumberOfEncoderThreads="0">
<Streams
AutoSize="False"
FreezeSort="False">
<StreamInfo
Size="1280, 720">
<Bitrate>
<ConstantBitrate
Bitrate="3400"
IsTwoPass="False"
BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo
Size="960, 540">
<Bitrate>
<ConstantBitrate
Bitrate="2250"
IsTwoPass="False"
BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo
Size="960, 540">
<Bitrate>
<ConstantBitrate
Bitrate="1500"
IsTwoPass="False"
BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo
Size="640, 360">
<Bitrate>
<ConstantBitrate
Bitrate="1000"
IsTwoPass="False"
BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo
Size="640, 360">
<Bitrate>
<ConstantBitrate
Bitrate="650"
IsTwoPass="False"
BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo
Size="320, 180">
<Bitrate>
<ConstantBitrate
Bitrate="400"
IsTwoPass="False"
BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
</Streams>
</MainH264VideoProfile>
</VideoProfile>
<AudioProfile>
<AacAudioProfile
Codec="AAC"
Channels="2"
BitsPerSample="16"
SamplesPerSecond="44100">
<Bitrate>
<ConstantBitrate
Bitrate="96"
IsTwoPass="False"
BufferWindow="00:00:00" />
</Bitrate>
</AacAudioProfile>
</AudioProfile>
</MP4OutputFormat>
</OutputFormat>
</MediaFile>
</Preset>
<Preset
Version="5.0">
<Job />
<MediaFile
AudioGainLevel="1">
<Metadata
MergeCollection="True">
<Item
Name="WM/EncodedBy"
Value="Azure Media Encoder 3 - H264 Adaptive Bitrate MP4 Set 720p, 07/30/2014 " />
</Metadata>
<OutputFormat>
<MP4OutputFormat
StreamCompatibility="Standard">
<AudioProfile>
<AacAudioProfile
Codec="AAC"
Channels="2"
BitsPerSample="16"
SamplesPerSecond="44100">
<Bitrate>
<ConstantBitrate
Bitrate="96"
IsTwoPass="False"
BufferWindow="00:00:00" />
</Bitrate>
</AacAudioProfile>
</AudioProfile>
</MP4OutputFormat>
</OutputFormat>
</MediaFile>
</Preset>
<Preset
Version="5.0">
<Job />
<MediaFile
AudioGainLevel="1">
<Metadata
MergeCollection="True">
<Item
Name="WM/EncodedBy"
Value="Azure Media Encoder 3 - H264 Adaptive Bitrate MP4 Set 720p, 07/30/2014 " />
</Metadata>
<OutputFormat>
<MP4OutputFormat
StreamCompatibility="Standard">
<AudioProfile>
<AacAudioProfile
Codec="AAC"
Channels="2"
BitsPerSample="16"
SamplesPerSecond="44100">
<Bitrate>
<ConstantBitrate
Bitrate="56"
IsTwoPass="False"
BufferWindow="00:00:00" />
</Bitrate>
</AacAudioProfile>
</AudioProfile>
</MP4OutputFormat>
</OutputFormat>
</MediaFile>
</Preset>
</Presets>
Here are the changes in my code from above:
Dim configuration1 As String = File.ReadAllText(Server.MapPath("config1.xml"))
Dim task As ITask = job.Tasks.AddNew(preset + " encoding task", _
latestMediaProcessor, configuration1, _
TaskOptions.None)
Note that you can remove the preset field as it is no longer needed.
Related
I like to change the backgroundcolor of a richtexttablecell, I try to solve the problem with lotusscript, but there isn't an method or attribute for this in lotus script.
looks like it is possible to solve this with c api.
can anyone help me?
Use the NotesDXLExporter and NotesDXLImporter:
export the document as DXL,
replace table properties in DXL and
import it back to document.
Make sure that you use notesDXLExporter.RichTextOption=0.
This is an example for a table with background colors in DXL format:
<item name='Body'>
<richtext>
<pardef id='1' />
<par def='1' />
<table widthtype='fixedleft' refwidth='2.1493in'>
<tablecolumn width='1.0667in' />
<tablecolumn width='1.0826in' />
<tablerow>
<tablecell bgcolor='blue'>
<pardef id='3' keepwithnext='true' keeptogether='true' />
<par def='3' />
</tablecell>
<tablecell bgcolor='red'>
<pardef id='4' keepwithnext='true' keeptogether='true' />
<par def='4' />
</tablecell>
</tablerow>
<tablerow>
<tablecell bgcolor='yellow'>
<par def='3' />
</tablecell>
<tablecell>
<par def='4' />
</tablecell>
</tablerow>
</table>
<par def='1' />
</richtext>
</item>
It should be easy to replace the bgcolor properties in DXL.
You can find a code snippet for DXL-export here.
Background color does not appear to be exposed in the LS NotesRichTextStyle or NotesRightTextParagraphStyle classes. The alternate would to use HTML with MIME or the Midas Rich Text LSX from Genii Soft.
i'm using below REST call to encode the video uploaded,
POST https://wamsbayclus001rest-hs.cloudapp.net/api/Jobs HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 3.0;NetFx
Content-Type: application/json
Accept: application/json;odata=verbose
Accept-Charset: UTF-8
Authorization: Bearer http%3a%2f%2fschemas.xmlsoap.org%2fws%2f2005%2f05%2fidentity%2fclaims%2fnameidentifier=amstestaccount001&urn%3aSubscriptionId=z7f09258-2233-4ca2-b1ae-193798e2c9d8&http%3a%2f%2fschemas.microsoft.com%2faccesscontrolservice%2f2010%2f07%2fclaims%2fidentityprovider=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&Audience=urn%3aWindowsAzureMediaServices&ExpiresOn=1421675491&Issuer=https%3a%2f%2fwamsprodglobal001acs.accesscontrol.windows.net%2f&HMACSHA256=9hUudHYnATpi5hN3cvTfgw%2bL4N3tL0fdsRnQnm6ZYIU%3d
x-ms-version: 2.8
Host: wamsbayclus001rest-hs.cloudapp.net
Content-Length: 482
{
"Name":"NewTestJob",
"InputMediaAssets":[
{
"__metadata":{
"uri":"https://wamsbayclus001rest-hs.net/api/Assets('nb%3Acid%3AUUID%3A9bc8ff20-24fb-4fdb-9d7c-b04c7ee573a1')"
}
}
],
"Tasks":[
{
"Configuration":"H264 Adaptive Bitrate MP4 Set 720p",
"MediaProcessorId":"nb:mpid:UUID:1b1da727-93ae-4e46-a8a1-268828765609",
"TaskBody":"<?xml version=\"1.0\" encoding=\"utf-8\"?><taskBody><inputAsset>JobInputAsset(0)</inputAsset>
<outputAsset>JobOutputAsset(0)</outputAsset></taskBody>"
}
]
}
But the built in encode formats of H264 Adaptive Bitrate are - H264 Adaptive Bitrate MP4 Set 720p,H264 Adaptive Bitrate MP4 Set 1080p,H264 Adaptive Bitrate MP4 SD 16*9,H264 Adaptive Bitrate MP4 Set SD 4*3 , these 4 formats encode the uploaded video into various output format, which results in larger encode data and takes more time to complete single encoding task. So i'm trying to encode the uploaded video file to only lower resolution formats, to reduce cost and time. Is there a way to implement it ?
Ok, so this is a little hackish, but hopefully it will give you an idea of what sort of configuration you'll need to provide to your job.
I fired up Azure Media Services Explorer and created an encoding job while running fiddler and using one of the encoding preset xml file provided. This is the body of the POST:
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml">
<id />
<title />
<updated>2015-08-12T20:46:59Z</updated>
<author>
<name />
</author>
<content type="application/xml">
<m:properties>
<d:Configuration>
<?xml version="1.0" encoding="utf-16"?><!--Created for Azure Media Encoder, July 30 2014 -->
<Presets>
<Preset Version="5.0">
<Job />
<MediaFile DeinterlaceMode="AutoPixelAdaptive" ResizeQuality="Super" AudioGainLevel="1" VideoResizeMode="Stretch">
<Metadata MergeCollection="True">
<Item Name="WM/EncodedBy" Value="Azure Media Encoder 4 - H264 Adaptive Bitrate MP4 Set 720p, 07/30/2014 " />
</Metadata>
<OutputFormat>
<MP4OutputFormat StreamCompatibility="Standard">
<VideoProfile>
<MainH264VideoProfile BFrameCount="3" EntropyMode="Cabac" RDOptimizationMode="Speed" HadamardTransform="False" SubBlockMotionSearchMode="Speed" MultiReferenceMotionSearchMode="Balanced" ReferenceBFrames="False" AdaptiveBFrames="False" SceneChangeDetector="False" FastIntraDecisions="False" FastInterDecisions="False" SubPixelMode="Quarter" SliceCount="0" KeyFrameDistance="00:00:02" InLoopFilter="True" MEPartitionLevel="EightByEight" ReferenceFrames="4" SearchRange="64" AutoFit="True" Force16Pixels="False" FrameRate="0" SeparateFilesPerStream="True" SmoothStreaming="False" NumberOfEncoderThreads="0">
<Streams AutoSize="False" FreezeSort="False">
<StreamInfo Size="1280, 720">
<Bitrate>
<ConstantBitrate Bitrate="3400" IsTwoPass="False" BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo Size="960, 540">
<Bitrate>
<ConstantBitrate Bitrate="2250" IsTwoPass="False" BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo Size="960, 540">
<Bitrate>
<ConstantBitrate Bitrate="1500" IsTwoPass="False" BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo Size="640, 360">
<Bitrate>
<ConstantBitrate Bitrate="1000" IsTwoPass="False" BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo Size="640, 360">
<Bitrate>
<ConstantBitrate Bitrate="650" IsTwoPass="False" BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
<StreamInfo Size="320, 180">
<Bitrate>
<ConstantBitrate Bitrate="400" IsTwoPass="False" BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
</Streams>
</MainH264VideoProfile>
</VideoProfile>
<AudioProfile>
<AacAudioProfile Codec="AAC" Channels="2" BitsPerSample="16" SamplesPerSecond="44100">
<Bitrate>
<ConstantBitrate Bitrate="96" IsTwoPass="False" BufferWindow="00:00:00" />
</Bitrate>
</AacAudioProfile>
</AudioProfile>
</MP4OutputFormat>
</OutputFormat>
</MediaFile>
</Preset>
<Preset Version="5.0">
<Job />
<MediaFile AudioGainLevel="1">
<Metadata MergeCollection="True">
<Item Name="WM/EncodedBy" Value="Azure Media Encoder 3 - H264 Adaptive Bitrate MP4 Set 720p, 07/30/2014 " />
</Metadata>
<OutputFormat>
<MP4OutputFormat StreamCompatibility="Standard">
<AudioProfile>
<AacAudioProfile Codec="AAC" Channels="2" BitsPerSample="16" SamplesPerSecond="44100">
<Bitrate>
<ConstantBitrate Bitrate="96" IsTwoPass="False" BufferWindow="00:00:00" />
</Bitrate>
</AacAudioProfile>
</AudioProfile>
</MP4OutputFormat>
</OutputFormat>
</MediaFile>
</Preset>
<Preset Version="5.0">
<Job />
<MediaFile AudioGainLevel="1">
<Metadata MergeCollection="True">
<Item Name="WM/EncodedBy" Value="Azure Media Encoder 3 - H264 Adaptive Bitrate MP4 Set 720p, 07/30/2014 " />
</Metadata>
<OutputFormat>
<MP4OutputFormat StreamCompatibility="Standard">
<AudioProfile>
<AacAudioProfile Codec="AAC" Channels="2" BitsPerSample="16" SamplesPerSecond="44100">
<Bitrate>
<ConstantBitrate Bitrate="56" IsTwoPass="False" BufferWindow="00:00:00" />
</Bitrate>
</AacAudioProfile>
</AudioProfile>
</MP4OutputFormat>
</OutputFormat>
</MediaFile>
</Preset>
</Presets>
</d:Configuration>
<d:EncryptionKeyId m:null="true" />
<d:EncryptionScheme m:null="true" />
<d:EncryptionVersion m:null="true" />
<d:EndTime m:null="true" />
<d:ErrorDetails />
<d:HistoricalEvents />
<d:Id></d:Id>
<d:InitializationVector m:null="true" />
<d:MediaProcessorId>nb:mpid:UUID:1b1da727-93ae-4e46-a8a1-268828765609</d:MediaProcessorId>
<d:Name>AME (adv) Encoding of Jenkins_Under_Two_Min.mp4 with Azure Media Encoder v4.7</d:Name>
<d:Options m:type="Edm.Int32">0</d:Options>
<d:PerfMessage m:null="true" />
<d:Priority m:type="Edm.Int32">0</d:Priority>
<d:Progress m:type="Edm.Double">0</d:Progress>
<d:RunningDuration m:type="Edm.Double">0</d:RunningDuration>
<d:StartTime m:null="true" />
<d:State m:type="Edm.Int32">0</d:State>
<d:TaskBody><?xml version="1.0" encoding="utf-16"?>
<taskBody>
<inputAsset>JobInputAsset(0)</inputAsset>
<outputAsset assetCreationOptions="0" assetName="Jenkins_Under_Two_Min.mp4-AME (adv) encoded" storageAccountName="ianphil">JobOutputAsset(0)</outputAsset>
</taskBody></d:TaskBody>
</m:properties>
</content>
</entry>
The "configuration" section contains the XML from the preset you can find here on GitHub. Hope this will lead you to the exact configuration you need to provide in the POST to create your job.
Im trying to stitch together 2 videos, the lead video being landscape and the second being portrait.
However Azure flips the portrait video sideways automatic. is there a way to stop this behaviour? and have the portrait part have black bars to make up the aspect ratio.
The second video is user generated so i have no control as to what size or orientation it will be.
Update 1:
Pre processing the Portrait video through the media service and then stitching the resulting file seems to work. but that makes it a 2 step operation. is there a faster way or is that the solution?
Update 2:
Yes the ones that are flipped are from smartphones
XML
<?xml version="1.0" encoding="utf-16"?>
<Preset
Version="4.0">
<Job />
<MediaFile
DeinterlaceMode="AutoPixelAdaptive"
ResizeQuality="Super"
NormalizeAudio="True"
AudioGainLevel="1"
VideoResizeMode="Stretch">
<Sources>
<Source>
</Source>
<Source
MediaFile="%1%">
</Source>
</Sources>
<OutputFormat>
<MP4OutputFormat
StreamCompatibility="Standard">
<AudioProfile Condition="SourceContainsAudio">
<AacAudioProfile
Codec="AAC"
Channels="2"
BitsPerSample="16"
SamplesPerSecond="44100">
<Bitrate>
<ConstantBitrate
Bitrate="128"
IsTwoPass="False"
BufferWindow="00:00:00" />
</Bitrate>
</AacAudioProfile>
</AudioProfile>
<VideoProfile Condition="SourceContainsVideo">
<MainH264VideoProfile
BFrameCount="3"
EntropyMode="Cabac"
RDOptimizationMode="Quality"
HadamardTransform="True"
SubBlockMotionSearchMode="Quality"
MultiReferenceMotionSearchMode="Quality"
ReferenceBFrames="False"
AdaptiveBFrames="True"
SceneChangeDetector="True"
FastIntraDecisions="False"
FastInterDecisions="False"
SubPixelMode="Quarter"
SliceCount="0"
KeyFrameDistance="00:00:05"
InLoopFilter="True"
MEPartitionLevel="EightByEight"
ReferenceFrames="4"
SearchRange="128"
AutoFit="True"
Force16Pixels="False"
FrameRate="0"
SeparateFilesPerStream="True"
SmoothStreaming="False"
NumberOfEncoderThreads="0">
<Streams
AutoSize="False">
<StreamInfo
Size="1280, 720">
<Bitrate>
<ConstantBitrate
Bitrate="4500"
IsTwoPass="False"
BufferWindow="00:00:05" />
</Bitrate>
</StreamInfo>
</Streams>
</MainH264VideoProfile>
</VideoProfile>
</MP4OutputFormat>
</OutputFormat>
</MediaFile>
</Preset>
Can you please try updating your preset as follows:
<?xml version="1.0" encoding="utf-16"?>
<Presets Rotation="Auto">
<Preset
Version="5.0">
...
</Preset>
</Presets>
Having a GridPane with 2 rows and 2 columns, setting the row constraints to 50 percent height results in unwanted behaviour.
Code:
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="..." stylesheets="#general.css" prefWidth="800" prefHeight="600">
<top>
<VBox>
<!-- ... -->
</VBox>
</top>
<bottom>
<HBox>
<!-- ... -->
</HBox>
</bottom>
<center>
<GridPane >
<children>
<ScrollPane fx:id="tilePane" GridPane.columnIndex="0" GridPane.rowIndex="0">
<content>
</content>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</ScrollPane>
<TreeView fx:id="listPane" GridPane.columnIndex="0" GridPane.rowIndex="1">
<root>
<TreeItem value="Stages" />
</root>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</TreeView>
<ScrollPane fx:id="mapPane" GridPane.columnIndex="1" GridPane.rowIndex="0" GridPane.rowSpan="2">
<content>
</content>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</ScrollPane>
</children>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" percentWidth="25"/>
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="ALWAYS" percentHeight="50" />
<RowConstraints vgrow="ALWAYS" percentHeight="50" />
</rowConstraints>
</GridPane>
</center>
</BorderPane>
(mentioned attribute at the bottom)
I expected that the two rows would share their available height at a 50% rate. They do this, but they also consume a lot more space than needed.
Picture of the result with, and without percentHeight specified:
Do I understand percentHeight wrong, or is there another approach?
I was able to use the XML as external meta-data by following the article here. However, Moxy is marshalling the properties that are neither annotated nor specified in the external XML meta-data. Below is the e.g. How to avoid this behavior? I tried using xml-mapping-metadata-complete="true" but it didn't help.
Class with new prefix property added (removed other properties for brevity)
public class Customer
{
private String prefix;
public void setPrefix(String prefix)
{
this.prefix = prefix;
}
public String getPrefix()
{
return prefix;
}
}
meta-data xml
<xml-bindings xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/oxm" package-name="blog.bindingfile">
<xml-schema namespace="http://www.example.com/customer" element-form-default="QUALIFIED" />
<java-types>
<java-type name="Customer">
<xml-root-element />
<xml-type prop-order="firstName lastName address phoneNumbers" />
<java-attributes>
<xml-element java-attribute="firstName" name="first-name" />
<xml-element java-attribute="lastName" name="last-name" />
<xml-element java-attribute="phoneNumbers" name="phone-number" />
</java-attributes>
</java-type>
<java-type name="PhoneNumber">
<java-attributes>
<xml-attribute java-attribute="type" />
<xml-value java-attribute="number" />
</java-attributes>
</java-type>
</java-types>
</xml-bindings>
output
<customer xmlns="http://www.example.com/customer">
<first-name>Jane</first-name>
<last-name>Doe</last-name>
<address>
<street>123 A Street</street>
</address>
<phone-number type="work">555-1111</phone-number>
<phone-number type="cell">555-2222</phone-number>
<prefix>pre</prefix>
</customer>
To omit the prefix property from your marshalled XML, you should declare it as transient in your bindings file:
...
<java-type name="Customer">
<xml-root-element />
<xml-type prop-order="firstName lastName address phoneNumbers" />
<java-attributes>
<xml-element java-attribute="firstName" name="first-name" />
<xml-element java-attribute="lastName" name="last-name" />
<xml-element java-attribute="phoneNumbers" name="phone-number" />
<xml-transient java-attribute="prefix" />
</java-attributes>
</java-type>
...
By default, JAXB will map any public fields, so since there was no explicit "annotation" on the prefix field, it is mapped in the default way.
xml-mapping-metadata-complete="true" means "Ignore any annotations found in the Java class and use this bindings file as the sole source of mapping information -- do not augment any existing annotations."
Hope this helps,
Rick