mplayer - custom fps - frame-rate

I need to set custom output fps in mplayer but I can't use -fps option because it just changes video duration time. I need to change fps with keeping video duration time (i.e skip or add some frames). Is there such option in mplayer?

You could try the scaletemp filter. This filter will not interpolate the movie (afaik).
mplayer -af scaletempo -speed 2.0 movie.mkv

Related

Ant Media Server - Rewind Feature duration?

Hi i found this post Does Ant Media Server has live rewind feature? and it is working great, but does anyone know how to limit the duration of the rewind to a specific value.
I try to make a 24h rewind for a 24/7 stream.
Thanks for reading.
You have 2 options for this requirement. Let me explain step by step:
You can modify Segment list size and Segment Duration parameters according to your requirements.
Segment duration means that .ts chunk duration. It's default 2.
Segment list size means .ts chunk size on .m3u8 file. It's default 5. So you will have 5 .ts chunks in m3u8 file.
Let's skip to your requirements. You can calculate your 24h with below calculation. You need to have 24h with segment duration * segment list size.
Let's change the segment duration to 4 seconds.
24h(24 * 60 * 60 = 86400 seconds) = 4 seconds * 21600
So that you need to use as below:
Segment duration: 4
Segment list size: 21600
I tried it on my test environment, it's working for 2-3 minutes. I'm expecting should work 24h as well. Please keep settings as below:
settings.hlsPlayListType=
settings.hlsflags=delete_segments
settings.deleteHLSFilesOnEnded=true
on app settings as well. Please test it first.
You can restart your stream every 24h, so that Ant Media Server will remove chunks. It will start again.

Change music on hold during Dial()

I'm using the parameter m(mymusic) in my call to Dial() to let the caller hear some music instead of the boring ring tone. However I'd like to have a different music file after some time. The time when the music changes should easily be changeable (by editing a variable), so it is no option to just create a music-on-hold-file which has X seconds of music 1 and then Y seconds of music 2.
What I want is basically this, but without a second Dial() and without an actual second call to ${device}, because that creates two "missed call" entries for one missed call, and it interrupts the phone's ring tone.
Set(time_until_new_music=20);
Dial(${device},${time_until_new_music},gm(music1));
if ( "${DIALSTATUS}" == "NOANSWER" ) {
Dial(${device},,m(music2));
}
Is this possible somehow?
Hold class can have unlimited number of different sound file of any length
Number of musiconhold classes also unlimited. So you can create your own set for every need
However you can't control from dialplan class info. You can use external steaming app and forward to that app param you need. Require expert level in both asterisk and linux.
Something like this may work:
s,1,Set(time_until_new_music=20)
s,2,Dial(${device},${time_until_new_music},gm(music1))
s,3,GotoIf($[${DIALSTATUS}=NOANSWER]?s,4:s,5)
s,4,Dial(${device},,m(music2))
s,5,Hangup()

After Effects Expressions - controling comps from main comp using an "Expressions Layer"

