Tuesday, February 11, 2020

Windows FFMPEG Script to transcode video files from H.264/MPEG-4 to H.265/HEVC, using NVENC hardware acceleration on NVIDIA GPU


I  recently put some effort into converting all my H.264 video files into H.265 format, and this is the best setting I found. On a RTX 2070 Super, I get about 250+ fps, on average; a feature length film in 1080p takes about 6 minutes to convert.

@echo off
for %%a in ("*.mkv") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mkv"
for %%a in ("*.m4v") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mp4"
for %%a in ("*.mp4") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mp4"
for %%a in ("*.avi") do ffmpeg.exe -vsync 0 -hwaccel cuda -i "%%a" -c:v hevc_nvenc -preset llhq -rc vbr_hq -cq 21 -c:s copy -acodec copy "D:\tmp\H.265\%%~na.mp4"

The key is using the "-hwaccel cuda" option, which keeps the output of NVDEC decoder output on the GPU's framebuffer for NVENC encoder to work on. This way your CPU utilization is kept low and keep GPU's encoder at 100%.

Sunday, April 8, 2018

Plex playback error

Recently I started experiencing Plex playback issues on my XBox One. As it turned out, I inadvertently (ignorantly) changed the Plex App’s Video => Maximum H.264 Level setting to 5.1.

FYI, the Plex app on XBox One only supports H.264 Level 4.0 and below, as documented here:

https://support.plex.tv/articles/203810286-what-media-formats-are-supported/

After I changed the setting to 4.0, all my videos encoded at >4.0 started playing again, my Plex server transcoding them in real time!

Monday, June 12, 2017

Random thought of the day

It occurred to me today, that being (financially) rich means having assets that generate income to sustain your livelihood. Being poor is having to perform other activities in lieu of having those assets. So, one’s financial goal in life shouldn’t be simply making more money every year, but rather acquiring income generating assets over time to become self-sustaining. In other words, don’t buy things unless they are going to generate income!

Monday, March 30, 2015

How to Cut and Paste files in OS X Finder


  1. Command-C to place files/folders in Clipboard for copying
  2. Command-Option-V to move those files/folders in Clipboard


Sunday, October 12, 2014

Getting plot to work in Octave OS X installation

I am new to Octave, and when I attempted to plot something using the plot() function, I was getting this error:

gnuplot> set terminal aqua enhanced title "Figure 1"  font "*,6" dashlength 1
                      ^

         line 0: unknown or ambiguous terminal type; type just 'set terminal' for a list

After some Google search and experimentation, here's the solution I found to work. You need to edit "octaverc" file in the following path:


sudo vi /usr/local/octave/3.8.0/share/octave/site/m/startup/octaverc 

(FYI, I have the version 3.8.0 above, so yours may be installed in a different folder.)

In that file, add this line at the end:


setenv("GNUTERM","qt")

Save the file, and that GNUTERM environment variable will be set every time you run octave. This works for OS X Maverick.

Others have also reported the following to work (instead):

setenv("GNUTERM","X11")

I suspect that works for folks who installed XQuartz, which is an X11 implementation for OS X that is no longer included in more recent versions of OS X.

Roy

Friday, June 13, 2014

How to fix iPad no sound issue

I ran into a weird issue, where I wasn't getting any sound in some apps like Hooked on Phonics and Sky Fish.  I tried reinstalling those apps, quitting all other apps, etc. as some suggested, but they didn't work for me.

Then it occurred to me, that some software may not have been written correctly to work with the Lock Rotation / Mute switch; what if the developer assumes the switch is only used for Mute?  I decided to test out that hypothesis, so proceeded to my Settings screen, changed my current selection back to Mute (which is the iOS default), and Voila, it worked!!!

What's more interesting, is that once the "problem was fixed", I was able to go back to the Lock Rotation setting, and vice versa, and those apps were no longer having issues.  So, I am thinking that there could be some bug in the iOS - possibly with its Restore feature, as this iPad was recently restored from its iCloud backup - that is not properly setting some of the internal bits regarding the sound device availability (whatever that's linked to the Lock Rotation / Mute physical switch);  it's possible that that switch was on the Mute position when it was restored (but then why didn't other apps have issues?).

Anyway, I hope this is helpful to those having a similar issue.

Roy