image

Video Editing SDK 5 for Windows – main features

12.01.2023 15 Minutes Olga Krovyakova 343 Comments Off

Do you search for the SDK that will help you to develop Windows based application for fast and easy video editing?

You are on the right way and we have the good news: trying to offer something outstanding for you, we have finally released the SolveigMM Video Editing SDK 5 for Windows.

Video Editing SDK for Windows comprises a set of tools capable of working without re-encoding and with support of all popular multimedia formats and codecs. The Video Editing SDK is a great choice for developers who work with video and audio related software, smart video editing applications for desktop or cloud.

The SDK is based on the SolveigMM Smart Rendering Technology that makes it possible for anyone to create fast and lossless video/audio editing applications.

A Video Editing Engine object is the basic part of the SDK. It is responsible for performing a number of editing operations in the smart mode. All these operations are available also via smm_batchsplit utility. This is a command-line utility to process tasks represented by batch files (*.xtl). You’ll find the examples of code below at this page.

The online documentation on the Video Editing SDK for Windows is available for you here.

Also if you are interested in HTML5 Video Editor API, you can find it at this page.

We have prepared the list of supported operations that could be performed based on the SDK by means of the smm_batchsplit.

Trimming

As the name of this operation says, it is responsible for trimming, cutting out and saving any number of segments from the loaded input files. The operation performs with a frame accuracy and lossless merging of the segments marked for saving.

The trimming is fulfilled by using the following XTL code:

<timelines version="3">
  <timeline>
    <group output="../output/sample_mp4_0001.mp4">
      <track video="1" audio="1" accuracy="frame">
        <clip src="../mp4/test_file.mp4" start="00:00:01:00" stop="00:00:06:00" timeFormat="time10ms" />
        <clip src="../mp4/test_file.mp4" start="00:00:07:00" stop="00:00:12:00" timeFormat="time10ms" />
      </track>
    </group>
  </timeline>
</timelines>

At the end of the task execution, the “sample_mp4_0001.mp4” file will be created out of the source file “test_file.mp4”. The resulting file will contain the two segments from the source file – seconds 1-6 and 7-12.

Watch the video showing the result of this operation.

 

Adding of effects/transitions to the output file

Need to enhance your own application with the ability of adding transitions or applying different effects? The Video Editing SDK lets you do this as easy as pie with our unique Engine.

Works currently for MP4 AVC and MXF XAVC video files.

– fade-in / fade-out,
– dissolve

Dissolve

The dissolve transition between 2 videos is described with this sample. The transition lasts for 3 seconds.

See XTL project below that applies this type of transition:

<timelines version="3">
  <timeline>
    <group output="../output/transition_dissolve.mp4">
      <track video="1" audio="1" text="0" accuracy="frame">
        <clip src="../mp4/test_file.mp4" start="00:00:00:00" stop="00:00:15:00" />
        <clip src="../mp4/test_file.mp4" start="00:00:03:00" stop="00:00:15:00" />
        <effect type="transparency" start="00:00:12:00" stop="00:00:15:00">
          <param name="bkcolor" value="black" />
          <param name="alpha" value="255">
            <linear length="00:00:03:00" value="0"/>
          </param>
        </effect>
      </track>
      <track video="1">
        <clip src="../mp4/test_file.mp4" length="00:00:12:00" flags="blank" />
        <clip src="../mp4/test_file.mp4" start="00:00:00:00" stop="00:00:03:00"/>
        <clip src="../mp4/test_file.mp4" length="00:00:12:00" flags="blank" />
        <effect type="transparency" start="00:00:12:00" stop="00:00:15:00">
          <param name="bkcolor" value="transparent" />
          <param name="alpha" value="0">
            <linear length="00:00:03:00" value="255"/>
          </param>
        </effect>
        <transition type="mix" start="00:00:12:00" stop="00:00:15:00"/>
      </track>
    </group>
  </timeline>
</timelines>

The output file structure and duration is shown by the first track of the XTL. This track includes all files that will create the output file.

The “effect” tag is to describe the timings for each of the dissolves and the number of dissolves should be the same as the number of “effect” tags.

The “fade out” part is described by each “effect” tag, on the first file from the couple of files that will be dissolved.

Supplementary track is necessary for each second file from the affected couple. These tracks must contain the following info:

  1. Number and type of the stream where transition is going to be. Please be aware that only one type of stream should be selected.
  2. “effect” tag, that denotes the “fade in” on the second file from the couple
  3. “transition” tag. It shows that the actual track will be operated according to that tag and included to the output file.

The file “transition_dissolve.mp4” will be built as the result of this XTL execution. It has two equal videos and one dissolve transition between them. This transition starts from the 12th second and lasts for 3 seconds.

Here is the output result of it:

 

Fade-in and Fade-out

