Side by side video with slideshow and change sizes in MLT - mlt

I have a specific task I'm attempting to do. Unfortunately I am not an expert in MLT and was given this project and told to "go do it"
The end goal is to have video plus a slideshow side by side in an mp4 file. This video and the slideshow will change sizes as the presentation goes on.
While I can get the video and the slideshow working side by side, as soon as I attempt to add in transitions to scale the video or slides, everything just absolutely breaks. Here's an example XML file I'm working with (I apologize if it's not properly formed for MLT, this is what I've been given to work with):
<?xml version="1.0" encoding="UTF-8"?>
<mlt>
<profile width="1920" height="1080" progressive="1" />
<tractor id="tractor0" global_feed="1" in=":0." out=":3144.">
<multitrack>
<playlist id="track0">
<producer id="background" mlt_service="color" in="0" out=":3144." />
</playlist>
<playlist id="vTrack1">
<blank length=":797." />
<producer id="video" resource="/root/m/fe96fae3c5974c2fbc9d4b61bce42da129232839.mp4" in=":0." out=":255." />
<blank length=":1359." />
<blank length=":258." />
<blank length=":99." />
<blank length=":376." />
</playlist>
<playlist id="track1">
<producer id="video" resource="/root/m/08448131a1398de90859264dd8dd46547222c41c.mp4" in=":428." out=":1225." />
<blank length=":255." />
<producer id="video" resource="/root/m/08448131a1398de90859264dd8dd46547222c41c.mp4" in=":1480." out=":2839." />
<producer id="video" resource="/root/m/6b7f6ebb320c0b6c7f3b974c8954d4eb02dd5a2b.mp4" in=":2826." out=":3084." />
<producer id="video" resource="/root/m/99bf4f550ffb389a4776723e5525868cda3b5953.mp4" in=":0." out=":99." />
<producer id="video" resource="/root/m/08448131a1398de90859264dd8dd46547222c41c.mp4" in=":3203." out=":3579." />
<blank length=":0." />
</playlist>
<playlist id="slidetrack0">
<producer id="image" resource="/root/m/content/Slide1.PNG" in=":0." out=":538." />
<producer id="image" resource="/root/m/content/Slide3.PNG" in=":0." out=":5." />
<producer id="image" resource="/root/m/content/Slide6.PNG" in=":0." out=":66." />
<producer id="image" resource="/root/m/content/Slide7.PNG" in=":0." out=":94." />
<producer id="image" resource="/root/m/content/Slide10.PNG" in=":0." out=":955." />
<producer id="image" resource="/root/m/content/Slide4.PNG" in=":0." out=":20." />
<producer id="image" resource="/root/m/content/Slide6.PNG" in=":0." out=":768." />
<producer id="image" resource="/root/m/content/Slide15.PNG" in=":0." out=":95." />
<producer id="image" resource="/root/m/content/Slide1.PNG" in=":0." out=":12." />
<producer id="image" resource="/root/m/content/Slide2.PNG" in=":0." out=":24." />
<producer id="image" resource="/root/m/content/Slide4.PNG" in=":0." out=":14." />
<producer id="image" resource="/root/m/content/Slide5.PNG" in=":0." out=":28." />
<producer id="image" resource="/root/m/content/Slide6.PNG" in=":0." out=":17." />
<producer id="image" resource="/root/m/content/Slide7.PNG" in=":0." out=":25." />
<producer id="image" resource="/root/m/content/Slide23.PNG" in=":0." out=":72." />
<producer id="image" resource="/root/m/content/Slide24.PNG" in=":0." out=":10." />
<producer id="image" resource="/root/m/content/Slide28.PNG" in=":0." out=":6." />
<producer id="image" resource="/root/m/content/Slide41.PNG" in=":0." out=":16." />
<producer id="image" resource="/root/m/content/Slide42.PNG" in=":0." out=":379." />
</playlist>
</multitrack>
<filter gain="1" in=":0." out=":3144." mlt_service="volume" track="2" />
<transition in=":0." out=":3144" mlt_service="composite" progressive="1" geometry="0/0;1920x1080" halign="left" valign="middle" />
<transition in=":0." out=":0." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,324:768x432:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":696." out=":696." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,180:1280x720:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1149." out=":1149." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,0:1920x1080:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1619." out=":1619." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,0:1x1:0" halign="left" valign="middle" distort="0" fill="1" />
<transition in=":1890." out=":1890." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,324:768x432:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1925." out=":1925." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,0:1x1:0" halign="left" valign="middle" distort="0" fill="1" />
<transition in=":1956." out=":1956." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,0:1920x1080:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1991." out=":1991." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,0:1x1:0" halign="left" valign="middle" distort="0" fill="1" />
<transition in=":2235." out=":2235." mlt_service="affine" a_track="0" b_track="2" progressive="1" rect="0=0,432:384x216:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":0." out=":0." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=768,216:1152x648:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":696." out=":696." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=1280,360:640x360:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1149." out=":1149." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=0,0:1x1:0" halign="right" valign="middle" distort="0" fill="1" />
<transition in=":1619." out=":1619." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=0,0:1920x1080:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1890." out=":1890." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=768,216:1152x648:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1925." out=":1925." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=0,0:1920x1080:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":1956." out=":1956." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=0,0:1x1:0" halign="right" valign="middle" distort="0" fill="1" />
<transition in=":1991." out=":1991." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=0,0:1920x1080:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":2235." out=":2235." mlt_service="affine" a_track="0" b_track="3" progressive="1" rect="0=384,108:1536x864:100" halign="center" valign="middle" distort="0" fill="1" />
<transition in=":0." out=":3144." mlt_service="mix" a_track="0" b_track="2" combine="1" always_active="1" />
</tractor>
</mlt>
The end result is that the slides are timed incorrectly somehow and end super early while the transitions seem to be timed correctly. I just don't know where else to look at this point and need guidance. Thank you.

