A Sky, cable and digital tv forum. Digital TV Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Digital TV Banter forum » Digital TV Newsgroups » uk.tech.digital-tv (Digital TV - General)
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

uk.tech.digital-tv (Digital TV - General) (uk.tech.digital-tv) Discussion of all matters technical in origin related to the reception of digital television transmissions, be they via satellite, terrestrial or cable. Advertising is forbidden, with no exceptions.

snipping ts files neatly



 
 
Thread Tools Display Modes
  #1  
Old December 16th 14, 10:18 AM posted to uk.tech.digital-tv,uk.comp.os.linux
Jim Lesurf[_2_]
external usenet poster
 
Posts: 4,126
Default snipping ts files neatly

I'd be interested in info on simple programs to let me 'snip' a long ts
file into shorter segments at playback times that suit me.

I'm aware that the ts file is packeted, and have in the past experimented
simply with using dd to snip oup sections to new files that respect the
packet boundaries. However its clear that I also need to respect the
locations of some of the metadata packets that specifiy details.

I don't want to change or recodec the contents, although a conversion that
simply removes the ts 'wrapper' and gives me the same content in a more
useable file format might make sense.

This is all for HDTV ts streams I've recorded. e.g. A typical file might be
about 3GB in size and have a playback duration of, say, around an hour. It
may contain items such that I want to split it into sections that begin at
specific times. e..g. a concert where I want files which each start with a
successive item of music. Same data as the source file, but now in a
consecutive series of smaller files.

Happy to do the actual splitting via command line as I can determine the
relevant instants by first using VLC or similar.

Advice and info?

Jim

--
Please use the address on the audiomisc page if you wish to email me.
Electronics http://www.st-and.ac.uk/~www_pa/Scot...o/electron.htm
Armstrong Audio http://www.audiomisc.co.uk/Armstrong/armstrong.html
Audio Misc http://www.audiomisc.co.uk/index.html

  #2  
Old December 16th 14, 10:35 AM posted to uk.tech.digital-tv,uk.comp.os.linux
Andy Burns[_9_]
external usenet poster
 
Posts: 389
Default snipping ts files neatly

Jim Lesurf wrote:

I'm aware that the ts file is packeted, and have in the past experimented
simply with using dd to snip oup sections to new files that respect the
packet boundaries. However its clear that I also need to respect the
locations of some of the metadata packets that specifiy details.


I can understand that there might be better and worse packet boundaries
at which to cut, in terms of allowing a playback program to quickly
"see" what's in the file, but can any boundary actually be considered
wrong?

Is it "disrespectful" if I turn on my TV at the wrong point in the stream?

  #3  
Old December 16th 14, 11:54 AM posted to uk.tech.digital-tv,uk.comp.os.linux
JohnT[_8_]
external usenet poster
 
Posts: 59
Default snipping ts files neatly


"Jim Lesurf" wrote in message
...
I'd be interested in info on simple programs to let me 'snip' a long ts
file into shorter segments at playback times that suit me.

I'm aware that the ts file is packeted, and have in the past experimented
simply with using dd to snip oup sections to new files that respect the
packet boundaries. However its clear that I also need to respect the
locations of some of the metadata packets that specifiy details.

I don't want to change or recodec the contents, although a conversion that
simply removes the ts 'wrapper' and gives me the same content in a more
useable file format might make sense.

This is all for HDTV ts streams I've recorded. e.g. A typical file might
be
about 3GB in size and have a playback duration of, say, around an hour. It
may contain items such that I want to split it into sections that begin at
specific times. e..g. a concert where I want files which each start with a
successive item of music. Same data as the source file, but now in a
consecutive series of smaller files.

Happy to do the actual splitting via command line as I can determine the
relevant instants by first using VLC or similar.

Advice and info?


The HDTV streams will be encrypted. How do you intend to overcome that
problem?

--
JohnT

  #4  
Old December 16th 14, 12:36 PM posted to uk.tech.digital-tv,uk.comp.os.linux
Jim Lesurf[_2_]
external usenet poster
 
Posts: 4,126
Default snipping ts files neatly

In article , JohnT
wrote:


The HDTV streams will be encrypted. How do you intend to overcome that
problem?


I can only say that, as recorded, they play fine here on my Linux boxes
using VLC as well as on my new TV. I can also use ffmpeg, etc, on them. The
'however' is...

That when I've experimented with using dd to snip sections, these don't
always play nicely and show various oddities.

Hence so far as I can tell, the Freeview HDTV ts files I've recorded aren't
encrypted.