The sample demonstrates the “fade in” and “fade out” effects on one video. Each effect continues for three seconds.

Please find below the description of the XTL for fade-in and fade-out transitions.

<timelines version="3">
   <timeline>
     <group output="../output/transition_fadein_fadeout.mp4">
       <track video="1" audio="1" text="0" accuracy="frame">
         <clip src="../mp4/test_file.mp4" start="00:00:00:00" stop="00:00:15:00" />
         <effect type="transparency" start="00:00:00:00" stop="00:00:03:00">
           <param name="bkcolor" value="black" />
           <param name="alpha" value="0">
             <linear length="00:00:03:00" value="255"/>
           </param>
         </effect>
         <effect type="transparency" start="00:00:12:00" stop="00:00:15:00">
           <param name="bkcolor" value="black" />
           <param name="alpha" value="255">
             <linear length="00:00:03:00" value="0"/>
           </param>
         </effect>
       </track>
     </group>
   </timeline>
</timelines>

The file “transition_fadein_fadeout.mp4” should be built at the end of processing of this XTL project.

The sample consists of one file, which are represented by the “clip” and two “effect” tags.  The first “effect” tag is for the “fade in” and the second tag is for the “fade out”. There are also extra parameters in “param” tags: a background color, a transparency value and variation function. The “fade in” effect is at the beginning of the file and the “fade out” effect is at its end.

Please see the output file here:

Mute audio segments

This feature replaces the specified segments of the media file with silence.

Below you will find the XTL project that allows to mute the audio on the selected segments.

<timelines version="3">
  <timeline>
    <group output="../output/audio_mute.mp4">
      <track video="1" audio="1" text="0" accuracy="frame">
        <clip src="../mp4/test_file.mp4" start="00:00:00:00" stop="00:00:05:00" timeFormat="time10ms" flags="audio_silence"/>
        <clip src="../mp4/test_file.mp4" start="00:00:05:00" stop="00:00:10:00" timeFormat="time10ms" />
        <clip src="../mp4/test_file.mp4" start="00:00:10:00" stop="00:00:15:00" timeFormat="time10ms" flags="audio_silence"/>
      </track>
    </group>
  </timeline>
</timelines>

When the processing of this XTL project finishes the “audio_mute.mp4” file will be created. The first and the last five seconds of the output file are silent.

Please see the resulted file here:

Mixing audio from the separate file

This feature is made for mixing or overlaying the audio from M4A, MP3 files or sound from AAC, MP3 or PCM streams from MP4 files to your file. It is also known as a “Voice-over”.

Please find below the XTL project example:

<timelines version="3">
  <timeline>
    <group output="../output/audio_mix.mp4">
      <track video="1" audio="0" text="0" accuracy="frame">
        <clip src="../mp4/test_file.mp4" start="00:00:00:00" stop="00:00:15:00" />
      </track>
      <track video="0" audio="1" text="0" accuracy="frame">
        <clip src="../mp4/test_file.mp4" start="00:00:00:00" stop="00:00:15:00" />
      </track>
      <track audio="1">
        <clip src="../mp3/voice-over.mp3" length="00:00:02:00" flags="audio_silence" />
        <clip src="../mp3/voice-over.mp3" start="00:00:00:00" stop="00:00:13:00" />
        <transition type="mix" start="00:00:02:00" stop="00:00:15:00">
          <param name="audio" value="1"/>
        </transition>
      </track>
    </group>
  </timeline>
</timelines>

Notes:

The result of this project is the “audio_mix.mp4” file that includes the input file “test_file.mp4” with the 13 seconds segment of sound mixed from the “voice-over.mp3” file.

See the result here, please:

Adding images to your video

There are several operations with images available by means of the Video Editing SDK:

Overlaying pictures on a video file

If you would like to overlay a picture to your video or add a watermark or a logo, you can do this with SolveigMM Video Editing SDK.

This feature is currently supported for MP4 files with AVC video and MXF files with XAVC video.

The XTL project below represents the description of overlaying images on video file.

<timelines version="3">
  <timeline>
    <group output="../output/image_overlay.mp4">
      <track video="1" audio="1" text="0" accuracy="frame">
        <clip src="../mp4/test_file.mp4" start="00:00:00:00" stop="00:00:15:00" />
      </track>
      <track video="1">
        <clip src="../logo.png" length="00:00:02:00" flags="blank" />
        <clip src="../logo.png" length="00:00:05:00" />
        <clip src="../logo.png" length="00:00:08:00" flags="blank" />
        <transition type="pip" start="00:00:02:00" stop="00:00:07:00">
          <param name="x" value="10"/>
          <param name="y" value="10"/>
          <param name="width" value="512"/>
          <param name="height" value="144"/>
        </transition>
      </track>
    </group>
  </timeline>
