Editing recordings on the box


This is something I raised on the Wishlist thread, but I'd like to discuss it a bit further to see whether it might be possible to achieve it via the command line, and then maybe through the web interface.

If we were able to chop portions of a file out without corrupting it, then that'd give us basic editing of recordings. I could see a command line tool allowing you to specify a start+end period to chop out. Is this viable?

Once that's possible, it could get hooked into the web interface, maybe with a bit more fancy display that allows you to input multiple edits, and grabs a frame out of the video (is this even possible?).. perhaps with a slider so you can easily find+confirm the sections to chop.

Is all this pie in the sky?
One thing that strikes me is the limited memory and processing power available. The place to start would be to search for existing Linux utilities that do this job.
True true, depends on how complex it is to cut stuff out of it; if it doesn't require a re-encode or anything fancy then maybe it'll be okay. There's an open source MPEG toolbox here, but that doesn't support MPEG4


There's AviDemux which supposedly does, and works on a variety of platforms.. I'll give that a try on Windows first.. when I can get my 1 month old daughter to sleep again ;-)

I've just tried extracting a thumbnail image from a recording on the box itself using ffmpeg.. it's not working for some reason.

humax# ffmpeg -y -i ZingZillas_20110618_0817.ts -f singlejpeg -ss 10 -vframes 1 -s 150x100 -an zingthumb.jpg
ffmpeg version 0.8, Copyright (c) 2000-2011 the FFmpeg developers
built on Jul 19 2011 22:54:47 with gcc 4.2.0 20070124 (prerelease) - BRCM 11ts-20090508
configuration: --cross-prefix=mipsel-linux- --enable-cross-compile --arch=mipsel --target-os=linux --enable-gpl --enable-libmp3lame --disable-static --enable-shared --disable-asm --prefix=/mod --extra-cflags=-fPIC
libavutil 51. 9. 1 / 51. 9. 1
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 4. 0 / 53. 4. 0
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 23. 0 / 2. 23. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0
ZingZillas_20110618_0817.ts: could not find codec parameters
That's the error message I get when trying to use ffmpeg as well.

Just a thought, have you decrypted your test file?
Ah, maybe that's the problem.. I'll look into it after I've finished messing with avidemux
You were right.. it wasn't decryped.. I've pushed back a copy of a file that has been pushed to USB, then chopped using AVIDemux, and then FTP'd to the box. FFmpeg is now saying;

Input #0, mpegts, from 'OOglies_20110305_1024.ts':
Duration: N/A, start: 0.000000, bitrate: N/A
Program 1
Stream #0.0[0x44]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 64:45 DAR 16:9], 15000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0.1[0x45](eng): Audio: mp2, 48000 Hz, stereo, s16, 256 kb/s (hearing impaired)
[NULL @ 0x4304b0] Requested output format 'singlejpeg' is not a suitable output format
thumb.jpg: Invalid argument

So I guess I just need to work out what command it'd be happy with.
I've pushed back a decrypted file after cutting portions out of it using avidemux. However, when I attempt playback on the TV it says the content is scrambled. Do I need to do something to make the .ts valid in the eyes of the box? Apologies for the n00b questions, but I'm just getting into this after a minor success editing the auto-filer script to sort out episode titles :-D
The Humax expects to find it encrypted on the internal drive, there is a current discussion on one of the other threads about flags which have to be changed (I'll edit this post when I look up the reference). If you have an external drive or a virtual drive, put it on there and it should play.

Update: click here. The latest incarnation of the hmt utility should be able to mark it as not encrypted for playback from the internal drive.
Cool. I updated all my packages this morning. So I just run..

hmt -encrypted recording.ts

and that should make it playable? Just playing with avidemux to see if I can trim down a recording on a Windows PC and still have the recording play back properly.
Is all this pie in the sky?
Yes, I'm afraid so. Every single frame of recorded video is indexed in the .nts file. If you cut a portion out of the .ts file then the index in the .nts file is no longer valid and will not playback. And it's no small job to recreate a new .nts file. This is what AV2HDR has to do for the Foxsat HDR to import non-native recordings
I think you can delete the sidecar files leaving just the .ts and it should play, but you'll lose things like FF/REW & skip.
I think some people would be happy to lose the ff/rwd/skip functionality for most kids TV episodes & be glad to get some disk space back. I've not had much luck being able to play back files edited on a PC using avidemux.