FWIW they are recorded simply by using a 290e tuner via USB and saving the
packets relevant for a chosen 'channel' to a file. I've also made full-mux
recordings this way, and when playing those with VLC can choose which
'channel' on the mux to play. Works fine in general. But problems arise
when I try to produce a chunk edited from the recorded file, although I did
snip at packet boundaries.

Jim

--
Please use the address on the audiomisc page if you wish to email me.
Electronics http://www.st-and.ac.uk/~www_pa/Scot...o/electron.htm
Armstrong Audio http://www.audiomisc.co.uk/Armstrong/armstrong.html
Audio Misc http://www.audiomisc.co.uk/index.html

  #5  
Old December 16th 14, 01:21 PM posted to uk.tech.digital-tv,uk.comp.os.linux
NY
external usenet poster
 
Posts: 933
Default snipping ts files neatly

"Jim Lesurf" wrote in message
...
I'd be interested in info on simple programs to let me 'snip' a long ts
file into shorter segments at playback times that suit me.

I'm aware that the ts file is packeted, and have in the past experimented
simply with using dd to snip oup sections to new files that respect the
packet boundaries. However its clear that I also need to respect the
locations of some of the metadata packets that specifiy details.

I don't want to change or recodec the contents, although a conversion that
simply removes the ts 'wrapper' and gives me the same content in a more
useable file format might make sense.

This is all for HDTV ts streams I've recorded. e.g. A typical file might
be
about 3GB in size and have a playback duration of, say, around an hour. It
may contain items such that I want to split it into sections that begin at
specific times. e..g. a concert where I want files which each start with a
successive item of music. Same data as the source file, but now in a
consecutive series of smaller files.

Happy to do the actual splitting via command line as I can determine the
relevant instants by first using VLC or similar.

Advice and info?


I use VideoRedo for splitting WTV, MPG, DVR-MS and TS files (all SD, not HD)
and this works very well. It can also handle MP4 files that are downloaded
from Youtube, and I'm sure some of these use H264 compression like HDTV
does.

Since I don't have an HDTV-to-USB adaptor, I don't have any sample files to
experiment with, so I can't comment on how well it handles off-air HDTV
recordings.

However my understanding of the way VideoRedo works is that it remakes and
recodecs any partial packets at points where commercials and continuity are
snipped out so as to produce legal output files, even if a few packets may
have shorter GOPs (groups of pictures) than the standard GOP size that the
broadcaster has used.

  #6  
Old December 16th 14, 01:54 PM posted to uk.tech.digital-tv,uk.comp.os.linux
Tony Houghton[_3_]
external usenet poster
 
Posts: 6
Default snipping ts files neatly

In ,
Andy Burns wrote:

Jim Lesurf wrote:

I'm aware that the ts file is packeted, and have in the past experimented
simply with using dd to snip oup sections to new files that respect the
packet boundaries. However its clear that I also need to respect the
locations of some of the metadata packets that specifiy details.


I can understand that there might be better and worse packet boundaries
at which to cut, in terms of allowing a playback program to quickly
"see" what's in the file, but can any boundary actually be considered
wrong?

Is it "disrespectful" if I turn on my TV at the wrong point in the stream?


I think when saving a TS file it "should" (in the RFC sense) start with
a PAT and PMT and then the first respective video and audio packets
should start with key frames. Such packets occur frequently in broadcast
streams so if you turn on your TV at the wrong point it just waits until
it's got the start packets it needs. Most players should be able to do
that with TS files too, but it seems Jim's had problems in that area. In
theory you could save a bit of disc space by filtering out all meta
packets such as PAT and PMT after the ones at the start of the file, but
I think in reality even if they're repeated more than once a second the
amount of data is tiny compared to the video and audio so it isn't worth
it unless you're also going to remux to another wrapper format with less
overhead.

It's quite easy to hack a program to add a copy of the PAT and PMT to
the start of each file it saves from splitting a larger one, but I
suppose there's no guarantee that key video and audio frames will occur
together, so it might need to reorder some packets to honour that.
  #7  
Old December 16th 14, 03:23 PM posted to uk.tech.digital-tv,uk.comp.os.linux
Tim Jones[_2_]
external usenet poster
 
Posts: 12
Default snipping ts files neatly

I regularly use VideoReDo for editing BBC/ITV/Channel4 HD programmes
recorded in TS format on my Humax Foxsat DVR. Never have any problems
with the edits. Highly recommended.
  #8  
Old December 16th 14, 03:30 PM posted to uk.tech.digital-tv,uk.comp.os.linux
NY
external usenet poster
 
Posts: 933
Default snipping ts files neatly

