Project

General

Profile

Transcode h264 and copy mpeg2video with spawn.

Added by se can almost 3 years ago

Hi folks,

I'm looking for a solution, if there is a way to transcode with piping so that the transcoding only works if the input is h264, but if it is mpeg2 it just goes on with a copy, like it is in the built-in mpegts profile.

I now use this command, with minor or major modifications:
/usr/local/bin/ffmpeg -i pipe:0 -c:a copy -c:v h264_nvenc -b:v 3M -minrate 3M -maxrate 3M -bufsize 6M -r 25 -threads 4 -map 0:v -map 0:m:language:hun? -map 0:a -f mpegts pipe:1

The problem is that in this case, on client side only plays the h264 channels, because log says there is no suitable encoder for the mpeg2 input.

With built-in mpegts stream profile it works great, it just starts to stutter after a while and keeps jumping to the next service, even if the switch to another service is turned off.
Sometimes a few minutes after start, sometimes after half an hour, it varies.

Thats in the log, it starts to stutter and then switch to the next service without any entries in the log file:

2022-02-13 20:44:03.624 subscription: 015B: "HTTP" subscribing on channel "Comedy Central Hungary", weight: 100, adapter: "Silicon Labs Si2168 #1 : DVB-C #0", network: "567", mux: "567MHz", provider: "MTV Networks Europe", service: "Comedy Central Hungary", profile="nvenc", hostname="88.87.228.73", username="whisbills", client="VLC/3.0.16 LibVLC/3.0.16"
2022-02-13 20:44:03.807 transcode: 00BE: 01:MPEG2VIDEO: > Copy
2022-02-13 20:44:03.807 transcode: 00BE: 02:MPEG2AUDIO: > Copy
2022-02-13 20:44:04.227 libav: AVFormatContext: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
2022-02-13 20:44:04.227 libav: AVFormatContext: Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
2022-02-13 20:45:48.054 webui: Stop streaming /stream/channelid/1045128057?auth=Pw7oPNyd5zM0ehc3WrVlpILZpESM&profile=nvenc, muxer reported errors
2022-02-13 20:45:48.055 subscription: 015B: "HTTP" unsubscribing from "Comedy Central Hungary", hostname="88.87.228.73", username="whisbills", client="VLC/3.0.16 LibVLC/3.0.16"
2022-02-13 20:45:58.607 http: 88.87.228.73: using auth Pw7oPNyd5zM0ehc3WrVlpILZpESM for /stream/channelid/75403848
2022-02-13 20:45:58.607 mpegts: 280MHz in 280 - tuning on Silicon Labs Si2168 #2 : DVB-C #0
2022-02-13 20:45:58.608 subscription: 015C: "HTTP" subscribing on channel "Viasat History HD", weight: 100, adapter: "Silicon Labs Si2168 #2 : DVB-C #0", network: "280", mux: "280MHz", provider: "A1 Broadcasting", service: "Viasat History HD", profile="nvenc", hostname="88.87.228.73", username="whisbills", client="VLC/3.0.16 LibVLC/3.0.16"
2022-02-13 20:45:58.771 transcode: 00BF: 01:H264: ==> Using profile nvenc
.
.
.

Its shows stop streaming like when I close the player software, just in case I don't do anything like that.

Version 4.3.0~pre+202201122318 from mamarley with compiled ffmpeg.
Tuners are Avermedia TD310
OS: Ubuntu 20.04 x64