Is there a built in way to prevent AME from encoding an output size from the config file if the source video is smaller than the target, or is it necessary to have a bunch of presets with each one having the maximum res then I query the media file myself to determine which preset to use?
This is what I have so far and want to include a 1080 version but don't want 720 or lower source files to generate a 1080 size:
{
"KeyFrameInterval": "00:00:02",
"H264Layers": [
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 2250,
"MaxBitrate": 3400,
"BufferWindow": "00:00:05",
"Width": 1280,
"Height": 720,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
},
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 1500,
"MaxBitrate": 2250,
"BufferWindow": "00:00:05",
"Width": 960,
"Height": 540,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
},
{
"Profile": "Auto",
"Level": "auto",
"Bitrate": 650,
"MaxBitrate": 1000,
"BufferWindow": "00:00:05",
"Width": 640,
"Height": 360,
"BFrames": 3,
"ReferenceFrames": 3,
"AdaptiveBFrame": true,
"Type": "H264Layer",
"FrameRate": "0/1"
}
],
"Type": "H264Video"
},
did you look into tutorials of using Media Encoder Premium Workflow encoder with Azure Media Services Workflow Designer ( https://azure.microsoft.com/en-us/documentation/articles/media-services-workflow-designer/).
There is one example of workflow which detects input resolution - https://github.com/Azure/azure-media-services-samples/tree/master/Encoding%20Presets/VoD/MediaEncoderPremiumWorkfows. (H264 Progressive Download MP4 SD). From one of example description "If source is SD (image width is less than 640), then the frame size of the output is left unchanged. Otherwise, if source is HD (image width is 640 or greater), output frame size is set to 640x360 (16:9 sources) or 640x480 (4:3 sources)."
You need to request workflow designer tool and change described logic if needed - its is hard to construct these workflow files manually.
If you want to use only Media Encoder Standard, than you need to use sdk to construct input detection logic on your side and schedule or skip encoding based on input resolution.
Related
According the imgur website:
When you upload a post to Imgur, you have two post privacy options: Hidden and Public.
A hidden post means that your post is not shared with the general Imgur community and can only be accessed via the URL. Hidden posts cannot be searched,...
Using only my client id (no OAuth), I hit the gallery search endpoint using the tag '#wow' (ie GET https://api.imgur.com/3/gallery/t/wow/). I get the same results as when visiting this publicly accessible page: https://imgur.com/t/wow.
Viewing the metadata for these images that I get from my api request, almost all (56 / 60) have a privacy value of "hidden"
Could be concerning, though wondered if an imgur expert could explain this before I try contact imgur about it.
Portion of the API json response:
{"data":
{"name": "wow",
"display_name": "wow",
"followers": 29719,
"total_items": 17077,
"following": false,
"is_whitelisted": true,
"background_hash": "QL9pTeJ",
"thumbnail_hash": nil,
"accent": "159559",
"background_is_animated": false,
"thumbnail_is_animated": false,
"is_promoted": false,
"description": "",
"logo_hash": nil,
"logo_destination_url": nil,
"description_annotations": {},
"items":
[{"id": "yWPI5rf",
"title": "Lake basement.",
"description": nil,
"datetime": 1656844974,
"cover": "IrUShgg",
"cover_width": 720,
"cover_height": 960,
"account_url": "DacianFalx",
"account_id": 64529075,
"privacy": "hidden", // 56 / 60 items have the same privacy value
"layout": "blog",
"views": 50557,
"link": "https://imgur.com/a/yWPI5rf",
"ups": 481,
"downs": 6,
"points": 475,
"score": 499,
"is_album": true,
"vote": nil,
"favorite": false,
"nsfw": false,
"section": "",
"comment_count": 116,
"favorite_count": 40,
"topic": nil,
"topic_id": nil,
"images_count": 1,
"in_gallery": true,
"is_ad": false,
"tags":
[{"name": "wow",
"display_name": "wow",
"followers": 29719,
"total_items": 17076,
"following": false,
"is_whitelisted": false,
"background_hash": "QL9pTeJ",
...omitted...
This is the list{'id': 142840, 'posters': [{'aspect_ratio': 0.703125, 'file_path': '/4EFI8IdI7LOm9Q0BTT2FAdPwdeq.jpg', 'height': 2048, 'iso_639_1': 'en', 'vote_average': 5.312, 'vote_count': 1, 'width': 1440}, {'aspect_ratio': 0.70703125, 'file_path': '/2Lgb7oPgqVpJmruRoH7Rs2yJH0n.jpg', 'height': 2048, 'iso_639_1': 'en', 'vote_average': 5.172, 'vote_count': 1, 'width': 1448}, {'aspect_ratio': 0.7068881289692233, 'file_path': '/6mLaG60xEQm6mw0Ga8TDFZsk0R1.jpg', 'height': 2047, 'iso_639_1': None, 'vote_average': 0.0, 'vote_count': 0, 'width': 1447}]}
I am trying to pick the value of file_path if height>width
It often helps to format a complex data structure to better see how the pieces relate. In this case it shows that the information you care about (height, width, and file_path) can all be found in the dictionaries inside the posters list which is inside a dict we can call poster_dict. With that information we can construct a list of file_paths that meet the specified height and width relationship.
Example:
poster_dict = {
"id": 142840,
"posters": [
{
"aspect_ratio": 0.703125,
"file_path": "/4EFI8IdI7LOm9Q0BTT2FAdPwdeq.jpg",
"height": 2048,
"iso_639_1": "en",
"vote_average": 5.312,
"vote_count": 1,
"width": 1440,
},
{
"aspect_ratio": 0.70703125,
"file_path": "/2Lgb7oPgqVpJmruRoH7Rs2yJH0n.jpg",
"height": 2048,
"iso_639_1": "en",
"vote_average": 5.172,
"vote_count": 1,
"width": 1448,
},
{
"aspect_ratio": 0.7068881289692233,
"file_path": "/6mLaG60xEQm6mw0Ga8TDFZsk0R1.jpg",
"height": 2047,
"iso_639_1": None,
"vote_average": 0.0,
"vote_count": 0,
"width": 1447,
},
],
}
file_path_list = [
one_poster["file_path"]
for one_poster in poster_dict["posters"]
if one_poster["height"] > one_poster["width"]
]
print(file_path_list)
Output:
['/4EFI8IdI7LOm9Q0BTT2FAdPwdeq.jpg', '/2Lgb7oPgqVpJmruRoH7Rs2yJH0n.jpg', '/6mLaG60xEQm6mw0Ga8TDFZsk0R1.jpg']
As the height and width are only in the last dictionary, you can write the code as shown below :
if d['posters'][2]['height'] > d['posters'][2]['width'] :
return d['posters'][2]['file_path']
In case 'height' and 'width' are not in last dictionary, change the value of '[2]'
Hope it's helpful for you. ;-)
When generating a pdf(and also in the website), columns are getting cut-off. This is possible to fix with css in the website but not in PDF.
Is there any solution to this problem?
book.json file update paperSize is a3
"pdf": {
"pageNumbers": true,
"fontSize": 12,
"paperSize": "a3",
"margin": {
"right": 62,
"left": 62,
"top": 36,
"bottom": 36
},
"headerTemplate": null,
"footerTemplate": null
}
The content is on stdout
I'm trying to get the result of this package using Nodejs. I have been trying to use spawn, exec and log the child_process object to debug it but cannot see the value on stdout, even though the stderr data is ok.
when I direct terminal output, I'm able to log the stderr, but stdout is just empty if I log it to file, but it does show up in the terminal.
Then I tried using just the tool to check result then thought it's the tool problem, not the Nodejs code.
EDIT: Adding terminal content in text
Macbooks-MacBook-Pro:query macos$ lola --formula="EF DEADLOCK" input.lola --quiet --json
{"analysis": {"formula": {"parsed": "EF (DEADLOCK)", "parsed_size": 13, "type": "deadlock"}, "result": true, "stats": {"edges": 3, "states": 4}}, "call": {"architecture": 64, "assertions": false, "build_system": "x86_64-apple-darwin17.7.0", "error": null, "hostname": "Macbooks-MacBook-Pro.local", "optimizations": true, "package_version": "2.0", "parameters": ["--formula=EF DEADLOCK", "input.lola", "--quiet", "--json"], "signal": null, "svn_version": "Unversioned directory"}, "files": {"net": {"filename": "input.lola"}}, "limits": {"markings": null, "time": null}, "net": {"conflict_sets": 6, "filename": "input.lola", "places": 8, "places_significant": 6, "transitions": 7}, "store": {"bucketing": 16, "encoder": "bit-perfect", "threads": 1, "type": "prefix"}}
Macbooks-MacBook-Pro:query macos$ lola --formula="EF DEADLOCK" input.lola --quiet --json 2> aaa.txt
{"analysis": {"formula": {"parsed": "EF (DEADLOCK)", "parsed_size": 13, "type": "deadlock"}, "result": true, "stats": {"edges": 3, "states": 4}}, "call": {"architecture": 64, "assertions": false, "build_system": "x86_64-apple-darwin17.7.0", "error": null, "hostname": "Macbooks-MacBook-Pro.local", "optimizations": true, "package_version": "2.0", "parameters": ["--formula=EF DEADLOCK", "input.lola", "--quiet", "--json"], "signal": null, "svn_version": "Unversioned directory"}, "files": {"net": {"filename": "input.lola"}}, "limits": {"markings": null, "time": null}, "net": {"conflict_sets": 6, "filename": "input.lola", "places": 8, "places_significant": 6, "transitions": 7}, "store": {"bucketing": 16, "encoder": "bit-perfect", "threads": 1, "type": "prefix"}}
Macbooks-MacBook-Pro:query macos$
It sounds to me like the issue isn't really nodejs related. I did some quick googling on this Lola tool, and it looks like it might have some custom stdout/stderr, so it is possible for it to behave differently when used regularly from the terminal than when you specify redirects for the stdout and stderr.
One possible fix for you would be to use the --json option and specify a temporary filename, then have your nodejs code read the result from the temporary file created. (If you can't figure out the stdout/stderr issue.)
I noticed that in the Instagram API when you get an image back, it looks something like this:
http://distilleryimage6.s3.amazonaws.com/a0efb5b418b711e391bd22000a1fbf1d_7.jpg
And by changing the _7 to say _5 or _6 you can get different sizes. But I have also noticed that some of the other sizes are NOT always available. Does anyone have info on what sizes are available or can you point me to a resource in the Instagram API that goes into more detail on image sizes supported via the API? Thanks.
The Instagram API should always return images in three sizes. All of which are square with side length of 150px, 306px and 612px. Videos are available at 480px square and 640px square resolutions.
"images": {
"low_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_6.jpg",
"width": 306,
"height": 306
},
"thumbnail": {
"url": "http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_5.jpg",
"width": 150,
"height": 150
},
"standard_resolution": {
"url": "http://distillery.s3.amazonaws.com/media/2010/07/16/4de37e03aa4b4372843a7eb33fa41cad_7.jpg",
"width": 612,
"height": 612
}
},