Showing posts with label video. Show all posts
Showing posts with label video. Show all posts

Tuesday, May 7, 2024

FFmpeg : bulk compress videos

The phones are getting bigger and there camera's more so. Now videos are getting recorded in 4K with bitrate around 20Mbps. Now if you wish to store them for long term, it takes a lot of space on the phone which normally has fixed storage. Even you backup on a hard disk, it grows with time. So ideally just compress it with no perceptible loss in quality.

To do so (on Windows):

  1. Insall FFmpeg : https://www.wikihow.com/Install-FFmpeg-on-Windows 
  2. Copy all videos into a folder from you phone to laptop
  3. run a batch script:
    for %%c in (*.mp4) do ( 
     ffmpeg -i %%c  -vcodec libx265 -crf 28 out\%%c
    )
  4. It will convert all the videos (mp4 files) one by one and the result will be stored in a out folder.
  5. Try to view some videos in the out folder and once satisfied, correct the created and modified date with the below powershell script:

    $modifyfiles = Get-ChildItem -force *.mp4| Where-Object {! $_.PSIsContainer}
    foreach($object in $modifyfiles)
    {
       $object.CreationTime=[datetime]::ParseExact($object.BaseName.Substring(4),"yyyyMMdd_HHmmss",$null)
       $object.LastWritetime=[datetime]::ParseExact($object.BaseName.Substring(4),"yyyyMMdd_HHmmss",$null)
    }
  6. Now copy the videos back to your phone (and your local hard disk backup as required)
  7.  

Wednesday, May 28, 2014

Video Encoding Bitrates

NameResolutionLink
(Mbps)
Bitrate
(Mbps)
Video
(kbps)
Audio
(kbps)
240p424x2401.00.6457664
360p640x3601.50.9689664
432p768x4321.81.15108864
480p848x4802.01.28121664
480p HQ848x4802.51.60153664
576p1024x5763.01.92185664
576p HQ1024x5763.52.24217664
720p1280x7204.02.56249664
720p HQ1280x7205.03.203072128
1080p1920x10808.05.124992128
1080p HQ1920x108012.07.687552128
1080p Superbit1920x1080N/A20.3220000320
and for older, non-widescreen content (with only 75% as many pixels)...

NameResolutionLink
(Mbps)
Bitrate
(Mbps)
Video
(kbps)
Audio
(kbps)
240p320x2401.00.6457664
360p480x3601.20.7770464
480p640x4801.50.9689664
480p HQ640x4802.01.28121664
576p768x5762.31.47140864
576p HQ768x5762.51.60153664
720p960x7203.01.92185664
720p HQ960x7204.02.562432128
1080p1440x10806.03.843712128
1080p HQ1440x10809.05.765632128
1080p Superbit1440x1080N/A20.3220000320

Source : http://www.lighterra.com/papers/videoencodingh264/

Sunday, February 10, 2013

How to download videos in Opera

I have used Opera as my favorite browser for last 10 -12 years now (since its 6th version). I had always liked it for its tab support, being light weight and also being available in Linux (a browser with better fonts for those days). Internet Explorer was slow and Firefox in its earlier versions was good but got quickly gloated with extensions and addons. Chrome is way to heavy.

So the good and bad thing in Opera is that it does not have too many addons. Without them the browser was solid and light weight. Without them, its features were limited so was good for browsing but lacked some features readily available on others. One of the features was to download flash streaming videos. Firefox and Chrome, both have good extensions to support it. Opera did not have it readymade and and all its supposed extensions were links to some video donwloader site which I don't prefer So how to do it.

