1

I can use ss and sseof parameters with mp4 files and stream the result, but I get errors when I use same commands on h264 file (checked that it also works without seek parameters)

here are the commands I have:

1

ffmpeg -re -i xx.h264 -c copy -f rtsp rtsp://localhost:8554/mystream

working fine,

2

ffmpeg -sseof -10 -re -i xx.h264 -c copy -f rtsp rtsp://localhost:8554/mystream

ignoring sseof parameter

error message:

Cannot use -sseof, duration of xx.h264 not known

3

xx.h264: could not seek to position -10.000

not working at all

error message:

xx.h264: could not seek to position -10.000

How can I fix this issue?

1 Answer 1

1

.h264 is a raw format. It has no timestamps or metadata storing the input duration. Therefore you need to convert it to mp4 or another suitable format.

You can mux to MP4 and use that.

ffmpeg -i xx.h264 -c copy xx.mp4

ffmpeg -sseof -10 -re -i xx.mp4 -c copy -f rtsp rtsp://localhost:8554/mystream
2
  • Why is it not working with h264?
    – Aras
    Commented Jan 27, 2023 at 12:35
  • .h264 is a raw format. It has no timestamps or metadata storing the input duration.
    – Gyan
    Commented Jan 27, 2023 at 14:55

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.