Skip to content

Commit 541b2bb

Browse files
committed
feat: Initial setup and ts-info tool
0 parents  commit 541b2bb

20 files changed

+851
-0
lines changed

.github/workflows/go.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
platform: [macos-latest, ubuntu-latest, windows-latest]
16+
go-version: ["1.19"]
17+
runs-on: ${{ matrix.platform }}
18+
steps:
19+
- name: Setup Go
20+
uses: actions/setup-go@v3
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Download Go dependencies
28+
run: go mod download
29+
env:
30+
GOPROXY: "https://proxy.golang.org"
31+
32+
- name: Build
33+
run: go build -v ./...
34+
35+
- name: Test
36+
run: go test -v ./...

.github/workflows/golangci-lint.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: golangci-lint
2+
on:
3+
push:
4+
tags:
5+
- v*
6+
branches:
7+
- master
8+
pull_request:
9+
workflow_dispatch:
10+
jobs:
11+
golangci:
12+
name: lint
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: golangci-lint
18+
uses: golangci/golangci-lint-action@v3
19+
with:
20+
args: --skip-files=xml
21+
only-new-issues: true
22+
23+
- name: go-report-card
24+
uses: creekorful/[email protected]
25+
with:
26+
only-new-issues: true
27+

.gitignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the make coverage target
12+
coverage.*
13+
14+
# Dependency directories (remove the comment below to include it)
15+
vendor/

.vscode/settings.json

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"markdownlint.config": {
3+
"MD024": {
4+
"siblings_only": true
5+
},
6+
"MD041": false,
7+
"MD046": false
8+
},
9+
"cSpell.words": [
10+
"asticode",
11+
"astits",
12+
"AVCPES",
13+
"Demuxer",
14+
"Eyevinn",
15+
"golangci",
16+
"NALU",
17+
"nalus",
18+
"PPSNAL",
19+
"ppsnalus",
20+
"spsnalu",
21+
"spss",
22+
"stretchr"
23+
]
24+
}

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
- Nothing yet
11+
12+
## [0.1.0] - 2024-01-15
13+
14+
### Added
15+
16+
- initial version of the repo
17+
- ts-info tool
18+
19+
[Unreleased]: https://github.com/Eyevinn/dash-mpd/compare/v0.1.0...HEAD
20+
[0.1.0]: https://github.com/Eyevinn/dash-mpd/releases/tag/v0.1.0

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Eyevinn Technology AB.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
.PHONY: all
2+
all: test check coverage build
3+
4+
.PHONY: build
5+
build: ts-info
6+
7+
.PHONY: prepare
8+
prepare:
9+
go mod tidy
10+
11+
ts-info:
12+
go build -ldflags "-X github.com/Eyevinn/mp2ts-tools/internal.commitVersion=$$(git describe --tags HEAD) -X github.com/Eyevinn/mp2ts-tools/internal.commitDate=$$(git log -1 --format=%ct)" -o out/$@ ./cmd/$@/main.go
13+
14+
.PHONY: test
15+
test: prepare
16+
go test ./...
17+
18+
.PHONY: coverage
19+
coverage:
20+
# Ignore (allow) packages without any tests
21+
set -o pipefail
22+
go test ./... -coverprofile coverage.out
23+
set +o pipefail
24+
go tool cover -html=coverage.out -o coverage.html
25+
go tool cover -func coverage.out -o coverage.txt
26+
tail -1 coverage.txt
27+
28+
.PHONY: check
29+
check: prepare
30+
golangci-lint run
31+
32+
.PHONY: update
33+
update:
34+
go get -t -u ./...
35+
36+
clean:
37+
rm -f out/*
38+
39+
install: all
40+
cp out/* $(GOPATH)/bin/
41+

README.md

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
![Test](https://github.com/Eyevinn/mp2ts-tools/workflows/Go/badge.svg)
2+
[![golangci-lint](https://github.com/Eyevinn/mp2ts-tools/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/Eyevinn/mp2ts-tools/actions/workflows/golangci-lint.yml)
3+
[![GoDoc](https://godoc.org/github.com/Eyevinn/mp2ts-tools?status.svg)](http://godoc.org/github.com/Eyevinn/mp2ts-tools)
4+
[![Go Report Card](https://goreportcard.com/badge/github.com/Eyevinn/mp2ts-tools)](https://goreportcard.com/report/github.com/Eyevinn/mp2ts-tools)
5+
[![license](https://img.shields.io/github/license/Eyevinn/mp2ts-tools.svg)](https://github.com/Eyevinn/mp2ts-tools/blob/master/LICENSE)
6+
7+
# mp2ts-tools - A collection of tools for MPEG-2 TS
8+
9+
MPEG-2 Transport Stream is a very wide spread format for transporting media.
10+
11+
This repo provides some tools to facilitate analysis and extraction of
12+
data from MPEG-2 TS streams.
13+
14+
## ts-info
15+
16+
`ts-info` is a tool that parses a TS file, or a stream on stdin, and prints
17+
information about the video streams.
18+
For AVC (H.264), it shows information about
19+
PTS/DTS, PicTiming SEI, SPS and PPS, and NAL units.
20+
21+
## How to run
22+
23+
You can download and install any tool directly using
24+
25+
```sh
26+
> go install github.com/Eyevinn/mp2ts-tools/cmd/ts-info@latest
27+
```
28+
29+
If you have the source code you should be able to run a tool like
30+
31+
```sh
32+
> cd cmd/ts-info
33+
> go mod tidy
34+
> go run .
35+
```
36+
37+
Alternatively, you can use the Makefile to build the tools
38+
or make a coverage check. The Makefile will set the version depending
39+
on the Git commit used.
40+
41+
## Commits and ChangeLog
42+
43+
This project aims to follow Semantic Versioning and
44+
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
45+
There is a manual [ChangeLog](CHANGELOG.md).
46+
47+
## License
48+
49+
MIT, see [LICENSE](LICENSE).
50+
51+
## Support
52+
53+
Join our [community on Slack](http://slack.streamingtech.se) where you can post any questions regarding any of our open source projects. Eyevinn's consulting business can also offer you:
54+
55+
* Further development of this component
56+
* Customization and integration of this component into your platform
57+
* Support and maintenance agreement
58+
59+
Contact [[email protected]](mailto:[email protected]) if you are interested.
60+
61+
## About Eyevinn Technology
62+
63+
[Eyevinn Technology](https://www.eyevinntechnology.se) is an independent consultant firm specialized in video and streaming. Independent in a way that we are not commercially tied to any platform or technology vendor. As our way to innovate and push the industry forward we develop proof-of-concepts and tools. The things we learn and the code we write we share with the industry in [blogs](https://dev.to/video) and by open sourcing the code we have written.
64+
65+
Want to know more about Eyevinn and how it is to work here. Contact us at <[email protected]>!

0 commit comments

Comments
 (0)