</timelines>

As a result of this XTL project processing, the “image_overlay.mp4 file” will be created. The rendered file will contain the SolveigMM logo overlaid at the defined position on the video. The logo start at 2 seconds and displays for ten seconds.

Please see the output file here:

Making the video from images

When you need to combine several pictures to a video, SolveigMM Video Editing SDK is there for you. It provides the functionality to easily make the MP4 (AVC) or MXF (XAVC) video files from a bunch of the PNG or JPG images.

The parameters of compression need to be set either by indicating the reference file or they can also be described directly:

<timelines version="3">
   <timeline>
   <engine type="gstreamer"/>
    <group output="../output/image_to_video.mp4" out_type="mp4">
      <task type="transcoding">
        <param name="vcodec" value="type=h264,fps_n=25,fps_d=1,width=1920,height=1080,profile=baseline,bitrate=5000"/>
        <param name="acodec" value="type=aac,profile=LC,bitrate=128000,rate=44100,channels=2"/>
      </task>
      <track video="1" audio="0" text="0">
        <clip src="../jpg/flower1.jpg" length="00:00:02:00" />
        <clip src="../jpg/flower2.jpg" length="00:00:02:00" />
        <clip src="../jpg/flower3.jpg" length="00:00:02:00" />
        <clip src="../jpg/flower4.jpg" length="00:00:02:00" />
        <clip src="../jpg/flower5.jpg" length="00:00:02:00" />
      </track>
      <effect type="transparency" start="00:00:00:00" stop="00:00:02:00">
        <param name="bkcolor" value="black" />
        <param name="alpha" value="0">
       <linear length="00:00:02.00" value="255"/>
       </param>
     </effect>
      <track audio="1">
        <clip src="..\mp3\mp3_single.mp3" start="00:00:00.00" stop="00:00:10.00"  />       
      </track>
    </group>
  </timeline>
</timelines>

The output video created with this XTL project contains the five images, each of them is shown for a duration of 2 seconds and is encoded with H.264 codec. There are also fade-in effect at the beginning of the video that lasts for 2 seconds and the audio stream in AAC with duration of 10 seconds added to the video file.

Please take a look at the output file for this XTL project:

Common transitions

The XTL project below shows the utilizing of all possible effects in a single file.

<timelines version="3">
  <timeline>
    <engine type="gstreamer"/>
    <group output="../output/transitions_avc_mp4.mp4">
<!--specify compression parameters for the transcoding-->
      <param name="reference_file" value="../mp4/test_video_1.mp4"/>
<!--add common output file structure, work only with the video stream-->
      <track video="1" audio="0" accuracy="frame">
        <clip src="../mp4/test_video_1.mp4" start="00:00:00:00" stop="00:00:02:00" />
        <clip src="../mp4/test_video_1.mp4" start="00:00:01:00" stop="00:00:02:00" />
<--declare a fade-in on the beginning of the first file-->
        <effect type="transparency" start="00:00:00:00" stop="00:00:01:00" >
          <param name="bkcolor" value="black" />
          <param name="alpha" value="0">
            <linear length="00:00:01:00" value="255" />
          </param>
        </effect>
<!--prepare the fade-out part of the dissolve transition between 2 files, the rest part is in the separate track below-->
        <effect type="transparency" start="00:00:01:00" stop="00:00:02:00" >
          <param name="bkcolor" value="black" />
          <param name="alpha" value="255">
            <linear length="00:00:01:00" value="0" />
          </param>
        </effect>
<!--declare a fade-out on the ending of the second video file-->
        <effect type="transparency" start="00:00:02:00" stop="00:00:03:00" >
          <param name="bkcolor" value="black" />
          <param name="alpha" value="255">
            <linear length="00:00:01:00" value="0" />
          </param>
        </effect>
      </track>
<!--finalize the dissolve effect by specifying a fade-in part on the second file and declaring a mix transition-->
      <track video="1">
        <clip src="../mp4/test_video_1.mp4" length="00:00:01:00" flags="blank" />
        <clip src="../mp4/test_video_1.mp4" start="00:00:00:00" stop="00:00:01:00" />
        <clip src="../mp4/test_video_1.mp4" length="00:00:01:00" flags="blank" />
        <effect type="transparency" start="00:00:01:00" stop="00:00:02:00">
          <param name="bkcolor" value="transparent" />
          <param name="alpha" value="0">
            <linear length="00:00:01:00" value="255" />
          </param>
        </effect>
        <transition type="mix" start="00:00:01:00" stop="00:00:02:00"/>
      </track>
