On Fri, 23 Jun 2017 00:27:43 +0100, Andy Furniss wrote:
> Johnny B Good wrote:
>> On Tue, 20 Jun 2017 19:50:43 +0100, Andy Furniss wrote:
>
>>> Compress! They've already been murdered, you want to kill them more
>>> :-)
>>
>> Quite honestly? No, not really. All I really want to do is top and tail
>> the surplus paddings out and convert from the TS format to the
>> appropriate PS format just as I was doing with the SD m2t transport
>> stream files when 'converting' them to MPG programme stream files with
>> MpegStreamClip in my winXP VM (which I was then able to submit to
>> Handbrake as ready to transcode MPG files with no need to specify in
>> and out points).
>
> OK, with SD mpeg2 + post processing to h264 isn't totally pointless,
> though the interlaced issue still exists.
Be that as it may, using Handbrake to transcode my mpeg2 recordings into
more compact .h264 mkv files with no perceptible drop in quality has been
a Ghodsend in saving valuable disk space on my 17TB fileserver (a
homebrewed NAS4Free box)
>
> With >= h264 post processing isn't needed as it's built in, so there
> isn't really any gain in encoding again to h264.
I had hoped that Handbrake had been written to intelligently avoid
unnecessary transcoding just as MpegStreamClip does when cleaning up the
so-called MPG output files generated by DTVR's "record as mpeg2" option
back in the days of recording Freeview broadcasts in windows 2000.
>
> h265 maybe, but then it doesn't really handle interlaced "properly" like
> h264 does (or can assuming the right params are used).
I don't really want to push encoding any further than the extreme
of .h264. A simple topping and tailing .h264 editor will suit me just
fine, thank you very much. :-)
>
>> I'm no expert on what is a very complex subject, video format standards
>> and codecs, so tend to leave the presets well alone (other than perhaps
>> to select a de-noise filtering option and/or manually crop older 4:3
>> and extra-wide-screen aspect ratio material when the BBC4's DOG has
>> confused the shit out of Handbrake's auto-cropping feature).
>
> Yea - it's not simple at all, you really need to take account of the
> source and ffmpeg/libx264 with or without a frontend are complex.
>
>> Ok Andy, thanks for that advice. It seems I need a simple .h264
>> transport to program stream converter/editor along the lines of
>> MpegStreamClip or maybe something even cruder such as MpegCut2 to
>> simply trim off the surplus end and start paddings. You wouldn't happen
>> to have any particular video editing software you'd care to recommend
>> by any chance?
>
> Unfortunately as I don't usually edit anything I record, I can't help -
> I just leave as is and skip forward with the player (not vlc for HD).
>
> With transport streams you can just cut the files with dd using a
> blocksize of 188 - not exactly user friendly!
It might be a better option that'll allow me to revert back to the
earlier version of Handbrake which I've just realised had been processing
the "Shaun the Sheep" episodes twice as fast as the latest version is
doing. :-( I'm not happy with the changes in the GUIs of *every* new
version of Linux related 'upgrades' (apps and desktop environments alike).
>
> Another way so you could at least use times is getting ffmpeg to cut but
> not encode again using -c copy. This only works if you want another
> transport stream (mkv should work but currently doesn't) other
> containers may/will not like the sound stream, as UK DVB is a bit
> peculiar in using aac in latm.
>
> If you don't care about audio description or subs you could seek and
> specify a time like
>
> ffmpeg -i infile -c copy -ss 2:35 -t 1:05:10 outfile.ts
>
> would seek to 2 min 35 and output the next 1 hour 5 minutes and 10
> seconds. It would remux to a new transport stream. If you wanted to keep
> the ad and subs more would be needed.
This need to examine each file with VLC or another media player with 'to
the second' seek accuracy just to manually take note of the in and out
points so the same can be used with ffmpeg's CLI or, as I've tried,
setting these points in the hours/minutes selection boxes in Handbrake is
what made use of a windows XP virtual machine to run MpegStreamClip such
an attractive option [1].
Unfortunately, I can't employ the programme start flags used by the
broadcasters to achieve an "Exact Record" function using Kaffeine. As far
as I know, the only option I have is Kaffeine's excellent conflict free
padding mechanism to overcome the broadcasters' "Scheduling Twattery"(tm)
[2].
Up until I started experimenting with DVB-T2 HD broadcasts, I've been
able to take full advantage of this conflict free padding using
MpegStreamClip to process Kaffeine's m2t mpeg transport stream files into
mpeg programme stream files (or even re-edit mpeg PS files into
differently sized mpeg PS files with no further processing loss other
than for the "on the fly converted to PS" mpg recordings made by DTVR
which proved to be inflated by 0.14% of, presumably FEC leftovers which
effected the earlier versions of windows media player's seek bar
functionality.
In this case, if I wasn't sure whether I'd already 'converted' such mpg
recordings, I simply ran them through MpegStreamClip to see whether the
output remained the same size or landed up shrunk by that signature
0.14%. If they didn't shrink, I knew they'd already been processed so
could choose to keep either file otherwise the output file was "The
Keeper" and I could discard the original. It was that simple. I could
safely re-process an mpg file as much as I liked without MpegStreamClip
"Fixing it some more" (in the American sense of 'breaking it some more'
derived from the principle of "If it ain't broke, don't fix it!").
MpegStreamClip was downloaded primarily to let me convert the Toppy's
*.rec files (mpg TS recordings) into proper mpg PS media files. Not only
did it prove itself as an efficient 'converter' of TS to PS files, it
also proved to be a better editor than the very basic "Mpg2Cut2" 'slice
and dice' editor I'd previously used for topping and tailing my padded
recordings eventually revealing the reason as to why DTVR's "MPG" files
could be so troublesome to navigate by completely curing the problem.
Unfortunately, its developer never created a Linux port so it remains
purely a win32 compatible application, hence the use of VirtualBox and a
winXP VM to run it in.
I've installed the DVB-T2 adapter into the Al Fresco test rig[3] but,
in spite of a second fresh install of LM18.1 and Kaffeine 2.0.9 I can't
quite emulate the initial success I had testing on the current desktop
hardware using the LM18.1 installed to the 180GB Intel series 300 SSD
whilst it had been connected to the Al Fresco test rig.
The 'deal breaker' is that the whole machine locks up (not just the
Kaffeine app alone) after viewing SD or HD material 'Live' for more than
half a minute to a maximum, so far, of 5 minutes. I've tried all the
usual hardware checks (I know better than to assume that *all* desktop
computer problems will be purely software issues alone) to no avail.
There's a problem which didn't show up when I was testing on the current
desktop hardware suggesting that I need to commit to a distro upgrade on
this desktop machine before I can make any further progress. I was rather
hoping to do a lot more testing before taking this 'final step'. :-(
[1] With SD recordings, every so often (2 or 3 times a day), I'd move
Kaffeine's *.m2t files from the root of my home folder (where I could
readily keep an eye on them) into the "TV Recordings (Kaffeine)" folder
which was read/write shareable in the winXP VM.
I could then maximise the VM window and move said files into one of the
two 100GB virtual disks (one per physical HDD on the system) set up to
provide much higher read/write performance than the VBox shares could
ever offer so that the following MpegStreamClip processing could run some
20 to 25 times quicker (8 seconds per 29 minute SD file versus 3 1/2
minutes when I'd been using the VBox shares directly).
Yes, there was the extra "Faff" and the 5 to 15 minutes waiting for
files to be moved from the VBox share into the working folder on the
virtual disk but this investment of 'time and effort' was more than amply
rewarded by the 20/25 fold boost in speed during the "Hunched over the
keyboard" actual processing by MpegStreamClip periods.
The bulk moving of files between VBox shares and virtual disks was a
"Fire and forget" operation that left me free to do other more important
things than merely sit at a console awaiting the moment I could continue
with the next stage of the operation.
[2] Back in the early days of DTVR under win2k, I used padding rules
tuned to each BBC channel (DTVR didn't provide a "Global Padding" option
- I had to calculate them on a case by case basis). The magnitude order
in which such scheduling twattery was applied to each channel went BBC1,
BBC2, BBC4/BBC3. That is to say I needed 3+7 minutes for a BBC1
programme, 2+6 minutes for BBC2 and 1+4 minutes for the "Digital Only"
BBC channels. Apart from "unexpected sports" and news events, it was rare
to lose the start or end of a programme due to 'scheduling slippage',
nevertheless, it did happen on occasion.
When I started using Kaffeine which allowed me to pick directly from the
epg rather than manually program each channel/time/duration into its
recording schedule, I made good use of the global padding feature,
initially going for a 3+7 minute padding rule until BBC1 manage to break
the 3 minute start padding (or possibly the 7, in practice 8, minute end
padding) when I reset it to the 5+10 minutes of padding I'm using today.
In fact this is so much padding that the 3 back to back recordings of
"Shaun the Sheep", "Shaun the Sheep" and "Strange Hill High" being
recorded earlier this afternoon on CBBC, I happened to notice were all
being streamed to the disk simultaneously. Not too surprising a result
when the 15 minutes of padding happens to be 3 times the 'notional' 5
minute scheduling slot time interval (7 minutes in reality) of the "Shaun
the Sheep" episodes.
Provided there's a simple means of topping and tailing to the nearest GoP
(1/2 second in the case of BBC SD material) when archiving Freeview aired
programmes, even outrageous paddings (say 10 + 30 minutes) can be used
with impunity thanks to Kaffein'e padding agnostic character. Given
enough disk storage space, you can use a "Shoot First, Ask Questions
Later." recording strategy (it's easy enough to delete, what upon later
inspection proves to be, a rubbish media file yet so impossible to undo
"neglecting to schedule a potentially interesting programme" that has
passed you by).
Unfortunately, topping and tailing such paddings on the T2 HD programme
material isn't going to be so pleasant a task unless I can find an HD
version of MpegStreamClip (whether a win32 or a Linux compatible app it
matters very little - but preferably a Linux utility if its UI isn't too
terribly broken).
[3] The major problem with Al Fresco testing is the lack of backplate
support for any adapter cards in the expansion slots. Not a major problem
with the old ISA boards (now non-existent on any MoBo less than a couple
of decades old). Even PCI and full length PCIe adapters are reasonably
stable with regard to edge connector contact reliability but when dealing
with a single lane PCIe DVB-T2 adapter with a couple of CT100 cables
hanging off its rear panel Belling Lee aerial sockets, there's an even
greater risk of causing a system crash if any of the connections are
disturbed. However, I don't think it was this that was causing the lockups
in this case.
I've just fired the test rig up again. Live view of BBC2 SD crashed
after 100 seconds. Rebooted and applied the AMD cpu micro-code update and
rebooted ok. I clicked the TV icon in Kaffeine (it's run each time at
boot up from the startup script) and then stopped the live play and
picked the current "Horrible Histories" on CBBC HD to add to the schedule
and monitored the growth of the m2t file until it stopped after just 5
minutes with the whole machine locked up (which result does offer the
consolation that it wasn't something missed in recording HD content over
a 7 hour period using the desktop hardware just because I didn't happen
to try watching Kaffeine's Live TV window for more than a minute or so).
Further power cycled reboots later revealed that Kaffeine would resume
the interrupted scheduled recording ok. The subsequent resumption crashed
after only about half a minute whilst on the second resumption with only
just on a minute left, it managed to finish the scheduled recording
without crashing.
The problem with the test rig does rather suggest a driver issue. I'd
like to try transferring the adapter to the single lane PCIe slot but the
Chipset heat sink is currently fouling all but short single lane
adapters. I'm rather tempted to trim 6mm off the fouling end of that
heatsink so as to complete a "No Stone Unturned" hardware test before
being forced to update to LM18.1 on my desktop machine.
However, there *is* one more thing left for me to try and that is the
kernel update to ver 4.4.0-81.104 (a level 5 update in Update Manager
which remains currently unselected). I notice there are three other
updates which I'm now applying. If one *is* going to chance a kernel
update, this is the best time to try it, on a system that's only being
used for testing rather than a 'production' system that needs to carry on
working without missing a beat.
Well, I've just updated the kernel and Kaffeine locked the system after
only about half a minute of watching BBC2 SD so that didn't help any. I
guess the only remaining option is the hacksaw job on that pesky heatsink!
--
Johnny B Good