News:

--

Main Menu

cutting trouble

Started by charly4711, June 11, 2018, 10:48:24 PM

Previous topic - Next topic

charly4711

Hi,
having this problem with cutting stuff from a video, form the start, the end, in the middle ...
I read about i-frames vs. b-frames and decided I wanted to reencode anyway, thus felt reasonably safe.
However, whenever I cut scenes, the final video always stops at the first thing I cut out from the middle of the video.
This happens when pressing the play button in avidemux and also in the exported video, though I can manually move the cursor on the timeline and edit later scenes.
It happens with both 2.6 and 2.7.1. Tried multiple video codecs and multiple muxers with no difference.

Am I missing something?

Jan Gruuthuse

#1
You don't provide enough details of what is going on so we can't guess what is happening.
What is your source video? If there are transmission errors in the video that could explain somehow.
- what is the source video container, size, duration and the used codecs?
- what is the target video container, size, duration and the used codecs?
- what is your workflow
- OS, hardware,
- ...
best  when you have prepared such a video, save this as project:
Avidemux menu: File: Project Script: Save As Project.
attach the save project.py file to your posting. Maybe we can start guessing what is going on.

charly4711

The input is a recording made by my DVB-S receiver that I converted using ffmpeg, because avidemux couldn't even open the original video in an mpeg ts container. The video I'm trying to edit now is:

Input #0, avi, from 'shadow_of_the_vampire.avi':
  Metadata:
    encoder         : Lavf58.16.100
  Duration: 02:11:55.50, start: 0.000000, bitrate: 3251 kb/s
    Stream #0:0: Video: mpeg2video (Main) (mpg2 / 0x3267706D), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 3043 kb/s, 50 fps, 25 tbr, 50 tbn, 50 tbc
    Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 192 kb/s

I've tried several target containers and codecs, among those:

avi, mpeg-p
mp4, mpeg2 (with reencoding to fix frames broken by cutting out i-frames)

I'm doing this on an iMac: macOS 10.13.4 (High Sierra) 3,4 GHz i7 12 GB RAM

I have no particular workflow to speak of: I just loaded the video, select output parameters, configure filter for cropping the frames, cut out a bit from the start and a bit at around 00:25 (with more to cut that I left out for testing purposes).

eumagga0x2a

Quote from: charly4711 on June 12, 2018, 02:02:46 PM
The input is a recording made by my DVB-S receiver that I converted using ffmpeg, because avidemux couldn't even open the original video in an mpeg ts container.

Please provide the first ~200 MiB of this source TS file as a sample.

QuoteThe video I'm trying to edit now is:

Input #0, avi, from 'shadow_of_the_vampire.avi':
  Metadata:
    encoder         : Lavf58.16.100
  Duration: 02:11:55.50, start: 0.000000, bitrate: 3251 kb/s
    Stream #0:0: Video: mpeg2video (Main) (mpg2 / 0x3267706D), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 3043 kb/s, 50 fps, 25 tbr, 50 tbn, 50 tbc

The video might be field-encoded. This won't work in an AVI container, at least not without re-encoding. Re-encoding works only if we don't get stuck somewhere due to broken, undecodable frames.

The project script can't help to identify the problem. BTW, using the inferior xvid codec needs a very good justification nowadays. When the source is interlaced, you really should use a good deinterlacing filter (yadif).

charly4711

Hmm, ok ... since you were all suggesting there was something wrong with the original input video, I took the original and reencoded it with ffmpeg making sure to actually not use and stream copies. That did give some warnings:


    Stream #0:0[0x24](deu): Subtitle: dvb_teletext ([6][0][0][0] / 0x0006)
    Stream #0:1[0x7ff]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:2[0x800](deu): Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s (clean effects)
    Stream #0:3[0x805]: Unknown: none ([5][0][0][0] / 0x0005)
  Program 4004
  Program 4020
  Program 4027
  Program 4033
Please use -q:a or -q:v, -qscale is ambiguous
Stream mapping:
  Stream #0:1 -> #0:0 (mpeg2video (native) -> mpeg4 (native))
  Stream #0:2 -> #0:1 (mp2 (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mp4, to '/Users/khb/sotv.mp4':
  Metadata:
    encoder         : Lavf58.12.100
    Stream #0:0: Video: mpeg4 (mp4v / 0x7634706D), yuv420p, 720x576 [SAR 64:45 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 12800 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.18.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
    Stream #0:1(deu): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (clean effects)
    Metadata:
      encoder         : Lavc58.18.100 aac
[mpeg2video @ 0x7ffdfb00a800] ac-tex damaged at 8 320:13.72 bitrate=3841.2kbits/s dup=20 drop=0 speed=1.09x   
[mpeg2video @ 0x7ffdfb00a800] Warning MVs not available
[mpeg2video @ 0x7ffdfb00a800] concealing 180 DC, 180 AC, 180 MV errors in I frame
[mpegts @ 0x7ffdfb00a200] PES packet size mismatch:11:51.56 bitrate=3813.4kbits/s dup=24 drop=0 speed= 1.1x   
[mpeg2video @ 0x7ffdfb00a800] ac-tex damaged at 1 13
[mpeg2video @ 0x7ffdfb00a800] Warning MVs not available
[mpeg2video @ 0x7ffdfb00a800] concealing 1035 DC, 1035 AC, 1035 MV errors in I frame
frame=197891 fps= 28 q=0.0 Lsize= 3689376kB time=02:11:55.60 bitrate=3818.2kbits/s dup=26 drop=0 speed= 1.1x   
video:3560446kB audio:124517kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.119780%
[aac @ 0x7ffdfb01ba00] Qavg: 181.000


The resulting video I could edit without any trouble.
So, I guess you were right and I just wish I knew how to tell whether a video is broken that way, because I could view it just fine, before. Seems to me the players (and ffmpeg, too, as it could somehow fix things) are more resilient, here.

eumagga0x2a

You mentioned that Avidemux was incapable of loading the source TS file. This was what I wanted to investigate.

Jan Gruuthuse

make a timed recording, if possible 10 seconds or max 1 minute.
And Upload Hochladen Télécharger Subir the recorded video so developers can investigate the original mpeg-ts recording of your DVB-S receiver.

charly4711

I'll see what I can do ... might be a day or two.

charly4711

Ahem ... tried a few other recordings of said receiver and they don't expose the problem.
Seems if avidemux cannot load a recording, that's a good indication that there's maybe something wrong with it. Now, I feel embarrassed.
I mean, there'd still be the thing that ffmpeg somehow fixed whatever was wrong with the original file, but as I don't have that anymore, I'm afraid there's no way to say what exactly was wrong. I promise to not delete evidence as quickly, next time.
Seems I'm good for now ... thanks for the help.