Monday, May 12, 2014

Easy way to grab frames from .ts files in Linux

The VLC player will play .ts files obtained from TV broadcasts (obtained as indicated below, although I now recommend formatting Personal Video Recorder/PVR hdd's with the Ext4 format). However, VLC doesn't do such a good job of stepping through .ts files frame by frame, as you will find if you try it. 

So, I tried OpenShot, but I couldn't find a way to get it to extract frames at full resolution, and it eventually played a dirty trick by replacing itself with an error message. 

OpenShot's dirty trick backfired, because as a result I went on to discover that VLC does an excellent job of stepping through .ts files which have been converted to an mp4 format by Handbrake, with essentially zero effort and little if any loss of resolution. The conversion can take a long time, but you can convert just the sections of interest, one at a time, by specifying the range for each conversion, which you can obtain by "sliding" through the .ts file with the VLC player.

VLC doesn't have a button to step backwards, but you can use the slider to "rewind" the video a bit if you overshoot, and then step forward with the single-step button. Once you find the frame you want, you can save it with the snapshot button.