Thursday, May 25, 2023

How to Install and Use RTSP Simple Server

 
How to Install and Use RTSP Simple Server
 
1. Create a folder to store the app

mkdir /etc/rtsp-server
cd /etc/rtsp-server

 
2. Download the latest release. On a Linux command line, you might use a command like:

wget https://github.com/aler9/rtsp-simple-server/releases/download/v0.17.11/rtsp-simple-server_v0.17.11_linux_amd64.tar.gz

Please replace v0.17.11 with the latest version.

3.  Extract the downloaded file:

tar -xzf rtsp-simple-server_v0.17.11_linux_amd64.tar.gz
 
4. This will create a rtsp-simple-server file in your current directory. This is the server executable.
 
5.  To keep the rtsp-simple-server running as a service on a Linux-based system, you can create a systemd service.

sudo nano /etc/systemd/system/rtsp-simple-server.service
 
Then, add the following content to the file:

[Unit]
Description=RTSP Simple Server
After=network.target
 
[Service]
ExecStart=/etc/rtsp-server/rtsp-simple-server /etc/rtsp-server/rtsp-simple-server.yml
 
Restart=always
RestartSec=3
User=yourusername
Group=yourgroupname
 
[Install]
WantedBy=multi-user.target

 
Replace yourusername and yourgroupname with your username and group name respectively. 

Save the file and exit the editor.

Now reload the systemd manager configuration:

sudo systemctl daemon-reload
 
To start the service immediately, use:

sudo systemctl start rtsp-simple-server
 
To enable the service to start on boot, use:

sudo systemctl enable rtsp-simple-server
 
You can check the status of the service with:

sudo systemctl status rtsp-simple-server
 
6. To stream an MP4 file using RTSP (Real Time Streaming Protocol):

ffmpeg -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/stream
 
To continuously loop the video and stream it, you can use the -stream_loop -1 option with FFmpeg, which tells FFmpeg to loop the input indefinitely.

ffmpeg -stream_loop -1 -re -i input.mp4 -c copy -f rtsp rtsp://localhost:8554/stream
 


 
7. Test the stream (replace localhost by the server IP if testing from another machine)
 






Wednesday, December 11, 2019

Export Online SharePoint Term Store Data to CSV Files


#Set the variables
$siteCollectionUrl = "https://TENANT.sharepoint.com/sites/SITE_COLECTION"
$folderPath = "D:\Terms\Export\"
$termGroupName = "GROUP_NAME"

# Check if you have the Online SharePoint Powershell and 
# SharePoint PnP PowerShell Online modules installed or not
Get-Module -Name Microsoft.Online.SharePoint.PowerShell -ListAvailable | Select Name,Version
Get-Module -Name SharePointPnPPowerShellOnline -ListAvailable | Select Name,Version

# Uncomment these lines if not installed already
#Install-Module -Name Microsoft.Online.SharePoint.PowerShell
#Install-Module SharePointPnPPowerShellOnline

# Connect to your site (I am using the WebLogin for the two-factor authentication):
Connect-PnPOnline -Url $siteCollectionUrl -UseWebLogin

# Get the group you want to export its term sets
$termGroup = Get-PnPTermGroup -GroupName $termGroupName -Includes TermSets

