user40437: 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?

user1871: .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


40437: <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>
 1871: <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>
