futzu / SCTE-35_SuperKabuki

SCTE-35 Inserter for MPEGTS. SuperKabuki is SCTE-35 Packet Injection for Ad Insertion, powered by threefive.
https://github.com/futzu/SuperKabuki
BSD 2-Clause "Simplified" License
12 stars 2 forks source link

SuperKabuki loses TS codec and stream information #2

Closed jcekstrom-xumo closed 1 year ago

jcekstrom-xumo commented 1 year ago

When running in a simple form:

$ python -m superkabuki -i /tmp/0_2319569.ts -o output.ts -t
Writing output.ts

The new output.ts information does not match the original.

OUTPUT

$ mediainfo output.ts
General
ID                                       : 1 (0x1) 
Complete name                            : output.ts
Format                                   : MPEG-TS
File size                                : 98.8 KiB

$ ffprobe output.ts
ffprobe version 4.3.5-0+deb11u1 Copyright (c) 2007-2022 the FFmpeg developers
...
[mpegts @ 0x55c230d77700] Could not find codec parameters for stream 2 (Unknown: none ([134][0][0][0] / 0x0086)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'output.ts':
Duration: 00:00:05.02, start: 1.445333, bitrate: 161 kb/s
  Program 1
    Stream #0:2[0x86]: Unknown: none ([134][0][0][0] / 0x0086)
    Stream #0:0[0x100]: Video: h264 (High), yuv420p(progressive), 256x144 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
  No Program
    Stream #0:1[0x101]: Audio: aac (LC), 48000 Hz, stereo, fltp, 37 kb/s
Unsupported codec with id 0 for input stream 2

ORIGINAL

$ mediainfo orig.ts
General
ID                                       : 1 (0x1)
Complete name                            : /tmp/0_2319569.ts
Format                                   : MPEG-TS
File size                                : 98.0 KiB
Duration                                 : 4 s 900 ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 158 kb/s

Video
ID                                       : 256 (0x100)
Menu ID                                  : 1 (0x1)
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L1.2
Format settings                          : CABAC / 4 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 4 frames
Codec ID                                 : 27
Duration                                 : 5 s 0 ms
Bit rate mode                            : Variable
Maximum bit rate                         : 96.0 kb/s
Width                                    : 256 pixels
Height                                   : 144 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Writing library                          : x264 core 148
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=4 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=96 / vbv_bufsize=60 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00

Audio
ID                                       : 257 (0x101)
Menu ID                                  : 1 (0x1)
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Format version                           : Version 4
Muxing mode                              : ADTS
Codec ID                                 : 15-2
Duration                                 : 4 s 970 ms
Bit rate mode                            : Variable
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -22 ms

$ ffprobe orig.ts
ffprobe version 4.3.5-0+deb11u1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
...
Input #0, mpegts, from '/tmp/0_2319569.ts':
  Duration: 00:00:05.02, start: 1.445333, bitrate: 159 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
    Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 256x144 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
    Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 37 kb/s
futzu commented 1 year ago

I cannot possibly know, because this output is fabricated. Please don't do that.


$ ffprobe orig.ts                       < ---  Is this the file? 
ffprobe version 4.3.5-0+deb11u1 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
...
Input #0, mpegts, from '/tmp/0_2319569.ts':      <--- Why is this different. 
  Duration: 00:00:05.02, start: 1.445333, bitrate: 159 kb/s
  Program 1

What information is different and why is it an issue?

I am unable to recreate your error, please send me your input file .

futzu commented 1 year ago

I'm not trying to be a dick, I cannot recreate the problem, that's why I need the input file and to know how this causing you an issue. To add SCTE-35 packets, I have to first create a SCTE-35 stream to hold them.

futzu commented 1 year ago

I think I found where I am confusing media info, however, I don't yet have a solution, but it should work now, except with mediainfo. Ffmpeg and threefive both should see it correctly. Are you having issues outside of mediainfo?
I am trying to help you man, I'd appreciate a reply.

futzu commented 1 year ago

pip up to v.0.0.43 Everything except mediainfo sees the SCTE-35 stream correctly. mediainfo now displays all the streams except the SCTE-35 stream correctly.

futzu commented 1 year ago

If you are going to participate, I'm going to close the issue.