# Loop over the Term Sets
foreach ($termSetItem in $termgroup.TermSets)
{    
    write-host "Working on Term Set:"$termSetItem.Name "[" $termSetItem.Id "]"

    # The Collection that will hold the Terms in this Term Set
    $collection = @()

    # Load the Term Set
    $termSet = Get-PnPTermSet -TermGroup $termGroup -Identity $termSetItem.Id -Includes Terms

    # Create the object and add it to the collection
    $termData = new-object PSObject
    $termData | Add-member -membertype NoteProperty -name "Term Set Name" -Value $termSet.Name
    $termData | Add-member -membertype NoteProperty -name "Term Set Description" -Value $termSet.Description
    $termData | Add-member -membertype NoteProperty -name "LCID" -Value ""
    $termData | Add-member -membertype NoteProperty -name "Available for Tagging" -Value "TRUE"
    $termData | Add-member -membertype NoteProperty -name "Level 1 Term" -Value ""
    $termData | Add-member -membertype NoteProperty -name "Level 2 Term" -Value ""
    $termData | Add-member -membertype NoteProperty -name "Level 3 Term" -Value ""
    $collection += $TermData    

    # Loop over the Terms Level 1
    foreach ($termItem1 in $termSet.Terms)
    {
        # Load the Level 1 Term
        $term1 = Get-PnPTerm -TermGroup $termGroup -TermSet $termSetItem.Id -Identity $termItem1.Id -Includes Terms        
        
        # Create the object and add it to the collection
        $term1Data = new-object PSObject
        $term1Data | Add-member -membertype NoteProperty -name "Term Set Name" -Value ""
        $term1Data | Add-member -membertype NoteProperty -name "Term Set Description" -Value ""
        $term1Data | Add-member -membertype NoteProperty -name "LCID" -Value ""
        $term1Data | Add-member -membertype NoteProperty -name "Available for Tagging" -Value "TRUE"
        $term1Data | Add-member -membertype NoteProperty -name "Level 1 Term" -Value $term1.Name
        $term1Data | Add-member -membertype NoteProperty -name "Level 2 Term" -Value ""
        $term1Data | Add-member -membertype NoteProperty -name "Level 3 Term" -Value ""
        $collection += $term1Data

        # Loop over the Terms Level 2
        foreach ($termItem2 in $term1.Terms)
        {
            # Load the Level 2 Term
            $term2 = Get-PnPTerm -TermGroup $termGroup -TermSet $termSetItem.Id -Identity $termItem2.Id -Includes Terms        
        
            # Create the object and add it to the collection
            $term2Data = new-object PSObject
            $term2Data | Add-member -membertype NoteProperty -name "Term Set Name" -Value ""
            $term2Data | Add-member -membertype NoteProperty -name "Term Set Description" -Value ""
            $term2Data | Add-member -membertype NoteProperty -name "LCID" -Value ""
            $term2Data | Add-member -membertype NoteProperty -name "Available for Tagging" -Value "TRUE"
            $term2Data | Add-member -membertype NoteProperty -name "Level 1 Term" -Value $term1.Name
            $term2Data | Add-member -membertype NoteProperty -name "Level 2 Term" -Value ""
            $term2Data | Add-member -membertype NoteProperty -name "Level 3 Term" -Value ""
            $collection += $term2Data

            # Loop over the Terms Level 3
            foreach ($termItem3 in $term2.Terms)
            {
                # Load the Level 3 Term
                $term3 = Get-PnPTerm -TermGroup $termGroup -TermSet $termSetItem.Id -Identity $termItem3.Id -Includes Terms        
        
                # Create the object and add it to the collection
                $term3Data = new-object PSObject
                $term3Data | Add-member -membertype NoteProperty -name "Term Set Name" -Value ""
                $term3Data | Add-member -membertype NoteProperty -name "Term Set Description" -Value ""
                $term3Data | Add-member -membertype NoteProperty -name "LCID" -Value ""
                $term3Data | Add-member -membertype NoteProperty -name "Available for Tagging" -Value "TRUE"
                $term3Data | Add-member -membertype NoteProperty -name "Level 1 Term" -Value $term1.Name
                $term3Data | Add-member -membertype NoteProperty -name "Level 2 Term" -Value $term2.Name
                $term3Data | Add-member -membertype NoteProperty -name "Level 3 Term" -Value $term3.Name
                $collection += $term3Data
            }
        }
    }

    # Build the file path, I am using the Term Set name as the filename
    $filePath = $folderPath + $termSet.Name + ".csv"

    # Write to the file
    $collection | Export-csv $filePath -notypeinformation
}

Tuesday, October 25, 2016

Nintex Forms o365 - Redirect to another page on saving

As Nintex forms on o365 does not have the option to set the URL to the page you want to go to after saving your item, there is a work around for that, in the below code I am changing the source parameter in the url to the new page which is the edit form in my case.


var newSrc = hostWebUrl + '/Lists/MyList/DispForm.aspx?ID=' + listItemId;
var newUrl = document.URL.replace(/(source=).*?(&)/gi,'$1' + newSrc + '$2');
window.history.pushState({path:newUrl},'',newUrl);

I hope it help somebody.

Friday, October 14, 2016

Nintex Workflow o365 – Error assigning a task to SharePoint Group

I have received this error on assigning a task to a SharePoint group:

Activity in progress
Retrying last request. Next attempt scheduled after 10/14/2016 11:25 AM. Details of last request: HTTP Unauthorized to https://blablabla.sharepoint.com/sites/Test/_api/sp.utilities.utility.SendEmail Correlation Id: 1a1a1a1a- abcd-efgh-ijkl-3c3c3c3c3c3c Instance Id: 2b2b2b2b-abcd-efgh-ijkl-4d4d4d4d4d4d
Access denied. You do not have permission to perform this action or access this resource.


Then I discovered that in order to make it working I need to add my account to the group or to change its settings “Who can view the membership of the group?” to “Everyone”.

Another solution I believe is to grant full control permission to the workflow as shown here: https://community.nintex.com/community/build-your-own/nintex-for-office-365/blog/2015/05/14/o365-call-http-web-service-failed-unauthorized-access-denied

