Skip to content

Commit 31fd7c6

Browse files
committed
version 1.0
1 parent 047e2ed commit 31fd7c6

File tree

249 files changed

+30913
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+30913
-4
lines changed

.github/workflows/main.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Ubuntux64
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the main branch
8+
push:
9+
10+
pull_request:
11+
12+
13+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
14+
jobs:
15+
# This workflow contains a single job called "build"
16+
build:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
#拉取源码
24+
- uses: actions/checkout@v2
25+
with:
26+
fetch-depth: 1
27+
#aarch64
28+
- name: install aarch64
29+
shell: sh
30+
run: |
31+
wget https://github.com/UWVG/aarch64-none-linux-gnu/archive/refs/heads/master.zip
32+
unzip master.zip
33+
- name: make
34+
shell: sh
35+
run: make cross-compile="1"
36+
- uses: actions/upload-artifact@v2
37+
with:
38+
name: streamer
39+
path: streamer
40+
# tag 上传Release
41+
- name: uploadRelease
42+
if: startsWith(github.event.ref, 'refs/tags/')
43+
uses: svenstaro/upload-release-action@v2
44+
with:
45+
repo_token: ${{ secrets.GITHUB_TOKEN }}
46+
file: streamer
47+
asset_name: streamer
48+
tag: ${{ github.ref }}
49+
overwrite: true
50+
body: "This is auto-generated by Github Actions."

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424

2525
# Shared objects (inc. Windows DLLs)
2626
*.dll
27-
*.so
28-
*.so.*
2927
*.dylib
3028

3129
# Executables

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
#
3+
ifdef cross-compile
4+
CC := aarch64-none-linux-gnu-master/bin/aarch64-none-linux-gnu-gcc
5+
CFLAGS := -I rkmpp/inc -I ffmpeg/inc -w
6+
LDFLAGS := -L rkmpp/lib -L ffmpeg/lib -lrockchip_mpp -lavformat -lavcodec -lavutil -lpthread -Wl,-rpath ffmpeg/lib
7+
else
8+
CC := aarch64-linux-gnu-gcc
9+
CFLAGS := $(shell pkg-config --cflags rockchip_mpp) -w
10+
LDFLAGS := $(shell pkg-config --libs rockchip_mpp) -lavformat -lavcodec -lavutil
11+
endif
12+
13+
m_streamer : streamer.o rtmp.o v4l2.o mpp.o
14+
$(CC) -o streamer streamer.o rtmp.o v4l2.o mpp.o $(LDFLAGS)
15+
streamer.o : streamer.c
16+
$(CC) -c $(CFLAGS) streamer.c
17+
rtmp.o : rtmp.c
18+
$(CC) -c $(CFLAGS) rtmp.c
19+
v4l2.o : v4l2.c
20+
$(CC) -c $(CFLAGS) v4l2.c
21+
mpp.o : mpp.c
22+
$(CC) -c $(CFLAGS) mpp.c
23+
24+
25+
all : m_streamer
26+
clean :
27+
rm *.o

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,38 @@
1-
# streamer
2-
transform camera stream into h.264 stream via rk3399mpp
1+
# Streamer
2+
![GPL License](https://img.shields.io/github/license/DevoutPrayer/streamer) ![size](https://img.shields.io/github/repo-size/DevoutPrayer/streamer)
3+
4+
Develop on firefly RK3399 board and publish camera data into RTMP server.
5+
# Dependents
6+
1. ffmpeg(avformat avcodec avutil)
7+
2. rkmpp
8+
3. nginx rtmp server(optional) [[install reference]](https://blog.csdn.net/qq_32739503/article/details/83064132)
9+
# How to use
10+
*on-board compile*
11+
```
12+
git clone [email protected]:DevoutPrayer/streamer
13+
cd streamer
14+
make
15+
./streamer /dev/video0 rtmp://rtmp_server_addr/live/room
16+
```
17+
*cross compile*
18+
```
19+
git clone [email protected]:DevoutPrayer/streamer
20+
cd streamer
21+
wget https://github.com/UWVG/aarch64-none-linux-gnu/archive/refs/heads/master.zip
22+
unzip master.zip
23+
make cross-compile="1"
24+
```
25+
clone this project,checkout into one branch,make and run
26+
# Releases:
27+
*Streamer v1.0(@a59906c)*
28+
- get video data from camera through v4l2 libs
29+
- encode video raw data into h264 format via rk_mpp libs
30+
- now it can only support video raw data
31+
- jpeg format data should be decode before sending into encoder
32+
- mux the h264 flow into flv and send it via ffmpeg libs
33+
34+
# How to contribute
35+
1. Fork this branch.
36+
2. Commit your changes.
37+
3. Send pull requests.
38+

ffmpeg/inc/libavcodec/ac3_parser.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* AC-3 parser prototypes
3+
* Copyright (c) 2003 Fabrice Bellard
4+
* Copyright (c) 2003 Michael Niedermayer
5+
*
6+
* This file is part of FFmpeg.
7+
*
8+
* FFmpeg is free software; you can redistribute it and/or
9+
* modify it under the terms of the GNU Lesser General Public
10+
* License as published by the Free Software Foundation; either
11+
* version 2.1 of the License, or (at your option) any later version.
12+
*
13+
* FFmpeg is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16+
* Lesser General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU Lesser General Public
19+
* License along with FFmpeg; if not, write to the Free Software
20+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21+
*/
22+
23+
#ifndef AVCODEC_AC3_PARSER_H
24+
#define AVCODEC_AC3_PARSER_H
25+
26+
#include <stddef.h>
27+
#include <stdint.h>
28+
29+
/**
30+
* Extract the bitstream ID and the frame size from AC-3 data.
31+
*/
32+
int av_ac3_parse_header(const uint8_t *buf, size_t size,
33+
uint8_t *bitstream_id, uint16_t *frame_size);
34+
35+
36+
#endif /* AVCODEC_AC3_PARSER_H */
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of FFmpeg.
3+
*
4+
* FFmpeg is free software; you can redistribute it and/or
5+
* modify it under the terms of the GNU Lesser General Public
6+
* License as published by the Free Software Foundation; either
7+
* version 2.1 of the License, or (at your option) any later version.
8+
*
9+
* FFmpeg is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12+
* Lesser General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU Lesser General Public
15+
* License along with FFmpeg; if not, write to the Free Software
16+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef AVCODEC_ADTS_PARSER_H
20+
#define AVCODEC_ADTS_PARSER_H
21+
22+
#include <stddef.h>
23+
#include <stdint.h>
24+
25+
#define AV_AAC_ADTS_HEADER_SIZE 7
26+
27+
/**
28+
* Extract the number of samples and frames from AAC data.
29+
* @param[in] buf pointer to AAC data buffer
30+
* @param[out] samples Pointer to where number of samples is written
31+
* @param[out] frames Pointer to where number of frames is written
32+
* @return Returns 0 on success, error code on failure.
33+
*/
34+
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples,
35+
uint8_t *frames);
36+
37+
#endif /* AVCODEC_ADTS_PARSER_H */

0 commit comments

Comments
 (0)