Can we segment more than one movie file using mediafilesegmenter tool - HTTP Live Streaming - iphone

Is there any way to achieve segmenting from more than one movie file using mediafilesegmenter. I want to create one prog_index.m3u8 file from multiple movie files.
If mediafilesegmenter doesn't support, can anyone suggest alternate approach to achieve this.
Thanks in advance to all the viewers who takes time to look into this query .
Thanks
Sudheer

I couldn't find any help for segmenting more than one video file using mediafielsegmenter but found a solution to my issue.
As we know that mediafilesegmenter tool will generate a prog_index.m3u8 file by default after segmenting the movie file, here I'm creating a new index file with contents appended from prog_index.m3u8 and updating the new index file when a new movie file is segmented. This has solved my issue.

MediaFileSegmenter is not meant for combining more than one files. It's used for segmenting video files.
If you want to combine multiple files you can use ffmpeg. It's a very simple and efficient tool for performing various operations on video files.
From ffmpeg documentation,
Create a file mylist.txt with all the files you want to have concatenated in the following form:
file '/path/to/file1'
file '/path/to/file2'
file '/path/to/file3'
Note that these can be either relative or absolute paths. Then you can stream copy or re-encode your files:
ffmpeg -f concat -safe 0 -i mylist.txt -c copy output
The -safe 0 above is not required if the paths are relative.
you can find more on concatenation here.
Once you have combined the files. Segment them using mediafilesegmenter, you don't need to manually append index files within prog_index.m3u8.

Related

Convert a folder containing asciidocs and pictures to pdf

I would like to convert this book Mastering the Lightning Network, which is freely available through GitHub to a pdf for personal use.
Unfortunately, I have only figured out how to "translate" single files using asciidoc or asciidoctor-pdf. The options for folders don't seem to work with the configuration of the repository.
There has to be an easy way to translate everything, including all files and pictures. Would be very thankful if somebody could help me out.
As far as I know it is not possible to convert a folder containing AsciiDoc files to a pdf, a simple script could do it but the problem would be in what order do you want your files to be converted?
The simplest solution for you is to create your own content.adoc file and use the include macro to select what files you want to convert and in what order, it could look something like this:
= Mastering the Lightning Network
include::01_introduction.asciidoc[]
include::02_getting_started.asciidoc[]
include::03_how_ln_works.asciidoc[]
include::04_node_client.asciidoc[]
include::05_node_operations.asciidoc[]
include::06_lightning_architecture.asciidoc[]
include::07_payment_channels.asciidoc[]
include::08_routing_htlcs.asciidoc[]
include::09_channel_operation.asciidoc[]
include::10_onion_routing.asciidoc[]
include::11_gossip_channel_graph.asciidoc[]
include::12_path_finding.asciidoc[]
include::13_wire_protocol.asciidoc[]
include::14_encrypted_transport.asciidoc[]
include::15_payment_requests.asciidoc[]
include::16_security_privacy_ln.asciidoc[]
include::17_conclusion.asciidoc[]
and you convert using asciidoctor-pdf content.adoc
You could try using imagemagick:
magick *.jpg out.pdf

merging PDFs with Ghostscipt ignoring outline and using pdfmark instead

I am using a Batch script to merge different PDFs in one complete file.
%gsc% -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=letter -dEPSFitPage -o %dsk%%zus%%ext% %mfd% %pth%tmp\pdfmarks
%dsk%%zus%%ext%: Path and name of final (complete) document
%mfd%: Path and name of docs to be merged (c:\test\1.pdf c:\test\2.pdf ...)
%pth%tmp = path to the pdfmarks file
Additionally, I am creating a pdfmark document inside the script which gs uses to create the bookmarks. But unfortunately, some of the docs I am merging, have already their own bookmarks and I did not yet find a solution how to ignore those. GS should only use the bookmarks inside the pdfmarks file.
How can this be done?
Firstly; you are not 'merging' PDF files when you use Ghotscript's pdfwrite device. The process is described in detail here
The important point is that the way the input file(s) are constructed has no bearing on the way the output file is constructed. If any other software you use relies on the file being constructed in a particular fashion it may not work on the output PDF file.
The -dEPSFitPage switch only has any effect when the input is an EPS file. If you want to 'fit' PostScript or PDF files then you need to use -dPDFFitPage, -dPSFitPage or just -dFitPage. However, all of these rely on you first selecting a media size, and then preventing it being altered by setting -dFIXEDMEDIA. For EPS files you would more normally use -dEPSCrop which sets the media size to the EPS declared BoundingBox.
You can prevent the PDF interpreter reading the Outlines tree (which you are calling Bookmarks) and then creating a pdfmark from it to pass to the pdfwrite device by using the -dNO_PDFMARK_OUTLINES switch which oddly isn't documented, presumably an oversight.

copy pairs of files with same filename and different file extension

So I'm trying to copy files for statements so there is a pdf and an xml file with the same name and different file extensions. I need to copy lets say 1000 files at a time so that would be 500 pairs of pdf and xml files. I'm trying setup a batch file to do this, but I'm not sure how to get it to check the filenames to get the pair to copy at the same time. The reason I need the pair is because if just one or the other is there it will bomb out and not process. Any help is greatly appreciated.
Thanks,
Corey

Getting a list of all files inside a zip/rar/7z file with Scala

Is there a way to get a list of all the files inside a compressed file without decompressing it?
I don't mind using a Java library but all the solutions I found performed a decompression.
Also, if it is relevant, I know that the compressed file has sub directories in it and I want to also get the files from them.

Grouping two files into one custom file-type

I am currently working on a simple tower defense game for iOS (using objective-c), which contains several maps/levels. However, as it is now, each map consists of an image file and a .plist file with information. My question is: is there any way I could create a custom file type (for example, *.map) that contains both the image and the information from the plist?
If this is possible, how do I implement this?
Thanks in advance!
You have several good choices for that:
The simplest solution would be grouping the related files in subfolders: rather than having xyz.map file, you could have an xyz sub-folder, and reference the files out of it. You would not need to use any additional libraries for this, and you would be able to use the same name for all your image files and all your level files, because they would be in separate folders.
You can make a zip archive with the files that you would like to combine, and unzip it before use. Here is a link to an answer referencing a library to do it.
You can use a tar format - here is a list to an answer referencing a library that supports it. You would be able to use tar utility on OS-X to group images with plists on your workstation.
Finally, you can define a format of your own: store the length of the first file in the first four bytes, then store the content of the first file, and then the second. You would need to write a utility for combining the two files into one. This sounds like the hardest choice to implement.