<!--declare a picture overlay-->
      <track video="1">
        <clip src="../png/attractive.png" length="00:00:01:00" flags="blank"/>
        <clip src="../png/attractive.png" length="00:00:01:00" />
        <clip src="../png/attractive.png" length="00:00:01:00" flags="blank"/>
        <transition type="pip" start="00:00:01:00" stop="00:00:02:00">
          <param name="x" value="0"/>
          <param name="y" value="0"/>
          <param name="width" value="184"/>
          <param name="height" value="112"/>
        </transition>
      </track>
<!--add audio from the same input files-->
      <track video="0" audio="1" accuracy="frame">
        <clip src="../mp4/test_video_1.mp4" start="00:00:00:00" stop="00:00:02:00" />
        <clip src="../mp4/test_video_1.mp4" start="00:00:01:00" stop="00:00:02:00" />
      </track>
<!--declare mixing of the additional audio from the separate mp3 file-->
      <track audio="1">
        <clip src="../mp3/mp3_single.mp3" length="00:00:00:50" flags="audio_silence"/>
        <clip src="../mp3/mp3_single.mp3" start="00:00:00:00" stop="00:00:02:00" />
        <clip src="../mp3/mp3_single.mp3" length="00:00:00:50" flags="audio_silence"/>
        <transition type="mix" start="00:00:00:50" stop="00:00:02:50"/>
      </track>
    </group>
  </timeline>
</timelines>

At the end of this XTL project’s processing, the “transitions_avc_mp4.mp4” file will be created, where you can see the different transitions and effects applied to the file:

  • “Fade-in” effect on the first file that lasts for 1 second starting at 0 second.
  • “Dissolve” transition between the first and the second files. The transition lasts for 1 second and starts at the 1 second.
  • “Fade-out” effect that you can see at the end of the second file. It lasts for 1 second and starts at 2 second.
  • Overlaying image on the video. The effect starts at 1 second and has the duration of 1 second.
  • Adding audio tracks separately from the same input files
  • Mixing sound from the MP3 file. It starts at 0.5 second and has the duration of 2 seconds.

Please note, while rendering the output file with the encoding parameters used in the “test_video_1.mp4” reference file, the transcoding will be applied.

See the output file for this XTL project here:

 

HTML5 Online Video Editor sample application

The SDK includes the HTML5 Video Editor sample application that demonstrates the use of SDK for developing the web editing solution. The SDK engine is used at backend, so HTML5 Video Editor includes all features offered by the SDK.

HTML5 Editor available online by url:
https://smarteditingonline.solveigmm.com/

The video below shows the online editing using the HTML5 Video Editor:

 

Utilities

For cases when it is less handy to compose and run the XTL project to do the specific task, we have included some helpful utilities. They perform certain features and do not need the XTL project for processing.

smm_ts2mp4

This is the utility that allows to convert the entire input MPEG-TS file (that contains AVC or HEVC video and AAC audio) or the segment from it to the MP4 file with AAC audio.

Please see the example below on how to use it:

SMM_TS2MP4.cmd -frameacc -source ../../samples/media/h264-ts/sample_h264_aac.ts -dest ../../samples/media/output/output_from_ts.mp4 -starttime 1000 -endtime 2000

-source – defines the name of the input MPEG-TS file
-dest – defines the name of the output MP4 file
-starttime and -endtime indicates the start and stop time position of the segment in milliseconds
-frameacc – allows the frame accuracy for editing

smm_mp4transc

It is a command-line tool that transcodes an MP4 file with AVC or HEVC video and AAC audio with the codec and container parameters specified by the reference MP4 (AVC video, AAC audio) file.
An example of usage:

SMM_MP4Transc.cmd -sourcemp4 ../../samples/media/mp4/test_video_1.mp4 -refmp4 ../../samples/media/mp4/sample_mp4_hd.mp4 -destmp4 ../../samples/media/output/output.mp4

-sourcemp4 – defines the name of the input MP4 file
-refmp4 – indicates the reference file. Its parameters will be used for encoding
-destmp4 – defines the name of the output MP4 file

The picture below shows the parameters of the input video file
input file

Below are parameters of the reference file:
transcoding reference

And here are the parameters of transcoded MP4 video file

after transcoding

As you can notice, the output transcoded video file have different parameters, such are resolution, level and profile parameters.

1.1 / 5 - 401

HTML5 Video Editor release

HTML5 Video Editor is the professional online video editing tool that can be embedded in your Media Asset Management System (MAM), Learning Management System (LMS), Newsroom or in Healthcare system. The editor can work both in the cloud and on premise, as it integrates with existing systems. What is especially significant, when editing the smart […]

Video Editing SDK 5 for Linux – main features

Video Editing SDK for Linux is a tool for those developers who work with video and audio and want to design smart video editing desktop or cloud applications that support key multimedia formats and codecs. The SDK implements a SolveigMM Smart Rendering Technology that allows any processing of media files with different compression parameters according […]