srs icon indicating copy to clipboard operation
srs copied to clipboard

[Feature] [Upgrade Tools] Snapshot of HEVC encoded stream fails

Open Diras226 opened this issue 6 months ago • 5 comments

I am using OBS to publish a HEVC encoded stream to srs server. I am having trouble getting an snapshot of the stream using the following config:

 transcode {
        enabled on;
        ffmpeg ./objs/ffmpeg/bin/ffmpeg;
        engine snapshot {
            enabled on;
            iformat hevc; #or flv
            vfilter {
                vf fps=0.1;
            }
            vcodec png;
            vparams {
                vframes 1;
            }
            acodec an;
            oformat image2;
            output /home/images/[stream].jpg;
        }
    }

When using iformat hevc the stream decoding fails completly and when using flv the input stream is detected as flashsv and fails afterwards.

hevc.txt flv.txt

Version ossrs/srs:6.0.166

To Reproduce

  1. Start a Hevc encoded stream with obs.
  2. View snapshot log in srs docker container.

Expected behavior A snapshot should be created the same way as using iformat h264 and h264 encoded stream.

Diras226 avatar Jul 01 '25 17:07 Diras226

It appears that version 4.x of FFmpeg does not yet support HEVC over RTMP, and an upgrade is necessary. Alternatively, you could specify a newer version of FFmpeg.

TRANS_BY_GPT4

duiniuluantanqin avatar Jul 04 '25 08:07 duiniuluantanqin

According to the logs srs 6.0.166 is using FFmpeg 5.0.2.

Diras226 avatar Jul 04 '25 16:07 Diras226

it seems like FFmpeg version 7 and later supports HEVC over RTMP. You can specify the path to FFmpeg to use the latest version installed on your computer.

TRANS_BY_GPT4

duiniuluantanqin avatar Jul 07 '25 02:07 duiniuluantanqin

Thanks, but wouldn't it be better to raise the FFmpeg version SRS 6 is using in it's docker image so everybody can use HEVC snapshot with it or is it not possible because of other concerns?

Diras226 avatar Jul 07 '25 12:07 Diras226

Yes, update after the release of FFmpeg 8.0.

TRANS_BY_GPT4

duiniuluantanqin avatar Aug 07 '25 03:08 duiniuluantanqin