question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[HOW-TO] h264 Timestamp File for mkv Conversion

See original GitHub issue

I’m trying to convert the .h264 output files from this library to .mkv for playback. Is there any way to save a timestamp file like you can with the libcamera --save-pts option?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
davidplowmancommented, Jun 28, 2022

At the moment this isn’t possible. @chrisruk what do you think?

As an alternative/workaround you could do this:

from picamera2 import Picamera2
from picamera2.encoders import H264Encoder
from picamera2.outputs import FfmpegOutput

picam2 = Picamera2()
picam2.configure(picam2.video_configuration())
encoder = H264Encoder(bitrate=10000000)
output = FfmpegOutput('test.mkv')
picam2.start_recording(encoder, output)

though the timestamps in the file won’t be as accurate.

0reactions
will-v-picommented, Aug 25, 2022

@ccostes Hi, would it be useful for you if we added # timestamp format v2 as the first line of the timestamp file (like the --save-pts option does for libcamera-vid) so you can import it straight into mkvmerge? If so I can add that feature

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert h264 to VFR mp4 with duplicated frames/timestamps
I want to containerize both files into a VFR .mp4 container where the PTS frame values are populated from the timestamp text files....
Read more >
Description - FFmpeg Wiki
timestamp issue muxing raw .264 into .mkv/.m2ts ... Muxing raw H264 content to mkv fails. ... to multiplex the raw h264 video into...
Read more >
FFmpeg: recreate timestamps without reencoding - Super User
I have an MP4 file containing H264 video (25 FPS). Some timestamps are not correct (for reasons...). Can I process the file and...
Read more >
Change AVC timestamp - Doom9's Forum
Raw H.264 at maximum have fps (timebase) in VUI. All timestamps are added at container (MP4/MKV) level so you can use any tool...
Read more >
ffmpeg - Re-packetize h264 bytestream to Matroska output
I have an app that's capturing multiple video streams from users and put them into one mkv output file. Data ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found