Embed timestamp in video file using ffmpeg
up vote
0
down vote
favorite
I'm trying to record a video from the webcam using ffmpeg, while saving the exact timestamp in the video format so that I can later match it with other recorded videos:
ffmpeg -f v4l2 -ts abs -video_size 1280x720 -i /dev/video0 -copyts ts_test.mkv
This however seems to mess up the duration of the video. Using ffprobe
:
$ ffprobe ts_test.mkv
...
Input #0, matroska,webm, from 'ts_test.mkv':
Metadata:
ENCODER : Lavf56.40.101
Duration: 428390:10:05.90, start: 1542204570.100000, bitrate: N/A
Stream #0:0: Video: h264 (High 4:2:2), yuv422p, 1280x720, SAR 1:1 DAR 16:9, 10 fps, 10 tbr, 1k tbn, 20 tbc (default)
Metadata:
ENCODER : Lavc56.60.100 libx264
DURATION : 428390:10:05.900000
So, although the start time is listed as the current epoch, the duration is now also set to the time passed since 1970 (~428390 hours), which obviously messes with most video players.
What is the correct way to record the timestamp using ffmpeg?
video ffmpeg webcam timestamp
add a comment |
up vote
0
down vote
favorite
I'm trying to record a video from the webcam using ffmpeg, while saving the exact timestamp in the video format so that I can later match it with other recorded videos:
ffmpeg -f v4l2 -ts abs -video_size 1280x720 -i /dev/video0 -copyts ts_test.mkv
This however seems to mess up the duration of the video. Using ffprobe
:
$ ffprobe ts_test.mkv
...
Input #0, matroska,webm, from 'ts_test.mkv':
Metadata:
ENCODER : Lavf56.40.101
Duration: 428390:10:05.90, start: 1542204570.100000, bitrate: N/A
Stream #0:0: Video: h264 (High 4:2:2), yuv422p, 1280x720, SAR 1:1 DAR 16:9, 10 fps, 10 tbr, 1k tbn, 20 tbc (default)
Metadata:
ENCODER : Lavc56.60.100 libx264
DURATION : 428390:10:05.900000
So, although the start time is listed as the current epoch, the duration is now also set to the time passed since 1970 (~428390 hours), which obviously messes with most video players.
What is the correct way to record the timestamp using ffmpeg?
video ffmpeg webcam timestamp
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to record a video from the webcam using ffmpeg, while saving the exact timestamp in the video format so that I can later match it with other recorded videos:
ffmpeg -f v4l2 -ts abs -video_size 1280x720 -i /dev/video0 -copyts ts_test.mkv
This however seems to mess up the duration of the video. Using ffprobe
:
$ ffprobe ts_test.mkv
...
Input #0, matroska,webm, from 'ts_test.mkv':
Metadata:
ENCODER : Lavf56.40.101
Duration: 428390:10:05.90, start: 1542204570.100000, bitrate: N/A
Stream #0:0: Video: h264 (High 4:2:2), yuv422p, 1280x720, SAR 1:1 DAR 16:9, 10 fps, 10 tbr, 1k tbn, 20 tbc (default)
Metadata:
ENCODER : Lavc56.60.100 libx264
DURATION : 428390:10:05.900000
So, although the start time is listed as the current epoch, the duration is now also set to the time passed since 1970 (~428390 hours), which obviously messes with most video players.
What is the correct way to record the timestamp using ffmpeg?
video ffmpeg webcam timestamp
I'm trying to record a video from the webcam using ffmpeg, while saving the exact timestamp in the video format so that I can later match it with other recorded videos:
ffmpeg -f v4l2 -ts abs -video_size 1280x720 -i /dev/video0 -copyts ts_test.mkv
This however seems to mess up the duration of the video. Using ffprobe
:
$ ffprobe ts_test.mkv
...
Input #0, matroska,webm, from 'ts_test.mkv':
Metadata:
ENCODER : Lavf56.40.101
Duration: 428390:10:05.90, start: 1542204570.100000, bitrate: N/A
Stream #0:0: Video: h264 (High 4:2:2), yuv422p, 1280x720, SAR 1:1 DAR 16:9, 10 fps, 10 tbr, 1k tbn, 20 tbc (default)
Metadata:
ENCODER : Lavc56.60.100 libx264
DURATION : 428390:10:05.900000
So, although the start time is listed as the current epoch, the duration is now also set to the time passed since 1970 (~428390 hours), which obviously messes with most video players.
What is the correct way to record the timestamp using ffmpeg?
video ffmpeg webcam timestamp
video ffmpeg webcam timestamp
asked Nov 14 at 14:20
nbubis
1086
1086
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1375338%2fembed-timestamp-in-video-file-using-ffmpeg%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown