Skip to content

issue to fix the offset #53

Open
Open

Description

@EhsanRusta

I'm trying to remove the offset of a video, the offset is -15 and use the following command to shift the video,
" ffmpeg -y -i temp.mp4 -itsoffset -0.5 -i newtemp.mp4 -ss -0.5 -t 9.2 -map 0:v -map 1:a new0.mp4 "
but new video has offset equal to 8! I don't know waht is the issue, should I change anything else?
the FPS has changed to 25

Activity

  1. ashok-arjun commented on Dec 20, 2022

    @ashok-arjun

    @EhsanRusta What's the FPS of the original video? You should specify -itsoffset OFFSET/FPS where FPS is the original video's FPS I guess

  2. devsvarun commented on Dec 22, 2022

    @devsvarun

    @EhsanRusta What's the FPS of the original video? You should specify -itsoffset OFFSET/FPS where FPS is the original video's FPS I guess

    still the offset of the corrected video is not close to 1

  3. WudiJoey commented on Nov 3, 2023

    @WudiJoey

    First, you should get the original FPS for each video. And then, synchronize video according to its AV OFFSET:

    1. when av offset is positive:
      ffmpeg -i input.mp4 -itsoffset abs(OFFSET)/FPS -i input.mp4 -map 0:v -map 1:a -c copy output.mp4

    2. when av offset is negative:
      ffmpeg -i input.mp4 -itsoffset abs(OFFSET)/FPS -i input.mp4 -map 1:v -map 0:a -c copy -t video_len-abs(OFFSET)/FPS output.mp4

    After doing this, OFFSET for the new video will be 0. But i only test on few videos.

    Referring to https://superuser.com/a/983153

  4. tailangjun commented on Dec 28, 2023

    @tailangjun

    2. -t video_len-abs(OFFSET)/FPS

    Why aren’t they all video_len-abs(OFFSET)/FPS?

  5. WudiJoey commented on Dec 28, 2023

    @WudiJoey
  6. tailangjun commented on Dec 28, 2023

    @tailangjun

    您好,您的来信我已经收到,会尽快回复。

    多谢兄弟,我是想问为啥一个时长不变,一个变成 video_len-abs(OFFSET)/FPS了

  7. WudiJoey commented on Jan 3, 2024

    @WudiJoey

    您好,您的来信我已经收到,会尽快回复。

    多谢兄弟,我是想问为啥一个时长不变,一个变成 video_len-abs(OFFSET)/FPS了

    嗷这里是考虑到音频提前之后视频会有一部分没有声音就裁掉了,我想了一下实际上应该同时对校正后视频的头尾进行裁剪,如果你的offset是几秒的话得到的视频前几秒是【卡顿有声音】或者【画面在动但是无声音】
    但是当你的offset就几帧的前提下没有太大影响,offset超过几秒的话有时候那个视频本身就对不上音频和唇形

  8. prometheus-alien commented on Jan 31, 2024

    @prometheus-alien

    First, you should get the original FPS for each video. And then, synchronize video according to its AV OFFSET:

    1. when av offset is positive:
      ffmpeg -i input.mp4 -itsoffset abs(OFFSET)/FPS -i input.mp4 -map 0:v -map 1:a -c copy output.mp4
    2. when av offset is negative:
      ffmpeg -i input.mp4 -itsoffset abs(OFFSET)/FPS -i input.mp4 -map 1:v -map 0:a -c copy -t video_len-abs(OFFSET)/FPS output.mp4

    After doing this, OFFSET for the new video will be 0. But i only test on few videos.

    Referring to https://superuser.com/a/983153

    谢谢,好人一生平安

  9. prometheus-alien commented on Feb 1, 2024

    @prometheus-alien

    您好,您的来信我已经收到,会尽快回复。

    多谢兄弟,我是想问为啥一个时长不变,一个变成 video_len-abs(OFFSET)/FPS了

    嗷这里是考虑到音频提前之后视频会有一部分没有声音就裁掉了,我想了一下实际上应该同时对校正后视频的头尾进行裁剪,如果你的offset是几秒的话得到的视频前几秒是【卡顿有声音】或者【画面在动但是无声音】 但是当你的offset就几帧的前提下没有太大影响,offset超过几秒的话有时候那个视频本身就对不上音频和唇形

    谢谢子华兄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions