Posts

Showing posts from March, 2021

PowerShell Script to combine a simple image and audio -> Export to video

Image
 So , I was doing some stuff on YouTube and i have this specific requirement where i often need to combine a few audio clips with a simple image and create a simple video. Nothing fancy just one short audio clip + one simple image -> export to video  ,that's all I want.  I have been doing it manually by using the free video editor OpenShot  , but since there is not editing done here at all and all i do is just combine , i thought of writing a PowerShell script to get it done. I'm using the popular ffmpeg  library for this and i think the script is self explanatory. I'm sharing the script below so please feel free to use it if you wish :) . Hoping to do some changes to it later and make it upload the exported video to YouTube so the complete workflow is covered. I think i should be able to do it with YouTube API so we'll see. Here is my script on GitHub !

With Values

Image
 Using the clause WITH VALUES when you are adding a new column to an existing table using Microsoft SQL Server is a handy little trick. The use of WITH VALUES is when you want to add a default constraint to an existing table that allows null . Because when you add a default constraints that allows null it will NOT fill the existing rows with a value, this can effect your database logics ( if you have written some code depending on these values ).  Let me demonstrate this with some simple tables. Create a simple table CREATE TABLE Students( id int NOT NULL, name varchar(50) NULL ) Add some sample data insert into Student (id,name) values (1,'Cappadonna'), (2,'UGod') Add a new column to the table , with NOT NULL  clause ALTER TABLE Student ADD age int not null CONSTRAINT age_default DEFAULT 99 Now if you query your table you will see that the existing rows are being populated with your default value. This is because we added the constraint as NOT NULL.    No...