<p><em>.h264</em> 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.</p>
<p>You can mux to MP4 and use that.</p>
<pre><code>ffmpeg -i xx.h264 -c copy xx.mp4

ffmpeg -sseof -10 -re -i xx.mp4 -c copy -f rtsp rtsp://localhost:8554/mystream
</code></pre>

CC BY-SA 4.0
2023-01-27T12:35:43.687Z
Why is it not working with h264?
Aras
CC BY-SA 4.0
2023-01-27T14:55:04.753Z
`.h264` is a raw format. It has no timestamps or metadata storing the input duration.
Gyan
CC BY-SA 4.0
2023-01-27T11:38:52.327Z
2023-02-02T19:04:44.180Z
2023-02-02T19:04:44.180Z
Gyan
<p>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)</p>
<p>here are the commands I have:</p>
<h3>1</h3>
<pre><code>ffmpeg -re -i xx.h264 -c copy -f rtsp rtsp://localhost:8554/mystream
</code></pre>
<p>working fine,</p>
<h3>2</h3>
<pre><code>ffmpeg -sseof -10 -re -i xx.h264 -c copy -f rtsp rtsp://localhost:8554/mystream
</code></pre>
<p>ignoring sseof parameter</p>
<p><strong>error message:</strong></p>
<blockquote>
<p>Cannot use -sseof, duration of xx.h264 not known</p>
</blockquote>
<h3>3</h3>
<pre><code>xx.h264: could not seek to position -10.000
</code></pre>
<p>not working at all</p>
<p><strong>error message:</strong></p>
<blockquote>
<p>xx.h264: could not seek to position -10.000</p>
</blockquote>
<p>How can I fix this issue?</p>

<ffmpeg><h.264>
ffmpeg seek position options not working with h264
Aras
# ffmpeg seek position options not working with h264

(Asked by: username_0 on 2023-01-27)

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?

**Tags:** ffmpeg, h.264


---

## 1 answers

### Answer by username_1 on 2023-01-27. Score: 1 | Accepted answer

.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

> **Comments:**
> **username_0**: Why is it not working with h264?  
> **username_1**: `.h264` is a raw format. It has no timestamps or metadata storing the input duration.  

---

