<p>I have 2 videos. One from cam1 and other from cam6. 
Below is the timecode information of the 2 videos:</p>

<blockquote>
  <p>fprobe -v error -show_format -show_streams cam1.MP4 | grep 'TAG:timecode'</p>
</blockquote>

<p>Output->>>>TAG:timecode=16:31:13:13</p>

<blockquote>
  <p>fprobe -v error -show_format -show_streams cam6.MP4 | grep 'TAG:timecode'    </p>
</blockquote>

<p>Output->>>>TAG:timecode=16:31:36:14</p>

<p>As you can see, cam6 video started a bit late (approx 22 seconds late)</p>

<p>I want to <strong>PRECISELY</strong> cut the cam1 video and make it start EXACTLY from the timecode of cam6 (which is 16:31:36:14)</p>

<p>Basically, both the videos (cam6 and the newly trimmed cam1 video) should start at the <strong>EXACT</strong> same frame of 16:31:36:14</p>

<p>Whats the best way to do this?</p>

CC BY-SA 4.0
2019-03-13T05:22:06.447Z
Re-encoding is required for exact cut. IS that ok?
Gyan
CC BY-SA 4.0
2019-03-13T08:04:38.933Z
Yes, that is absolutely fine. How to do it?
user2333839
CC BY-SA 4.0
2019-03-13T19:43:13.287Z
The notional way is to re-encode the longer video by setting `-ss X` before the input `-i`. where X is the difference in time. Note that timecodes are labels, not time measurements, and only the starting timecode is stored in the file. So you'll have to calculate the difference in fractional seconds, keeping in mind the framerate. If you wish to avoid re-encoding the video, unless the desired start point is a keyframe, you can't get the exact cut.
Gyan
CC BY-SA 4.0
2019-03-13T20:39:40.110Z
Hi Gyan, thanks for your response. I tried the following:
`ffmpeg -ss 23.03 -i cam1.MP4 out.mp4` and a new file (out.mp4) did get generated. As you said, this new file has the starting timecode of the original file (cam1.mp4). But how do i ensure that this newly created video is starting at the exact same frame as my cam6.mp4?
user2333839
CC BY-SA 4.0
2019-03-14T04:40:14.243Z
You'll have to check. I assume the two cameras were jammed together.
Gyan
<video><ffmpeg>
Cutting video using timecodes
user2333839
# Cutting video using timecodes

(Asked by: username_0 on 2019-03-13)

I have 2 videos. One from cam1 and other from cam6.
Below is the timecode information of the 2 videos:

> fprobe -v error -show\_format -show\_streams cam1.MP4 | grep 'TAG:timecode'

Output->>>>TAG:timecode=16:31:13:13

> fprobe -v error -show\_format -show\_streams cam6.MP4 | grep 'TAG:timecode'

Output->>>>TAG:timecode=16:31:36:14

As you can see, cam6 video started a bit late (approx 22 seconds late)

I want to **PRECISELY** cut the cam1 video and make it start EXACTLY from the timecode of cam6 (which is 16:31:36:14)

Basically, both the videos (cam6 and the newly trimmed cam1 video) should start at the **EXACT** same frame of 16:31:36:14

Whats the best way to do this?

**Tags:** video, ffmpeg

> **Comments:**
> **username_1**: Re-encoding is required for exact cut. IS that ok?  
> **username_0**: Yes, that is absolutely fine. How to do it?  
> **username_1**: The notional way is to re-encode the longer video by setting `-ss X` before the input `-i`. where X is the difference in time. Note that timecodes are labels, not time measurements, and only the starting timecode is stored in the file. So you'll have to calculate the difference in fractional seconds, keeping in mind the framerate. If you wish to avoid re-encoding the video, unless the desired start point is a keyframe, you can't get the exact cut.  
> **username_0**: Hi username_1, thanks for your response. I tried the following: `ffmpeg -ss 23.03 -i cam1.MP4 out.mp4` and a new file (out.mp4) did get generated. As you said, this new file has the starting timecode of the original file (cam1.mp4). But how do i ensure that this newly created video is starting at the exact same frame as my cam6.mp4?  
> **username_1**: You'll have to check. I assume the two cameras were jammed together.  

---

## 0 answers

