h264_qsv leads to memory leak - mlt

I use h264_qsv encoder to export a video.
The mlt xml :
<consumer mlt_service="avformat" target="10.mp4" strict="experimental" vn="0" vcodec="h264_qsv" width="1920" height="800" frame_rate_num="50.000000" frame_rate_den="1" vb="8000k" cbr="1" vbufsize="12288000" minrate="8000k" maxrate="8000k" acodec="aac" channels="1" ar="44100" ab="192k" preset="fast" profile="main" level="3.0" bf="0" thread="0" real_time="-1" sc_threshold="0" g="125" f="mp4" preview_off="1"/>
Ive tried multiple variations of this, but none of them seem to work. Any ideas?
Thanks in advance.

Related

mlt: image distortion using lossless codec

I have two 1920x1080 PNG files, center.png and right.png, which are identical except that the image in right.png is shifted horizontally by 325 pixels.
With mlt XML, I made a two-second long video using the lossless FFV1 format, showing one second of center.png, and then one second of right.png. Here's my file, foo.mlt:
<?xml version='1.0' encoding='utf-8'?>
<mlt>
<profile width="1920" height="1080"
display_aspect_num="1920" display_aspect_den="1080"
sample_aspect_num="1" sample_aspect_den="1"
colorspace="709" progressive="1"
frame_rate_num="30" frame_rate_den="1"/>
<consumer mlt_service="avformat" properties="lossless/FFV1" target="out.mkv"/>
<producer id="center" mlt_service="qimage" resource="center.png" length="30"/>
<producer id="right" mlt_service="qimage" resource="right.png" length="30"/>
<playlist>
<entry producer="center"/>
<entry producer="right"/>
</playlist>
</mlt>
Then I run melt foo.mlt at the terminal and check the output file out.mkv in my video viewer. However, on close inspection, when right.png appears in the video, it is slightly distorted (with some sort of halo-type artifact). Here is a magnified view:
Weirdly, only the right.png image is distorted; the center.png displays correctly, even though the two images are identical except for positioning.
Is this a bug? I wouldn't expect any image distortion with a lossless codec, but maybe I've done something wrong.
My specs:
Ubuntu 20.04.2 LTS, 64-bit
melt 6.25.0
ffmpeg version 4.2.4-1ubuntu0.1
Thanks
"Lossless" is not always lossless. In the case of "lossless/FFV1", the chroma format is 4:2:2 which will cut the chroma resolution in half:
https://github.com/mltframework/mlt/blob/master/presets/consumer/avformat/lossless/FFV1
This could be relevant because if format conversion is required, it could cause chroma bleeding on pixels that do not land directly on a chroma sample.
As an experiment, you could try shifting the image by 326 pixels instead of 325 to see if the bleeding still occurs.
There was another question a while back that related to bleeding due to chroma subsampling:
Melt composite transition is slightly blending

While importing product XML in demandware how to append images in same product?

I have two product XML look like:
1:- product-1.xml
.
.
.
.
<images merge-mode="add">
<image-group view-type="large">
<image path="product-123.jpg" />
</image-group>
</images>
.
.
2:- product-1-1.xml
.
.
.
.
<images merge-mode="add">
<image-group view-type="large">
<image path="product-124.jpg" />
<image path="product-125.jpg" />
</image-group>
</images>
.
.
I am importing both the files and I want to append the images for the same product (PRODUCT123) as
<images merge-mode="add">
<image-group view-type="large">
<image path="product-123.jpg" />
<image path="product-124.jpg" />
<image path="product-125.jpg" />
</image-group>
</images>
but it's not appending the images.
I used merge-mode="merge" also for the same but not getting the result as I expected.
Could anyone help me out that where I am doing wrong?
Sadly, what you want to achieve is currently not supported by the Salesforce B2C Commerce platform.
You cannot split the images of an image group into several files and expect that they will be merged.
Indeed, the file import mode should be MERGE, but what you have tried as element merge-mode="add" is not supported, and you should have received a warning when you have imported the file.
If you look at catalog.xsd schema from the documentation you would see the following under complexType.Product.Images type definition:
<xsd:attribute name="merge-mode" type="simpleType.MergeMode" default="merge" use="optional">
<xsd:annotation>
<xsd:documentation>
Used to control if specified image groups will be merged to or replace the existing image specification.
The values "merge" and "replace" are the only ones supported for the "merge-mode" attribute.
Attribute should only be used in import MERGE and UPDATE modes. In import REPLACE mode, using the "merge-mode" attribute is not
sensible, because existing image groups will always be removed before importing the image groups
specified in the import file.
</xsd:documentation>
</xsd:annotation>
</xsd:attribute>
P.S. I would suggest that you look for an alternative solution for merging the data about images before sending it to Salesforce B2C Commerce instance.
Are you using ImportCatalog pipelet? Please check job configuration, import mode should be MERGE.

