Author Topic: Trimming video: AVD ignores first 5 seconds  (Read 209 times)

MiMoHo

  • Newbie
  • *
  • Posts: 5
Trimming video: AVD ignores first 5 seconds
« on: January 04, 2017, 03:34:40 PM »
I'm trying to trim a H.264 video in MP4 and MKV containers within the first seconds but AVD cuts only if I set key A later than 5 seconds from the beginning of the video. Tried it several times by checking the exported file. I'm using the MP4 Muxer and pass-through of video and audio stream. This issue does not appear at the end of the clip. Tried to split with QuickTime 7 and 10 as well but the result there is a very pixelated start of the video.

AVD 2.6.16
Mac OS X 10.11.6

mean

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10742
Re: Trimming video: AVD ignores first 5 seconds
« Reply #1 on: January 04, 2017, 07:44:04 PM »
Does your video start at zero ?

MiMoHo

  • Newbie
  • *
  • Posts: 5
Re: Trimming video: AVD ignores first 5 seconds
« Reply #2 on: January 04, 2017, 10:15:39 PM »
Don't get that question. For sure it does start at zero like every video file.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 779
Re: Trimming video: AVD ignores first 5 seconds
« Reply #3 on: January 04, 2017, 11:07:10 PM »
Most videos don't start at zero, though the delay rarely exceeds 1/5 of a second. Load the source video in Avidemux, what time is shown on the time display at the bottom left (after you hit the "Pos 1" or "Home" button)? In copy mode, a cut must start at a keyframe.

MiMoHo

  • Newbie
  • *
  • Posts: 5
Re: Trimming video: AVD ignores first 5 seconds
« Reply #4 on: January 06, 2017, 04:56:15 PM »
The video starts at 00:00.033. Tried the very latest build 2.6.18 but it's still the same: AVD does not cut within the first 5 seconds

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 4872
Re: Trimming video: AVD ignores first 5 seconds
« Reply #5 on: January 06, 2017, 05:14:24 PM »
@ around 5 seconds into video:
- Select cut only with 1x keyboard up arrow, 1x keyboard down arrow. (not left or right arrow)
- Mark [A ].
- Eventually select an end point in the video and mark [ B].
- Save the video now, does this work?

I've seen video with key index frame larger then 5 seconds.

If this did not work either: can you upload such video (100-300MB max, 10 seconds duration max, more or less)

Upload:
Use a free dropbox account, https://www.wetransfer.com/, mega or similar webservice (free public access, without registration to download your uploaded video) thank you.

MiMoHo

  • Newbie
  • *
  • Posts: 5
Re: Trimming video: AVD ignores first 5 seconds
« Reply #6 on: January 06, 2017, 10:42:00 PM »
When I press arrow up after start, it jumps to second 5,3, when I press down it goes back to the very beginning. Find the video file here: https://we.tl/xA73quwemR

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 779
Re: Trimming video: AVD ignores first 5 seconds
« Reply #7 on: January 06, 2017, 11:59:12 PM »
Works for me saving in copy mode with the marker A at the zero, at the first keyframe (00:00:00.033) or at the second keyframe (00:00:05.371), then loading and playing the resulting video in mpv, ffplay or in Avidemux itself. The quality of the video is very poor, but ADM or a player can't help it.

ADM 2.6.18
Fedora 24

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 4872
Re: Trimming video: AVD ignores first 5 seconds
« Reply #8 on: January 07, 2017, 07:36:17 AM »
Works for me saving in copy mode with the marker A at the zero, at the first keyframe (00:00:00.033) or at the second keyframe (00:00:05.371), then loading and playing the resulting video in mpv, ffplay or in Avidemux itself. The quality of the video is very poor, but ADM or a player can't help it.

ADM 2.6.18
Fedora 24
You have to use [00:00:05.371] and can't set the index @ [00:00:05.000] in copy mode.

MiMoHo

  • Newbie
  • *
  • Posts: 5
Re: Trimming video: AVD ignores first 5 seconds
« Reply #9 on: January 12, 2017, 12:38:27 AM »
Works for me saving in copy mode with the marker A at the zero, at the first keyframe (00:00:00.033) or at the second keyframe (00:00:05.371), then loading and playing the resulting video in mpv, ffplay or in Avidemux itself. The quality of the video is very poor, but ADM or a player can't help it.

ADM 2.6.18
Fedora 24
You have to use [00:00:05.371] and can't set the index @ [00:00:05.000] in copy mode.

I don't mind one or two frames difference but I'd like to cut after two or three seconds in the video rather than using a keyframe 5 seconds from the beginning.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 4872
Re: Trimming video: AVD ignores first 5 seconds
« Reply #10 on: January 12, 2017, 08:14:44 AM »
I don't mind one or two frames difference but I'd like to cut after two or three seconds in the video rather than using a keyframe 5 seconds from the beginning.

We all would that, but this wish is inherent to the newer video codecs being used:
Very non-technical explanation: Full video frame is hold in keyframe, between keyframes is only partial video frame information. If you cut inbetween you only have partial video frames to the next key video frame.

With videos you wish to do so: there is only one option: re-encode the video. It is only a matter of choice.

Be certain when you record you have sufficient lead in time, so you can pick the keyframe before the six seconds.

I use lead(in/out) of 15 minutes
« Last Edit: January 12, 2017, 08:17:53 AM by Jan Gruuthuse »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 779
Re: Trimming video: AVD ignores first 5 seconds
« Reply #11 on: January 12, 2017, 09:53:50 AM »
In short: either cut anywhere you wish but re-encode the video, or cut only on keyframes and preserve quality. To have both: choose another universe.