anyc / avcut

Frame-accurate video cutting with only small quality loss
GNU General Public License v2.0
112 stars 13 forks source link

avcut does not work with the new OTR-HD format #18

Open geimist opened 4 years ago

geimist commented 4 years ago

OTR is currently implementing a new HD-Format. When trying to cut these files with avcut, it ends with this error:

Input #0, avi, from '/volume1/video/_synOTR/_decodiert/Wunderwelt_Erde_20.03.31_11-00_arte_45_TVOON_DE.mpg.HD.avi': 
Metadata: 
    comment         :  
    encoder         : Lavf58.42.100
    encoded_by      : www.onlinetvrecorder.com
  Duration: 01:00:48.52, start: 0.000000, bitrate: 2277 kb/s
    Stream #0:0: Video: h264 (Main) (H264 / 0x34363248), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2067 kb/s, 50 fps, 50 tbr, 50 tbn, 100 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 192 kb/s
Settings from profile:
  Preset: medium
  Tune: film
  x264opts: direct=auto:aq-mode=3:force-cfr=1:b-adapt=2:rc-lookahead=60:weightp=0
[libx264 @ 0x2bbb840] using SAR=1/1
[libx264 @ 0x2bbb840] using cpu capabilities: none!
[libx264 @ 0x2bbb840] profile Main, level 3.2
Output #0, avi, to '/volume1/video/_synOTR/Wunderwelt_Erde_20.03.31_11-00_arte_45_TVOON_DE.mpg.HD.avi-cut.avi':
  Metadata:
    comment         :  
    encoder         : Lavf58.42.100
    encoded_by      : www.onlinetvrecorder.com
    Stream #0:0: Video: h264 (libx264), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 50 tbn, 100 tbc
    Stream #0:1: Audio: mp3, 48000 Hz, stereo, s16p, 192 kb/s
size mismatch 249:6238 247:3863 (diff: 0, try: -2375)
packet for frame 249 (cpn 249) not found

Would a customized profile be sufficient to correct this error? Unfortunately I have no idea which parameters are necessary for this.

geimist commented 4 years ago

A user has found out about these profile settings, but unfortunately they do not work here yet.

avcut_otr_newHD.profile

preset=veryfast
tune=film
x264opts=pic-struct:sps-id=1:stitchable
geimist commented 3 years ago

Has no one an idea? 😥

anyc commented 2 years ago

Sorry for the late response, I do not have much time to invest in avcut anymore.

After encoding or decoding, avcut needs to match the input item (frame or packet) to the output item. This is more difficult with codecs like h264 as, after decoding for example, we do not immediately get the frame after calling the decode function with a packet. In this case, it failed to find the matching frame or packet because the sizes did not match.

I just released a new version with a fix related to this, could you test it again?

If it does not work, an example video would help analyzing the issue. If that is not (legally) possible, please build avcut with "make debug" and send the output.