Yes there's a way. Opera is known for its excellent cache and I tried to use it. Lets take the example of dailymotion from which say I want to download a video. So here are the steps:
  1. First clear the cache (Setting :: Delete Private Data)  - It will help us clear the old data and knowing new URLs will be easy. Later you will almost remember them.
    Before I move ahead, let me explain how things are working for video sites. First say a site like www.dailymotion.com will use another site (CDN) to deliver it content. For dailymotion its dmcdn.net similarly for youtube its ytimg.com. Also now the whole video is not delivered as one big file to the client browser. Its broken in to fragments. So now if you pause a video, you can see the download stop after some time i.e. after the fragment ends. This was always the case with dailymotion. With youtube, the download did not stop earlier but now even they too have implemented it. Its more like dowload on demand. So when the player reaches the end of fragment one, it starts downloading the fragment two. So here we go.
  2. After the cache is cleared, type in "opera:cache" in your browser location bar. It should show the cache as empty.
  3. Open dailymotion.com and search for say "gangnam style"
  4. Don't open the video. In the "opera:cache" tab now you will see URL's being cached
  5. Now play the video and pause it after 10 seconds. Refresh the cache now. Select the 4 checkboxes for video and then click the Preview link next to dmcdn.net. It will open a new tab:
  6.  Play the video for another 30 seconds and refresh the Cached Video list for dmcdn.net. You will find more items getting listed there.
  7.  Now have a close look at the URLs. They look like:
    1. http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/frag(1)/video/623/746/50647326_mp4_h264_aac.flv
    2. http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/frag(6)/video/623/746/50647326_mp4_h264_aac.flv
    3. http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/frag(4)/video/623/746/50647326_mp4_h264_aac.flv
  8.  From inspection, you can see that that the whole URL is same except for the frag(N) part.
  9.  So we now we have the URL of the whole video if we just remove the frag part. In the above case, it is : http://vid2.ak.dmcdn.net/sec(6f246bdc0f86287961fdadfc57ab38e2)/video/623/746/50647326_mp4_h264_aac.flv
  10. Open this link in a new tab and you can now save the video in you local disk.
Enjoy downloading videos. 

Hint: You can do the same in firefox using "about:cache" but with addons who will do all this :)

Sunday, March 15, 2009

Thru You

Thru You stands for:-
  1. The true power of internet.
  2. The creativity of the masses and not just classes. Normal humans do have creativity. All that needs is mixing them to create a masterpiece.
  3. Good music can be open and popular and not just copyrighted. Its on youtube for all to watch.
  4. The potential of viral marketing. Remember it just started with a mail to 20 people to over a million views in a week.
  5. Good people like Kutiman do exist.

Visit it for sure.

Friday, July 20, 2007

Did you know?

Its a cool video about whats going on and what may happen in future. Nice video packed with facts and is worth a view.



Did You Know?

Wednesday, May 16, 2007

Promoting your video

Yesterday I got a mail from my friend about some IIT Alumni meet where some IIT girl sang an (unexpectedly) good song.

Here is the song which was forwarded to me : http://nostaljigs.com/index.php?option=com_content&task=view&id=86.

The song seemed good to me and it is good (keeping a typical IIT prototype in mind).

I went to youtube to look for the same song so that I can download the same song and 'what the hell is it?'. She a well known pakistani singer. Went back to the original site and started reading the comments. The 1st page was all innocence and then from 2nd page onwards truth was out and people were baying for the blood of the poster.

Still its a good song worth listening quite a number of times.

And yes the video got promoted well, got a lot of hits to the site as well as youtube.

Friday, May 11, 2007

Alternative Rock

Dashboard Confessional - Stolen





After a long time heard some music so close to the genre of U2. May be after some more years, they come close to U2 themselves.

Here goes the 2 compositions of U2 which I believe brings the best out of them:

U2 - With Or Without You





U2 - Beautiful day



Thursday, May 10, 2007

Legal Videos @ MTV

After all the debate and discussion about illegal videos at youtube and other similar site and countries and corporations going for lawsuits against it - MTV has openly hosted all the latest and hot videos up at the site for voting.

One can go up here and watch those videos legally.

NJOI :)

The tenth dimension

I read a lot about string theory and its discourses on higher dimensions like the 10th or 11th or the 12th dimension. It was hard to perceive for my small mind. Then I came across this small video which explained the concept with relative ease and here it is.

http://www.tenthdimension.com/medialinks.php