https://github.com/superkabuki/ffmpegscte-35patch
Patch ffmpeg to let SCTE-35 streams pass through as SCTE-35
https://github.com/superkabuki/ffmpegscte-35patch
adrianofdoom adtech ffmpeg patched scte-35 scte35 threefive3
Last synced: 23 days ago
JSON representation
Patch ffmpeg to let SCTE-35 streams pass through as SCTE-35
- Host: GitHub
- URL: https://github.com/superkabuki/ffmpegscte-35patch
- Owner: superkabuki
- Created: 2025-02-06T23:08:39.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-02-17T08:39:54.000Z (2 months ago)
- Last Synced: 2025-02-17T09:30:48.891Z (2 months ago)
- Topics: adrianofdoom, adtech, ffmpeg, patched, scte-35, scte35, threefive3
- Homepage:
- Size: 41 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FFmpegSCTE-35patch
### FFmpeg changes mpegts SCTE-35 Streams (__0x86__) into bin data Streams (__0x06__).
### This is a patch for FFmpeg to let SCTE-35 mpegts Streams copy over as SCTE-35 Streams.
---## How does it work?
* The patch is only nine lines of code, it allows you copy a SCTE-35 stream over as SCTE-35, when you're encoding with ffmpeg.
* The patch also adds the SCTE-35 Descriptor __(CUEI / 0x49455543)__ , just to be fancy.
* Everything else works just like unpatched ffmpeg.
---## How to use:
### These are all super important.
* map the SCTE-35 stream to the output file like `-map 0` or maybe `-map 0:d` etc..
* Set the SCTE-35 stream to copy like `-dcodec copy` or `-c copy` etc..
* Use `-copyts` if you want your SCTE-35 and PTS to stay aligned
* Use `-muxpreload 0` and `-muxdelay 0` to avoid the 1.4 second start bump
---## Install
1. Clone [this repo](https://github.com/superkabuki/FFmpeg)
2. cd FFmpeg-superkabuki-patched
3. Configure ffmpeg ( _do this with whichever options you like_ )
* I used
```js
./configure --enable-shared --enable-libx264 --enable-libx265 --enable-nonfree --enable-gpl --extra-version=-superkabuki-patch```
4. make all
5. sudo make install
---# Examples
## Example 1: Re-encode video to H265 and copy over the SCTE-35
* original file
* ffmpeg command
* new file
---
## Example 2: Copy all streams, including SCTE-35, and cut the first 200 seconds.
* original file
* ffmpeg command
* new file
> Notice the start time and duration have both changed by ~200 seconds.
* old
```js
Duration: 00:04:56.30, start: 72667.595200, bitrate: 962 kb/s
```
* new
```js
Duration: 00:01:37.75, start: 72866.141867, bitrate: 962 kb/s
```
---