Extract a chunk from TS file ?

*nix specific usage questions
rmvb
Blank Cone
Blank Cone
Posts: 47
Joined: 19 Oct 2011 11:14
Operating System: Linux

Extract a chunk from TS file ?

Postby rmvb » 10 Sep 2016 14:24

Hi
I recorded from my set top box freebox a file which appears to be a TS file. The recording is far too long and I'd like to cut out the end.
I found I can add :stop-time=3755 in the advanced options of the Open/Convert dialog. The original file works as is, so I'd rather not convert it to another format/container so I created a profile base on settings I found in a TS preset one and checked both keep video and audio, but this ends in 0 byte file. When I choose "Record raw stream" from the dialog I get "Unsupported operation" (VLC2.1.6 Ubuntu 14.04.5 amd64)
I have no debian-multimedia repo in my system.

Please what do I wrong ?

Thank you for advises

kmf31
Cone that earned his stripes
Cone that earned his stripes
Posts: 308
Joined: 11 Mar 2007 21:47

Re: Extract a chunk from TS file ?

Postby kmf31 » 11 Sep 2016 14:29

multicat works perfectly to cut "chunks from a TS file":

http://www.videolan.org/projects/multicat.html

and it also belongs to the videolan project.

It compiles very easily and well from the sources (nearly no other lib necessary).

After compilation/installation:
1) create a kind of index using the command "ingests -p <PCR PID> $FILE"
which comes with the package and where PCR PID is the video PID of your file (to find this run your file in vlc and look in "codecs" etc.).

2) multicat -f -k $T1 -d $T2 -a $FILE $OUTFILE
where $T1=start-time in seconds multiplied with 27000000 and
$T2=length in seconds multiplied with 27000000

(you can write a script to do the multiplication and have more "confort" in calling multicat etc.). More details in README file and man-page of this package.

This works much better/faster than TS-cutting with vlc and it is much more reliable for the precise end-time. It also perfectly conserves the TS-structure (including all audio and subtitle tracks etc.).

rmvb
Blank Cone
Blank Cone
Posts: 47
Joined: 19 Oct 2011 11:14
Operating System: Linux

Re: Extract a chunk from TS file ?

Postby rmvb » 11 Sep 2016 22:20

Thank you very much man, even v2.0.3 from ubuntu14.04 repos did the job. No need to compile :)

Newbies like me, be aware that man multicat is much smaller than multicat -h
Before I discovered this I ran the kfm31 command without -f & -k (fortunately the chunk I needed started at 00:00:00 which
is the default when -k is omitted).

Something else : when reading the input file from the same usb(3) stick to which I wrote the output I got
"warning: too much lateness, resetting clocks" several times. I Ctrl^C'ed then restarted giving my SSD as target drive : no more error

Great VLC team :))

User avatar
InTheWings
Developer
Developer
Posts: 1275
Joined: 07 Aug 2013 13:15
VLC version: crashing
Operating System: Linux
Contact:

Re: Extract a chunk from TS file ?

Postby InTheWings » 18 Sep 2016 13:13

That's ts. Non precise cuts can just be done with truncate.
:!: If you want your problem to be solved :
* First read troubleshooting guide VSG:Main
* Always provide verbose LOGS ! (command line or from gui)
* Always check your issue against a developer build from Nightly Build of VLC
* Tell us when your problem is solved !


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 15 guests