"Tim Jones" wrote in message
...
I regularly use VideoReDo for editing BBC/ITV/Channel4 HD programmes
recorded in TS format on my Humax Foxsat DVR. Never have any problems
with the edits. Highly recommended.


Has anyone else noticed with VideoRedo that it can shuttle through
MPEG-compressed files (.mpg, .dvr-ms, .wtv) very quickly but it is very
jerky when shuttling through the same file saved as .mp4 with any of the
codec that it supports? Is there something about MP4 codecs that makes them
slower to decode when moving the timeline bar rapidly to find a given place
in a file (eg the start/end of commercials).

Otherwise, it's a superb program - well worth the licence cost.

  #9  
Old December 16th 14, 04:01 PM posted to uk.tech.digital-tv,uk.comp.os.linux
Jim Lesurf[_2_]
external usenet poster
 
Posts: 4,126
Default snipping ts files neatly

In article , Tony Houghton
wrote:
In , Andy Burns
wrote:



Is it "disrespectful" if I turn on my TV at the wrong point in the
stream?


I think when saving a TS file it "should" (in the RFC sense) start with
a PAT and PMT and then the first respective video and audio packets
should start with key frames.


I've been wondering if that happens but as yet I've not checked. I did
write a 'pid sniffer' for the recorded files ages ago but have now
forgotten the details. (Back then my interest was in analysing the packet
stream, not editing.)


Such packets occur frequently in broadcast streams so if you turn on
your TV at the wrong point it just waits until it's got the start
packets it needs. Most players should be able to do that with TS files
too, but it seems Jim's had problems in that area.


I'd experimented with snipping a set of packets off the start of a given
file. This then gave weird problems with the TV's media player. The picture
was breaking up for the first few seconds. Later on the picture froze with
the audio still playing blythly. Then the video resumed but played at a
'fast forward' rate as the audio continued as nothing odd was happening to
the video. :-)

Not sure if the player had realised the two were out of synch and was
trying to 'catch up' or had simply become hopelessly confused by not gette
the metadata it needed in the way it expected.

Conversely, all the files 'as recorded' play with the TV media player, yet
a few freeze at the start with VLC! Most are fine.

I'll see if I can find my pidsniffer as it would itemise where it found PAT
and PMT packets. If there is always a couple at the start of my recordings
using the 290e I'll try pasting copies to edits made with dd or similar to
see if that makes the TV player happy!

BTW Out of curiosity I also just tried playing some VOB files ripped from a
home recorded DVD-RW (Panasonic DVD videorecorder) and the TV media
player does play them. Just has no idea how long they are so you can only
get 'play' and 'pause' to work meaningfully. Presumably the content needs
're-containering' in a suitable way.

I'll have a look at VideoRedo, but I don't really want a full editor. Just
something that will snip safely and do any 'fix' like add required metadata
packets as per above via command line. I'm also curious about the 'license'
mentioned.

Jim

--
Please use the address on the audiomisc page if you wish to email me.
Electronics http://www.st-and.ac.uk/~www_pa/Scot...o/electron.htm
Armstrong Audio http://www.audiomisc.co.uk/Armstrong/armstrong.html
Audio Misc http://www.audiomisc.co.uk/index.html

  #10  
Old December 16th 14, 04:58 PM posted to uk.tech.digital-tv,uk.comp.os.linux
NY
external usenet poster
 
Posts: 933
Default snipping ts files neatly

"Jim Lesurf" wrote in message
...
I'll have a look at VideoRedo, but I don't really want a full editor. Just
something that will snip safely and do any 'fix' like add required
metadata
packets as per above via command line. I'm also curious about the
'license'
mentioned.


VideoReDo isn't a full editor. It can't do transitions, effects etc. Its
main purpose is to remove selected portions of a video stream, and to join
the remaining parts together in a way that (hopefully) results in a legal
standard-conforming stream. Apart from decoding and re-encoding a few frames
around each cut point, it simply copies source file to destination with no
recoding.

It *can* re-encode the whole stream if you also want to convert from one
format to another (eg MPEG to MP4 or making a DVD) and it can add menu
titles and burn a DVD, though those are (in my mind) extra features on top
of its main purpose.

The only annoying thing is that if you work with low bitrate source files
(eg from Yesterday or Drama), the joins can be a bit pixellated because it
re-encodes them less efficiently than the broadcaster can do, so the same
bitrate results in more noticeable artefacts at the joins - a bit like being
able to see the splicing tape when editing cine film. It would be better if
it used a higher bit rate at the joins than the average in the rest of the
file, if to do do would prevent visible artefacts.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 01:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.SEO by vBSEO 2.4.0
Copyright 2004-2017 Digital TV Banter.
The comments are property of their posters.