One thing I notice right away is that your profile does not specify a frame rate. I expect MLT will choose 25Hz by default on your behalf. But you may not get the timing you expect when specifying frames.
Another thing that might help is that MLT supports time format for in/out properties - which is much easier to read. So, for example, you can specify an out to be 00:01:30.25 if you want the out point to be 1 minute 30.25 seconds.
Finally, I always recommend that people who are trying to learn MLT XML to spend some time with one of the video editors that use it in the backend. KDENLIVE and Shotcut are both popular. Build what you want in the GUI and then inspect the XML that gets saved in the project file.

Related

Which approach is better out of these 2 with react-query fetch?

To get the maximum benefit of react-query caching which approach is more performant or how could i measure the performance of each data fetching approach with react-query.
Approach 1
<parent />
useQuery('todos', fetchTodoList)
<Child1 />
useQuery('todos', fetchTodoList)
<Child2 />
useQuery('todos', fetchTodoList)
<Child3 />
useQuery('todos', fetchTodoList)
<Child4 />
useQuery('todos', fetchTodoList)
Approach 2
<parent />
<Child1 />
useQuery('todos', fetchTodoList)
<Child2 />
useQuery('todos', fetchTodoList)
<Child3 />
useQuery('todos', fetchTodoList)
<Child4 />
useQuery('todos', fetchTodoList)

Ionic React : Switching between tabs is very slow since I added Ionic

I just added Ionic to my existing React app and, then, impleted the #ionic/react-router.
But after to modify my navigation tabs, I notice a BIG difference of delay when I switch between two tabs :
0.5 seconds with ReactRouter ✅
2 seconds with IonicReactRouter 😭
(I can provide video to prove)
My code :
<IonTabs>
<IonRouterOutlet animated={false}>
<Redirect exact path="/tab" to="/tab/home" />
<Route exact path={`/tab/home`} render={() => <Home />} />
<Route exact path={`/tab/user`} render={() => <User />} />
<Route exact path={`/tab/ranking`} render={() => <Ranking />} />
<Route exact path={`/tab/settings`} render={() => <Settings />} />
</IonRouterOutlet>
<IonTabBar slot="bottom">
<IonTabButton tab="home" href="/tab/home">
<IonIcon className='icon icon-home' />
<IonLabel>Home</IonLabel>
</IonTabButton>
<IonTabButton tab="user" href={`/tab/user`}>
<IonIcon className='icon icon-team' />
<IonLabel>Club</IonLabel>
</IonTabButton>
<IonTabButton tab="ranking" href={`/tab/ranking`}>
<IonIcon className='icon icon-ribbon' />
<IonLabel>Phases</IonLabel>
</IonTabButton>
<IonTabButton tab="settings" href={`/tab/settings`}>
<IonIcon className='icon icon-ranking' />
<IonLabel>Ranking</IonLabel>
</IonTabButton>
</IonTabBar>
I notice, if I remove all content from my tabs, the "switch time" is Ok, but I don't want empty tabs 😕
<IonRouterOutlet >
<Route exact path={`/tab/home`} render={() => <IonPage>Home is empty</IonPage>} />
...
Do I made a mistake ?
PS : Of course I can optimize my tab content, but this is not explain why it is more slow than the react BrowserRouter

