0

I am writing stream into video files with ffmpeg. Each file about 15 minutes. I want to be able to play finished and unfinished files with VLC (program using MetaVLC to be more precise). Which codec will best suit for this scenario?

I tried raw h264. Vlc can play them with option "demux=h264" but it unable to seek or change current time of playing. They play only from beginning.

I tried flv, but VLC can't play unfinished file.

2 Answers 2

1

Any header-less containers: .mjpeg (mjpeg raw streams, just concatenated jpeg images), .dv, .ts, .mpg (mpeg elementary stream, mpeg program stream), .h264 (annex b for raw h264 streams) and maybe other few.

You can edit video in these containers by direct byte manipulation. Sometime without knowledge where exact frame starts. You can build NLE video editor with bash and dd.

FLV is most simple container, this is stream format, you don't need to patch any bytes at finishing, but it have a small header (just few bytes). You can try to write it manually while opening file for writing.

1

You can use H.264 in MPEG-TS.

ffmpeg -i in -c:v libx264 out.ts

In Potplayer, I can play as well as seek. In VLC, as well, but timestamps are missing. Limitation is that you can only seek to keyframes. If you select a non-keyframe, then the video output will be frozen or corrupted till the player reaches a keyframe. Audio will work in any case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.