THE GOAL I WANT TO ACHEIVE:
Control AE timelines using ONE EXPRESSION LAYER (much like using Actionscript) to trigger frequently used comps such as blinking, walking, flying etc... for cartoon animation.
I want animate a the blinking of a cartoon character. (and other actions, explained below) Rather than "re posting" the comp or key frames movements every time I want a blink or a particular action, I want to create a script where I can trigger the Blink comp to play. Is this possible? (Sidenote: A random blink through entire movie would be nice) but I still want to know how to do this for the reasons below.
Ideally: I would like to create an "Expressions layer" in the main comp to TRIGGER other comps to play. At certain points I would like to add triggers to call frequently used comps that contain actions like.. Blinking, Walking, Flying, Look Left and Right etc...
IT WOULD BE AMAZING IF somehow we could trigger other comps to begin, repeat, stop, maybe reverse, and do this all from one Main Comp using an expression layer.
WHY DO IT THIS WAY?
Why not just paste a comp in the spot you want it to play every time you want such action? Well in after effects if you wanted a "blink comp" to play 40 times in two minutes you would have to create 40 layers, or pate the key frames on that comp 40 times. Wouldn't it be awesome to trigger or call it from one one layer when you wanted it from one expressions layer?
We do something like this in Flash using Actionscript all the time. It would be awesome if there was a method out there to achieve this effect. This would be an OUTSTANDING tutorial and I believe it would be very popular if someone did it. It could be used for a MULTITUDE of amazing effects and could save a ton of time for everyone. Heck, help me figure this out and perhaps I will make a tutorial.
Thank you all ye "overflowing Stackers" who contribute! :)
I found the answer and that is...
IT'S NOT POSSIBLE.
After Effects expressions can not control other timelines. Unfortunately you have to put an expression on each layer you want to affect.
The next best solution, and to achieve something close to what I was asking can be found on this link: motionscript.com/design-guide/marker-sync.html
We can only hope that Adobe will someday give the power to expressions like they did with action-script.
HOPEFULLY SOON! Anyone reading this who works for Adobe please plead our case. Thanks
Part 1: Reference other layers in pre-Comps
Simply replace "thisComp" with "comp("ComName")"
To reference Effect-Controllers between compositions, follow the below formula:
comp("ComName").layer("LayerWithExpression").effect("EffectControlerName")("EffectControllerType")
More In-depth Answer: Adobe's Docs - Skip to the Layer Sub-objects part
As I understand the Adobe documentation, only Layers can be accessed,
not footage. What this means is that you will need to create your
expression link utilizing a pre-Comp. Footage can not access this so
that also means no nulls, adjustment layers, etc.
As an added bonus, if you use the essential graphics panel, you can put all the controllers in one pre-comp, but have the controls available no matter which comp you are in. Just select it in the Essential-Graphics dropdown.
Part 2: Start/End based on other layers within pre-comps:
Regarding the next part where you want the expressions to activate based on other compositions, I recommend using the in-out Point expression.
inPoint | Return type: Number. Returns the In point of the layer, in seconds.
outPoint | Return type: Number. Returns the Out point of the layer, in seconds.
If you utilize the start time overrides you can pull this from:
startTime | Return type: Number. Returns the start time of the layer, in seconds.
Alternate Option:
I would recommend avoiding this as the keyframes are basically referenced as an index, so things can get messed up if you add one ahead of a keyframe you were already using - def incorporate some error handling.
Refer to the Key attributes and methods (expression reference) Here
Part 3: Interpolation & Time Reversal
You can time reverse the layer in the rightclick->time, otherwise this is all interpolation expressions like loop out etc - you can loopOut("FOO") a pre-comp if you not only cut it correctly, but also enable time remapping.
then use this to loop those keyframes;
try{ timeStart = thisProperty.key(1).time; duration = thisProperty.key(thisProperty.numKeys).time-timeStart; pingPong =
false; //change to true value if you want to loop animationn back &
forth quant=Math.floor((time-timeStart)/duration);
if(quant<0) quant = 0
if(quant%2 == 1 && pingPong == true){
t = 2*timeStart+ (quant+1)*duration - time;
}
else{
t = time-quant*duration;
}
}
catch(err){
t = time;
}
thisProperty.valueAtTime(t)

Saving media streams based on size and time criteria in a direct show filter

I just have simple filter graph whick takes media streams from rtsp source[ generally h264 and mp4 ] and save them using an mp4 muxer to a file...
RtspSourceFilter ---> MP4 Muxer ---> File Writer.
It works OK. But i have constraint[ new requirment now]. I have to write file based on two criteria: their size and duration...Suppose that user can define rules such as:
if duration > 1 hour or size > 1 gb then write stream to new file
In my graph in order to this,
I have to stop my graph based on conditions and create and start new
one with new file name...
That is bad since at ever file i have to re-connect my source and possibly lost some data...
What is the best way to deal with it ?
My Solution: [ But not satisfied with it ]
I have the source code of RtspSourceFilter and MP4Muxer[open source] so that forgot FileWriter...MP4 Muxer became a writer with Muxer...So stop it internally and write when necessary and then cretae new file...Do some buffering for not looosing data...
RTSP Source Filter ---> New MP4 Writer [ a writer with mp4 muxer in it]
But this introduce unnecessary complexity...Now i became maintainer of MUX operation via New MP4 Writer...Since i have no time to really understand what Mux do, i have to modify-hack it to behave what i want... Analogy: I have car and i will make a helicopter from it...It will be very ugly and un-trusted helicopter...Probably my New MP4 Filter [code] will be so...[ Big Ball of Mud]
It sounds like GMFBridge may be of use to you. It allows you to create one source graph, and multiple sink graphs. Then when your constraint is met, bridge the source graph to a new sink graph.
If you put the bridge in buffer (non-discard) mode, you should not loose any samples.
However, you will have to investigate if this solution works for you. Have a look at the sample applications for a quick overview.

How to change the delay of a link in NS2 simulation?

I need to run a NS2 simulation that the delay of a link will change
during the runtime, and I use following procedure in tcl script:
$ns delay $node3 $node4 $delay_time
to change the delay in a link between $node3 and $node4.
But it only works when it's set before the simulation starts.
If I want to change the delay in a certain time, e.g.
$ns at 1.0 "$ns delay $node3 $node4 10ms"
It doesn't work.So how to change the delay of a link during runtime?
Thanks for any help.
I have been looking for this answer on and off for quite some time myself. I have been constantly making my way back here to this depressingly unanswered question. Here it is.
Say as above, you have $node3 and $node4.
To get your link, use
set myLink [[$ns link $n(0) $n(1)] link]
Note that this is not just the link, it is the link_ within the Link (manual page 68 http://www.isi.edu/nsnam/ns/doc/ns_doc.pdf or html version http://www.isi.edu/nsnam/ns/doc/node63.html). This is the part that manages the link delay. In order to change the link delay, use
$myLink set delay_ 1ms
This part was found in ns-2.35/tcl/lib/ns-link.tcl

Resources