Redirect from IonMenu to a page using Ionic React

I created a menu with React in Ionic Framework and I want to redirect to the page that user clicked but this doesn't happen, items are not clickable. I already tried with IonButton instead of IonItem and that works properly!
<IonMenu side="start" contentId="content">
<IonHeader>
<IonToolbar>
<IonTitle>Menu</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent id="content">
<IonList>
<IonItem routerLink="/Home">
<IonIcon slot="start" icon={home}></IonIcon>
<IonLabel>Home</IonLabel>
</IonItem>
<IonItem routerLink="/Activities">
<IonIcon slot="start" icon={bicycle}></IonIcon>
<IonLabel>Activities</IonLabel>
</IonItem>
<IonItem routerLink="/Login">
<IonIcon slot="start" icon={exit}></IonIcon>
<IonLabel>Logout</IonLabel>
</IonItem>
</IonList>
</IonContent>
You need a reference to the IonRouterOutlet, pointing the same id that you have in the attribute content and define all the routes matching the menu.
<IonApp>
<IonReactRouter>
<IonSplitPane contentId="content">
<Menu />
<IonRouterOutlet id="main">
<Route path="/Home" component={Home} exact={true} />
<Route path="/Activities" component={Activities} exact={true} />
<Route path="/Login" component={Login} exact={true} />
<Route path="/Logout" component={Logout} exact={true} />
<Route path="/" render={() => <Redirect to="/Home" />} exact={true} />
</IonRouterOutlet>
</IonSplitPane>
</IonReactRouter>
</IonApp>

navBar and tabs doesn't show correctly using react-native-router-flux

Currently I have this structure in my routes.js:
<Router>
<Scene key="root" hideNavBar>
<Stack key="Auth" initial={!this.state.isLoggedIn}>
<Scene key="Login" hideNavBar component={Login} title="Login" />
</Stack>
<Stack key="Main" initial={this.state.isLoggedIn}>
<Scene drawer key="NavDrawer" hideNavBar contentComponent={() => <NavDrawer username={this.state.userName} />} type={ActionConst.REPLACE} panHandlers={null}>
<Scene tabs={true} hideNavBar={false} navBar={() => <PageHeader title='Home'/>} key="homeTab" tabBarPosition='top' tabBarStyle={styles.tabBar} lazy={true} drawerLockMode={'locked-closed'}>
<Scene key="Home" hideNavBar component={Home} title={"Home"} />
<Scene key="itemDescription" hideNavBar component={itemDescription} title="Item Description" back />
</Scene>
<Scene key="helpTab" title="Help" drawerLockMode={'locked-closed'}>
<Scene key="Help" hideNavBar component={Help} title={"Help"} />
</Scene>
<Scene key="settingTab" title="Settings" drawerLockMode={'locked-closed'}>
<Scene key="Setting" hideNavBar component={Setting} title={"Setting"} />
</Scene>
<Scene key="QRTab" title="QR" drawerLockMode={'locked-closed'}>
<Scene key="QRScanner" hideNavBar component={QRScanner} title={"QR Scanner"} />
</Scene>
</Scene>
</Stack>
</Scene>
</Router>
Problem is on the homeTab, the custom navBar (or any navBar at all) won't show.
if I try to remove hideNavBar from each of the child scenes, it would just render the navBar BELOW the tabs.
Can anyone suggest a better way of organizing this? I'm quite a noob with React Native and RNRF.
thanks in advance! :)
After tinkering with the structure for awhile, this structure represents what I wanna achieve best logically and aesthetically. But I'm just not too happy with how the code looks like. If anyone have any suggestion that can achieve the same logic and looks, with prettier code please let me know :)
<Router>
<Scene key="root" hideNavBar>
<Stack key="Auth" initial={!this.state.isLoggedIn}>
<Scene key="Login" hideNavBar component={Login} title="Login" />
</Stack>
<Stack key="Main" initial={this.state.isLoggedIn}>
<Scene drawer key="NavDrawer" hideNavBar contentComponent={() => <NavDrawer username={this.state.userName} />} type={ActionConst.REPLACE} panHandlers={null}>
<Scene key="homeTab" navBar={() => <PageHeader title='Home' />} drawerLockMode={'locked-closed'}>
<Scene tabs={true} tabBarPosition='top' tabBarStyle={styles.tabBar} lazy={true}>
<Scene key="Home" hideNavBar component={Home} title={"Home"} />
</Scene>
<Scene key="itemDescription" hideNavBar component={itemDescription} title="Item Description" back />
</Scene>
<Scene key="helpTab" navBar={() => <PageHeader title='Help' />} title="Help" drawerLockMode={'locked-closed'}>
<Scene>
<Scene key="Help" hideNavBar component={Help} title={"Help"} />
</Scene>
</Scene>
<Scene key="settingTab" navBar={() => <PageHeader title='Settings' />} title="Settings" drawerLockMode={'locked-closed'}>
<Scene>
<Scene key="Setting" hideNavBar component={Setting} title={"Setting"} />
</Scene>
</Scene>
<Scene key="QRTab" navBar={() => <PageHeader title='QR Scanner' />} title="QR" drawerLockMode={'locked-closed'}>
<Scene>
<Scene key="QRScanner" hideNavBar component={QRScanner} title={"QR Scanner"} />
</Scene>
</Scene>
</Scene>
</Stack>
</Scene>
</Router>