Why does my kml description balloon have no tail when displayed online on Google Earth?

I am a kml "newbie" trying to attach a balloon to a placemark.
The default behavior of a balloon associated with a placemark is to display text in a box with a tail pointing to the placemark's location after you click on the placemark. I import my kml files into Google Earth online to test. My balloons appear when I click on the placemarks, but I never get the "tail". Instead, the balloons appear in the upper left corner of the screen.
I've been reading about BallonStyle in the kml reference doc:
https://developers.google.com/kml/documentation/kmlreference
I have copied and loaded examples from: https://developers.google.com/kml/documentation/extendeddata
among other places, and the tail never appears.
I wrote this simple kml file that I think SHOULD use the default balloon behavior, but doesn't. The placemark has valid coordinates. What am I missing?
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Style id="Piper">
<IconStyle>
<color>ff0000ff</color>
</IconStyle>
<BalloonStyle>
<text>$[description]</text>
</BalloonStyle>
</Style>
<Placemark>
<name>Piper 2018-08-01T16:45:16</name>
<description>Accuracy = 10m</description>
<styleUrl>#Piper</styleUrl>
<Timestamp>
<when>2018-08-01T16:45:16</when>
</Timestamp>
<Point>
<coordinates>-110.766531000,43.851320000</coordinates>
</Point>
</Placemark>
</Document>
</kml>
Thanks for any insights.

how to use file protocol open my documents

popToastControl.Payload =
$#"
<toast activationType='protocol' launch='file:///C|/My Documents/'>
<visual>
<binding template='ToastGeneric'>
<text>Click to launch Bing Maps</text>
<text>Searches for ""1 Microsoft Way, 98052""</text>
</binding>
</visual>
</toast>";
I cannot open my documents through file protocol(file:///...)
I tried like this: file:///%USERPROFILE%\My Documents
=>did not work
nor did this way: file:///%My Documents%
it only worked as this way :file:///C:\Users\Michael-DEV\Documents
Please get me off this trouble, much thanks!

Issues reading a multiline field in mini-XML 2.7

I am using C with mini-XML 2.7, and reading a XML doc. All is fine, except that my XML has a section that looks like this:
<layer name="pattern1" width="100" height="40">
<data encoding="csv">
970,970,970,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,
1089,0,4,765,21,
0,1089,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
My code parses all the XML down here flawlessly. Then I attempt to read the CSV values, by using this:
s = mxmlGetText(node, &has_space);
But right after that, a printf() statement like this
printf("s='%s'", s);
Shows only the first line.
970,970,970,0,0,0,0,0,0,0,
I would like to read the lines below the first line, but tried to use mxmlGetText() again with no luck. And all the lines are shown by using mxmlSaveFile().
How can I get all the lines? thanks in advance.
I found a solution for this issue.
1.-Loaded the XML file using MXML_OPAQUE_CALLBACK instead MXML_TEXT_CALLBACK in the call to mxmlLoadFile().
2.-Used mxmlGetOpaque() instead mxmlGetText().
Now my code works flawlessly.

Resources