How to create MPEG Dash (mpd) file in code level.I couldn't found a way to do this.
It's better to have a node js sample.
I can do it in command line. I used MP4Box tool
But I need to do it in my node js application.
I am guessing you probably want to create a DASH stream rather than just a manifest file - the manifest file would not be of interest generally without the media streams it indexes to.
This is actually not trivial, especially as there are so many options within the DASH spec and different formats possible within the manifest - e.g. segment timeline, template etc.
It is probably easiest to look at an openesource example of a packager to get a feel for what is involved - you may even find you can just use one as is. One of the most popular is Shaka Packager:
https://github.com/google/shaka-packager
The documentation for the Shaka Packager includes the following architecture diagrams which may give you a feel for how the manifest creation is tied into the overall packaging work:
Related
I'm encoding a video file using the built-in adaptive streaming transform. Once the file is successfully processed, an asset container is created with the below files:
Is it possible to provide custom file names at the time a job is created? It seems that the default behavior is to take a certain number of characters from the original file name and prepend them in the above file names. If possible, I'd like to configure this behavior.
P.S. I'm using the .NET SDK.
You can create a custom transform to output file names differently. On https://learn.microsoft.com/en-us/rest/api/media/transforms/createorupdate#definitions search for the Mp4Format section. In that you can specify the filenamePattern with certain macros like {Bitrate} and {Codec}.
See https://learn.microsoft.com/en-us/azure/media-services/latest/custom-preset-cli-howto for an example custom transform and the process by which to create it in Media Services.
I use the macros on my jobs, they work ok. I have a process that takes 3 videos (an intro section, the actual content, and the outro section) and encodes them as one single video. The issue I have with the macros is that it uses the file name of the first video in the inputs. So it ends up using the file name of the intro video which is a generic name. They need to have a way where we can have a little more control.
I suppose I could copy/rename the intro video to a desired name before I encode and it would pick it up, but that seems to be a little bit of overkill.
The Macros are good, but they could use some enhancements I think.
As the title above. Now I am making an electron app that has function is show content of a docx file which includes words and images.
Do anyone know a nodejs library to do that?
I've had this question a few times (so would love to hear what you end up using).
We've used Textract (https://www.npmjs.com/package/textract) (NB. there is a Python package, and an AWS service, with the same name; which are both unrelated.) It is just getting the plain text out. It has struggled with some formats, especially PDF. If you also want images and formatting, this is not really what you want.
A quick Google found this list:
https://libraries.io/search?keywords=docx&languages=JavaScript
Mammoth (https://github.com/mwilliamson/mammoth.js) is actively developed. Take note of the limitations it describes. However the fact that it produces HTML will make your display in an Electron app much easier.
LibreOffice-convert (https://github.com/elwerene/libreoffice-convert) is new to me since I last searched. Leveraging LibreOffice sounds like an intelligent thing to do. It is just a simple wrapper around the headless mode of LibreOffice. The dependencies make it less than ideal for an Electron app.
Along the same lines, you could try a wrapper for pandoc (https://github.com/eshinn/node-pandoc)
JUL 2021
If you only want to work with DOCX or plain text you can use textract-lite
More document types (10+) available in textract
yarn add #nosferatu500/textract
https://github.com/nosferatu500/textract
yarn add #nosferatu500/textract-lite
https://github.com/nosferatu500/textract-lite
Note:
I forked and updated deps when various CVE was found. I also cut out all the functionality for the light version and left only support for docx and txt
I'm building a project where people can upload files, I would like to then display those files in a browser where people can interact with them (vote, comment etc)
However, this means I need to programatically build the html depending on the format of the video or image. Is there a way to feed a file (or filename) into a library, and determine whether I need to display it in a video element or an image element? Even a list of video formats vs image formats would help but I haven't seen anything in regards to that.
No module can reliably determine the file type. The user could either change the extension or even the magic number of the file to obfuscate it. The only reliable way it to try to pass file to some image / video transcoder to let it decide or error out if the format is invalid. This way you know you are working with known formats since all files are transcoded to your specific extensions. That could be mp4 or png. I recommend using handbrake for videos and sharp for images. Leaving the NPM links down below:
https://www.npmjs.com/package/handbrake-js
https://www.npmjs.com/package/sharp
Stuck in this weird situation at work. I have .doc files I'm parsing with Node.JS. They have photos in them that are .emf I want to display in my web app. I have no issue getting the emf file out of the word doc, but I can't figure out how to display it on a webpage. Simply embedding as is didn't work. I tried to find a utility to convert them automatically but with no luck. I thought of converting them myself but can't find any tecnhical info on the .emf file.
Any suggestions?
EMF (WMF) are the SVG like formats of the 1990's.
I can't give you the full solution in this space but checkout this thread that uses Apache Batik
If you don't want to build it yourself perhaps try the paid version of converters
If you can't afford I would recommend to host the Batik and make a service endpoint and make calls to generate the desired format from EMF. It may turn out actually faster.
I would like to write a command line program using Java that take in KML/Shapfile and output GeoJSON file.
What I usually did is go over ogre2ogre and manually convert my file.
Once I got the GeoJson I modified the content of it a little bit before output final GeoJSON.
I would like to skip the manual part and find some API that do the conversion for me.
Anyone could help please.
Thanks
OSMBonusPack provides a KML+GeoJSON toolkit, with both a KML parser/writer and a GeoJSON parser/writer, all in Java.
So this allows to read KML content, and write it as GeoJSON.
You can test this conversion using the demo app OSMNavigator.
It is targeting Android, so for your need you would have to pick the relevant classes, and remove code sections you don't need (icon loading, overlay building, Parcelable implementation, for instance).