Blah, typos. Should be:
smelt video1.mpg melt:s5.melt video2.mpg melt:s5.melt
(Assuming smelt is copied to a place in the path. Otherwise, launch it
with ./smelt or /full/path/to/smelt)
K I go do something else and leave you guys alone for a bit :D
~Jesse
On 10/02/2016 07:30 PM, Jesse Gordon wrote:
Tomas,
I wasn't even thinking earlier - I totally forgot that you wanted the
command line to match melt.
But now I have updated the smelt perl script so that its command line
parameters are just melt commands.
It simply passes stuff on to melt, *unless* it gets a melt:filename,
then the perl script itself reads the filename, and inserts its
contents, recursively, which means a file can also have a
melt:filename line and so on and so forth, up to about 1024 deep
(which is way more than anyone will need.)
So you could have a file called crossfade.melt, which would contain
-mix 25 -mixer luma
then you could just do:
smelt video1.mpg in=50 out=500 video2.mpg in=50 out=500
melt:crossfade.melt
If you just wanted to show the second 5 seconds of each source video,
you could have a file called s5.melt (for Second Five), like this:
in=00:00:05:00 out=00:00:10:00
then you could do:
*smelt video1.mpg smelt:s5.melt video2.mpg s5.melt (Wrong)*
and so on and so forth.
The file extensions are purely arbitrary and optional.
~Jesse
On 10/02/2016 06:36 PM, Jesse Gordon wrote:
Tomas,
I've cc'd you directly in case the mailing list strips attachments,
because I've attached a simple perl script that does as you desire. I
named it smelt. You can rename it as you like.
On 10/02/2016 02:29 PM, Tomas Hlavaty wrote:
It would be nicer, if I could create a file:
example.melt:
-profile atsc_720p_25
color:black out=24
pic1.png out=115
-mix 25 -mixer luma
vid1.mp4 in=5260 out=6775
-mix 25 -mixer luma
vid2.mp4 in=7538 out=10210
-mix 50 -mixer luma -mixer mix:-1
-consumer avformat:output.mp4 f=mp4 acodec=aac vcodec=mpeg4 b=6000k
and call it:
$ melt melt:example.melt
That part practically already works. If you have a file:
example.melt:
color:red out=50
color:green out=50
-mix 10 -mixer luma
#color:blue out=50
# -mix 10 -mixer luma
color:white out=50
-mix 10 -mixer luma
color:black out 50
-mix 10 -mixer luma
Just launch it like this:
melt `cat example.melt`
It works fine, except it is not recursive so you can't include stuff.
with the ability to comment out things in the melt file and include
other melt files, something like:
example.melt:
-profile atsc_720p_25
color:black out=24
pic1.png out=115
-mix 25 -mixer luma
vid1.mp4 in=5260 out=6775
-mix 25 -mixer luma
#vid2.mp4 in=7538 out=10210
# -mix 50 -mixer luma -mixer mix:-1
melt:example2.melt
-consumer avformat:output.mp4 f=mp4 acodec=aac vcodec=mpeg4 b=6000k
Then cli melt would be almost perfect:-)
I have attached a perl script I threw together which should exactly
match your description above.
It supports any number of command line arguments, a file to each, and
it supports like a thousand depth of recursive includes, (whatever
perl supports for recursively called functions and simultaneously
open files. )
The multiple file argument would allow you to have your main
composition exclude the final target (i.e. -consumer avformat.....)
Then you could have different files that defined the consumers, so
you could easily change rendering target for a given composition by
just specifying a different render target filename on the command line.
so you could do like this:
#To just play to the screen the production:
smelt intro.melt maincontent.melt credits.melt
#To render to a low quality preview video:
smelt intro.melt maincontent.melt credits.melt
renderers_small_preview.melt
#Then to render it to high quality:
smelt intro.melt maincontent.melt credits.melt
renderers_1080p_mpeg4.melt
The renderers files of course would just contain the melt parameters
to render as desired.
Of course since it's recursive, you can also just have a file like:
main.melt:
melt:intro.melt
melt:maincontent.melt
melt:credits.melt
melt:renderers_1080p_mpeg4.melt
then invoke it like:
smelt main.melt
Let me know how it works, if you like. I can only test it with
colors: because I'm still trying to get mlt to build with avformat.
Other features which I did not add but did think of include an option
to specify the or other melt parameters directly on the command line,
and if you think those are a good idea,
let me know the syntax you like and I'll try it.
From my programming background, "include:" or "insert:" or "read:"
seem to make more sense but I understand that melt: is what melt uses
so that makes perfect sense too.
And frankly, melt probably does not use the word include: or insert:
so the perl script could probably treat those the same as "melt:" but
anyway no need to worry about that for now.
Hmm, it looks like it's trying to compile melt from scratch probably
because it is not compiled by hydra and the binaries are not for
download in the cache. In any case it should work.
It pulled in just under 2GB of data to /nix, and tries to build mlt,
but fails while trying to fetch some perl patch off of debian's
website which is 404 file not found.
I've spent several hours in #nixos on irc with folks there actively
trying to troubleshoot it but so far we haven't been able to figure
it out.
Still trying.
So in the mean time I can play with melt, fading between different
solid colors.
PS I agree that having to use backslashes at end of every line is a
real pain. I forget some, or put a space after some, or whatever.
~Jesse
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel