# Playing TV recordings



## balanga (Nov 7, 2018)

What programs are available on FreeBSD for playing TV recordings? I tried VLC but that doesn't work.

The recordings were made on an Android box and each recording has an associated *.ts and *.amdur file.

I tried multimedia/mplayer and that outputs audio but no video.


----------



## Phishfry (Nov 7, 2018)

ts=transport stream=h.264
Slap it in multimedia/handbrake and see what it says. It is a good tool for investigating video.


----------



## olli@ (Nov 7, 2018)

balanga said:


> What programs are available on FreeBSD for playing TV recordings? I tried VLC but that doesn't work.
> 
> The recordings were made on an Android box and each recording has an associated *.ts and *.amdur file.
> 
> I tried multimedia/mplayer and that outputs audio but no video.



*.ts files are MPEG transport streams. This is just a container format that can contain various types of video and audio codecs, for example h.264 or h.265 video, AC3 or MP2 audio, and so on. Both VLC and mplayer basically support MPEG transport streams. But in your case, it seems they don't have been built with support for the particular codecs inside your files.

First of all, I recommend you install multimedia/mediainfo. That's a handy little command line tool that will tell you which codecs are inside a media file. For example, I have a bunch of *.ts files for which `mediainfo` outputs something like this (shortened):

```
General
Format               : MPEG-TS

Video
Format               : AVC
Format/Info          : Advanced Video Codec

Audio
Format               : AC-3
Format/Info          : Audio Coding 3
Commercial name      : Dolby Digital
```
In this case the video is MPEG AVC (also known as h.264; HEVC would be h.265) and the audio is AC3. These may be different for your files, of course. So you should check whether your player (VLC, mplayer or whatever) has been built with support for those particular codecs. If not, you should rebuilt the port with support for those codecs enabled (run `make config` in the port's directory).


----------



## balanga (Nov 7, 2018)

I just installed it but get:



> root@Vbox:~# HandBrake
> Shared object "libmp3lame.so.0" not found, required by "HandBrake"



Do I understand correctly that this is a format conversion tool and that I need to change the format before I can play it?


----------



## Phishfry (Nov 7, 2018)

Well you need to look at the ts and see what codec it uses. Handbrake is good for determining if your stream is good.
Some funky devices have weird i-frames or other quirks and may not play back correctly.
Handbrake is your magnifying glass. Scope out your file first.
mediainfo sounds great too. You just need to look at the files with something. Maybe you need transcoding or maybe its a bad capture or odd format.


----------



## balanga (Nov 7, 2018)

olli@ said:


> First of all, I recommend you install multimedia/mediainfo.




```
General
ID                                       : 1600 (0x640)
Complete name                            : TVN HD--20181101223416.ts
Format                                   : MPEG-TS
File size                                : 5.89 GiB
Duration                                 : 2 h 34 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 438 kb/s

Video
ID                                       : 532 (0x214)
Menu ID                                  : 15821 (0x3DCD)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format version                           : Version 2
Format profile                           : Main@L4
Codec ID                                 : 27
Duration                                 : 2 h 34 min
Maximum bit rate                         : 13.0 Mb/s
Frame rate                               : 25.000 FPS
Chroma subsampling                       : 4:2:0
Encryption                               : Encrypted

Audio #1
ID                                       : 820 (0x334)
Menu ID                                  : 15821 (0x3DCD)
Format                                   : MPEG Audio
Format profile                           : Layer 2
Codec ID                                 : 4
Bit rate mode                            : Constant
Maximum bit rate                         : 328 kb/s
Compression mode                         : Lossy
Language                                 : Polish
Encryption                               : Encrypted

Audio #2
ID                                       : 821 (0x335)
Menu ID                                  : 15821 (0x3DCD)
Format                                   : AC-3
Format/Info                              : Audio Coding 3
Codec ID                                 : 6
Duration                                 : 2 h 34 min
Bit rate                                 : 448 kb/s
Maximum bit rate                         : 459 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                         : Lossy
Stream size                              : 497 MiB (8%)
Language                                 : org
Encryption                               : Encrypted
```

Not sure how to check if multimedia/vlc supports this....


----------



## Phishfry (Nov 7, 2018)

> Shared object "libmp3lame.so.0" not found, required by "HandBrake"


Sounds to me like your using a stale ports tree or old packages. Lame was broke around 2-3 months ago and since fixed.


----------



## balanga (Nov 7, 2018)

Phishfry said:


> or maybe its a bad capture or odd format.



It plays OK on my Android decoder.


----------



## Phishfry (Nov 7, 2018)

I really dont care for VLC. It has so many features and none of them work very well.
It should playback rtsp streams but it chokes. I could go on and on. Nice menu though...
My two players are mplayer and multimedia/xine


----------



## Phishfry (Nov 7, 2018)

One thing to note is with VLC you should configure it for your graphics card  for best success.
https://wiki.videolan.org/VLC_GPU_Decoding/


----------



## Phishfry (Nov 7, 2018)

My video editing box also has multimedia/mpv/ installed.


----------



## Phishfry (Nov 7, 2018)

If you checkout the port history you will see it was not Lame itself that was broken but simply a license issue.
audio/lame


----------



## balanga (Nov 7, 2018)

Phishfry said:


> My video editing box also has multimedia/mpv/ installed.



Many thanks.

multimedia/mpv/ works!!

Can't find an option for selecting files though.... Not a big fan of drag n' drop...


----------



## balanga (Nov 7, 2018)

Phishfry said:


> If you checkout the port history you will see it was not Lame itself that was broken but simply a license issue.
> audio/lame



I would have thought that multimedia/handbrake would have updated any dependencies.... 

Am I correct in thinking I need to build audio/lame myself because of license restrictions?


----------



## Phishfry (Nov 7, 2018)

The port wasn't broke but packages were in July and August. Fixed at end of August.(edit August 11th commit to be exact)
They marked the port as RESTRICTED because of the license issue.
The port still built correctly.
It really put me in a bad spot because "you should not mix ports and pakages" and then you end up with non-functioning programs because of an "upgrade" and the port is not actually broke. Just the binaries could not be distributed because of RESTRICTED status. So I understand why but it really hurts the way it happened over wording of a license.
Especially on a popular piece of software affecting many other packages.


----------



## balanga (Nov 7, 2018)

Just found that multimedia/kodi is able to play my recordings...


----------



## Beastie (Nov 7, 2018)

balanga said:


> Am I correct in thinking I need to build audio/lame myself because of license restrictions?


Exactly.



balanga said:


> multimedia/mpv works!!
> 
> Can't find an option for selecting files though.... Not a big fan of drag n' drop...


What do you mean? multimedia/mpv is (mostly) a command-line software. The only graphical interface it has is for playing videos (i.e. video controls).


----------



## Phishfry (Nov 7, 2018)

Looks like Beastie is right . I am actually using the 3.100 release before restrictions of 3.100_1.
Only on new installs is it broke for pkg.

```
kook@E6420:~ # pkg info lame
lame-3.100
Name           : lame
Version        : 3.100
Installed on   : Sat Jul  7 06:56:24 2018 EDT
Origin         : audio/lame
Architecture   : FreeBSD:11:amd64
Prefix         : /usr/local
Categories     : audio
Licenses       : LGPL20+
Maintainer     : netchild@FreeBSD.org
WWW            : http://lame.sourceforge.net/
Comment        : Fast MP3 encoder kit
Options        :
    DOCS           : on
Shared Libs provided:
    libmp3lame.so.0
Annotations    :
    FreeBSD_version: 1101001
    repo_type      : binary
    repository     : FreeBSD
Flat size      : 1.97MiB
Description    :
LAME is an highly evolved LGPL MP3 encoder with quality and speed able to
rival state of the art commercial encoders.

WWW: http://lame.sourceforge.net/
```


----------



## Phishfry (Nov 7, 2018)

Remembering why I hate lawyers so much.
https://lists.freebsd.org/pipermail/freebsd-ports/2017-May/108415.html


----------



## tankist02 (Nov 7, 2018)

Upvote for mpv. Small, fast, plays everything. You can use it from command line or from a file browser, including context menu.


----------