B2C Orchestationstep phone verify default value

I have this orchestation steps:
<OrchestrationStep Order="1" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="PasswordResetUsingEmailAddressExchange" TechnicalProfileReferenceId="LocalAccountDiscoveryUsingEmailAddress" />
</ClaimsExchanges>
</OrchestrationStep>
<OrchestrationStep Order="2" Type="ClaimsExchange">
<ClaimsExchanges>
<ClaimsExchange Id="PhoneFactor-Verify" TechnicalProfileReferenceId="PhoneFactor-InputOrVerify" />
</ClaimsExchanges>
</OrchestrationStep>
this technical profile for first orchestation step:
<TechnicalProfile Id="LocalAccountDiscoveryUsingEmailAddress">
<DisplayName>Reset password using email address</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="IpAddressClaimReferenceId">IpAddress</Item>
<Item Key="ContentDefinitionReferenceId">api.localaccountpasswordreset</Item>
</Metadata>
<CryptographicKeys>
<Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
</CryptographicKeys>
<IncludeInSso>false</IncludeInSso>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="Verified.Email" Required="true" />
<OutputClaim ClaimTypeReferenceId="objectId" />
<OutputClaim ClaimTypeReferenceId="userPrincipalName" />
<OutputClaim ClaimTypeReferenceId="authenticationSource" />
</OutputClaims>
<ValidationTechnicalProfiles>
<ValidationTechnicalProfile ReferenceId="AAD-UserReadUsingEmailAddress" />
</ValidationTechnicalProfiles>
</TechnicalProfile>
and this technical profile for second orchestation step:
<TechnicalProfile Id="PhoneFactor-InputOrVerify">
<DisplayName>PhoneFactor</DisplayName>
<Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.PhoneFactorProtocolProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
<Metadata>
<Item Key="ContentDefinitionReferenceId">api.phonefactor</Item>
<Item Key="ManualPhoneNumberEntryAllowed">true</Item>
</Metadata>
<CryptographicKeys>
<Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
</CryptographicKeys>
<InputClaims>
<InputClaim ClaimTypeReferenceId="userPrincipalName" PartnerClaimType="UserId" />
<InputClaim ClaimTypeReferenceId="strongAuthenticationPhoneNumber" />
</InputClaims>
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="Verified.strongAuthenticationPhoneNumber" PartnerClaimType="Verified.OfficePhone" />
<OutputClaim ClaimTypeReferenceId="extension_655ae1ae68ed4c84a951961db1d40222_doblefactor" />
<!-- TODO: OutputClaim ClaimTypeReferenceId="userAssertedPhoneNumber" /-->
</OutputClaims>
<UseTechnicalProfileForSessionManagement ReferenceId="SM-MFA" />
</TechnicalProfile>
I need to use my mobile phone information as default
Do you have an example for this?
Thank you
You have to read the "strongAuthenticationPhoneNumber" claim in the first orchestration step.
Add the "strongAuthenticationPhoneNumber" claim as an <OutputClaim /> to the "AAD-UserReadUsingEmailAddress" technical profile.
Add the same claim as an <OutputClaim /> to the "LocalAccountDiscoveryUsingEmailAddress" technical profile.
It should then be passed as an <InputClaim /> to the "PhoneFactor-InputOrVerify" technical profile.
I think whatyou want to do is replicate the answer to this question except change mobile to email
Triggering email verification

Resources