Sunday, June 05, 2016

Just passed Nintex Workflow Pro Exam!

I just checked https://learning.nintex.com site, created a free account and passed the pro exam.


And the Admin exam:



Sunday, October 18, 2015

Store the SharePoint filtered values

In case you have a view for your list and users use this view and filter its values and want to keep this filter saved without creating a personal view, you can create a JavaScript file with this content:


 








Then reference this JavaScript file from any page where you have your view. It is simply listen to the “onhashchange” and save the value after the “#” in the localStorage and retrieve it on next page load. The URL of the page after you change the filter looks like this: “/Lists/TestList/AllItems.aspx#InplviewHash6c224f7d-adc4-430c-8501-312cabe57c26=FilterField1%3DLinkTitle-FilterValue1%3DTest%2520Item” and the hash value is everything after the “#”

Saturday, October 17, 2015

Nintex Repeating Section – JSLink

This blog post is building on top other posts by me and my friend Ayman El-Hattab, where in my post (Published April 9, 2015) I talked about creating master details records with repeating section in Nintex forms and Nintex Workflow, and how you can parse the repeating section data and use the information in a workflow “foreach” loop so you can create items in a separate list.

Ayman’s post (Published: Aug 4, 2015) is about displaying the repeating section data in the list view in an easy way, which is mainly by creating a custom field type (Nintex Repeating Section Data). He created two versions 2010 & 2013. But the only problem with this way is that you will need to deploy this field type first as a farm solution, which is not an option in some scenarios like O365 and organizations who do not allow custom server side deployments. Other than that it is a great and easy to use solution.

Why and What is JSLink

So this is why I build this JSLink to make it easy to deploy especially for O365, and if you are coming from Nintex side and don’t know what is JSLink, see this definition:
Client-side rendering is a new concept in SharePoint 2013. It’s provides you with a mechanism that allows you to use your own output render for a set of controls that are hosted in a SharePoint page (list views, display, add and Edit forms). This mechanism enables you to use well-known technologies, such as HTML and JavaScript, to define the rendering logic of custom and predefined field types.” - Muawiyah Shannak - https://code.msdn.microsoft.com/office/Client-side-rendering-JS-2ed3538a (this link has a very good group of samples). You will also need to check the samples published on the Office 365 Patterns and Practices https://github.com/OfficeDev/PnP/tree/master/Samples/Branding.JSLink where they added some reusable templates.

List Column

Starting by creating a list column of type “Multiple lines of text” in the list where we have our Nintex form. Make it a “plain text” in the “type of text to allow”.


Repeating Section

On the form, drag and drop the repeating section and add the child controls as needed, in my example here I have three text boxes: First Name, Last Name, and Age as you can see below.



I also named the controls in the same order “First Name”, “Last Name”, and “Age”. And yes with the space between “First” and “Name” because this is how I want it to look like in the view.
Then connect the repeating section control to the multiple line field created in the first step.



The Repeating Section JSLink

Now it is the step where the JSLink will do its magic, I have three files deployed to the “Site Assets” library located in the root web in the site collection. (You can choose to upload these files anywhere but remember to change the URLs in the view web part and in the override JavaScript file)

The first file is the “NintexOverrides.js”, and as you can see below I am using the PnP namespaces, and this file mainly is telling SharePoint view that we have another rendering template for one or more fields in the view:


The next file is the “RepeatingSectionTemplate.js”, and I am using the PnP namespace as well. And the purpose of this file simply is to parse the repeating section XML and display HTML table instead:


The third file is “NintexOverrides.css” cascading style sheet to set how we want the table displayed in the view:

 

Deployment

Actually there is no deployment other than copying the three files to the site assets library then set the JS Link property by doing the following steps:

  •  Browse to the view page where you want to apply this rendering (the list where the form with the repeating section is)
  • Edit the web part:




  • Scroll down to “Miscellaneous” then add “~sitecollection/SiteAssets/RepeatingSectionTemplate.js|~sitecollection/SiteAssets/NintexOverrides.js” in the “JS Link” property
  • Click “Okay” then save the page “Stop Editing”

The Output

Now you have the repeating section as follows:


And adding more repeating sections is easy as adding more “Multiple lines of text” column and connect it to the repeating section control on the form, then the output will be something like this:


Then update the “NintexOverrides.js” file to list the new column as follows:


Now the output is like this:



Click here to download the three files mentioned above.

How to Install and Use RTSP Simple Server

  How to Install and Use RTSP Simple Server   1.   Create a folder to store the app mkdir /etc/rtsp-server cd /etc/rtsp-server   2.  Downloa...