Jump to content

emby not closing previous stream, 2 instances in ffmpeg, freezing


eeeeeesy
Go to solution Solved by eeeeeesy,

Recommended Posts

eeeeeesy
2 hours ago, cayars said:

5 minutes is all that was asked as going more than that just makes the files larger to upload/download which isn't good for you or us. :)
Really 2 or 3 minutes would be good but 5 minutes allows for the PC to be off slightly in time and still get what we need.

I'm downloading this now to have a look.

PS any reason you're not using @pünktchen's Virtual TV plugin for Emby vs ErsatzTV which is still in alpha, external setup and doesn't do as much?

 

i have the virtualTV plugin setup and it works perfectly except for its in beta so it only allows 30 channels. the other thing is i have to do some crazy procedure to get the tv guide data to randomize every 48 hours and i still dont think that procedure is working to do what i want since i still lose guide data before the 48 hours. i probably just cant do the procedure hack properly and its confusing to me.

Edited by eeeeeesy
Link to comment
Share on other sites

eeeeeesy
1 hour ago, cayars said:

I ran a verify on the file:

ffmpeg -v error -i "Madtv - Raging Rudolph-1 2022_01_02_19_10_49.ts" -f null - 2>error.log

It's full of errors but you can see it change to the new program and then the next followed by a very abrupt

Throughout the file are errors:
co located POCs unavailable
Application provided invalid, non monotonically increasing dts to muxer in stream 0 (or 1)

It has byte stream issues after the cutover to the new show
[h264 @ 000001acce58e600] error while decoding MB 77 59, bytestream -10

So the problem is the source. Being this was a TS file Emby/ffmpeg is able to push through much of these errors but the bytestream error is a show stopper.
You most certainly need a different source of content if all streams are like this as they are not following specs or even close to them.

 

i re-encoded all the content in nvenc h.264 mp4 aac in bulk so why would some files have different specs than others?

Edited by eeeeeesy
Link to comment
Share on other sites

eeeeeesy
2 hours ago, cayars said:

I ran a verify on the file:

ffmpeg -v error -i "Madtv - Raging Rudolph-1 2022_01_02_19_10_49.ts" -f null - 2>error.log

It's full of errors but you can see it change to the new program and then the next followed by a very abrupt

Throughout the file are errors:
co located POCs unavailable
Application provided invalid, non monotonically increasing dts to muxer in stream 0 (or 1)

It has byte stream issues after the cutover to the new show
[h264 @ 000001acce58e600] error while decoding MB 77 59, bytestream -10

So the problem is the source. Being this was a TS file Emby/ffmpeg is able to push through much of these errors but the bytestream error is a show stopper.
You most certainly need a different source of content if all streams are like this as they are not following specs or even close to them.

that doesnt explain why the virtualTV plugin and tivimate plays them without a hiccup

Edited by eeeeeesy
Link to comment
Share on other sites

1 hour ago, eeeeeesy said:

 

i re-encoded all the content in nvenc h.264 mp4 aac in bulk so why would some files have different specs than others?

That will likely work.  Another solution you could try is doing a quick remux of the files into another container.  You could use ffmpeg for this and just stream copy the codec into an mp4 or mkv file which would write header information which might be enough.

1 hour ago, eeeeeesy said:

what should my settings be for nvenc re-encoding in handbreak?

No clue. How fast does a car go?  All depends on car model or GPU used.  Is it a straight line or curvy road?   How about the destination formation and codecs.
Hopefully you get what I'm saying.  No one can answer this other than a "general" start here. but handbrake is basically just point and click unlike ffmpeg where you have to piece the conversion string together based on the formats you start with, the formats you want to end with, deinterlacing if needed, etc...

16 minutes ago, eeeeeesy said:

that doesnt explain why the virtualTV plugin and tivimate plays them without a hiccup

Tivimate isn't doing a recording having to save the transmission in a format that meets specific specs/standards knowing it could be played back in a browser, roku, apple, ios, android mobile, android tv, LG or Samsung TV, media player like Theater or our favorite shipper's little fire tv boxes.  Emby has to make sure the specs are very close to what they must be as it deals with lots of different hardware with every major vendor who all have  their own requirements.

Tivimate doesn't record or have to worry about anything except to say here Display output this.  What it can't handle can be adjusted on the fly, have a filter applied, drop frames to cope or numerous other things cause all it needs to worry about it output.

Tivimate is the cabbie driving the car who'll get you from point A to B and do a decent job of it but it's a limited job.  Emby on the other hand is like a master mechanic on an F1 team handling all the different things that pop up on sensors, headers, etc so the driver can set track records. Yea, I know a bit over the top and I'm exaggerating to make a point that they are doing way different things so it's comparing Apples to French Poodles.

Link to comment
Share on other sites

pünktchen

I wouldn't say it's necessary a problem with the source files. It's more likely a problem in ErsatzTV.
@eeeeeesy what you should try is this: create a FFmpeg Profile in ErsatzTV that forces a transcode of your source files, maybe by just lowering the bitrate.
If ErsatzTV then throws ffmpeg errors, the problem is your source files.
If ErsatzTV has no problem and also not Emby, then the problem is the way ErsatzTV creates the mpegts file if no transcoding is needed.
If ErsatzTV has no problem but Emby has, then the problem could be the streaming server part of ErsatzTV. There's some packet loss or something like that.

Link to comment
Share on other sites

eeeeeesy
37 minutes ago, pünktchen said:

I wouldn't say it's necessary a problem with the source files. It's more likely a problem in ErsatzTV.
@eeeeeesy what you should try is this: create a FFmpeg Profile in ErsatzTV that forces a transcode of your source files, maybe by just lowering the bitrate.
If ErsatzTV then throws ffmpeg errors, the problem is your source files.
If ErsatzTV has no problem and also not Emby, then the problem is the way ErsatzTV creates the mpegts file if no transcoding is needed.
If ErsatzTV has no problem but Emby has, then the problem could be the streaming server part of ErsatzTV. There's some packet loss or something like that.

ive tried the source files in ersatz without manually re-encoding the files and it still freezes in emby. if erstaz is like dizquetv then the bitrate is just for a max bitrate. i have tried setting the max bitrate to the same as my files bitrate which is 6000 and 5500 and lastly i set it to 40000. i think if its too low than i lose quality since 6000 i think is for 1080p. i also dont see any errors in the ersts ffmpeg console at any time because theres no way to enable to show console logging in ersatz that i know of. oor i would have to check the real log file and i never know how to read those because they are not in real time. its just a time stamp.

Link to comment
Share on other sites

eeeeeesy
2 hours ago, cayars said:

That will likely work.  Another solution you could try is doing a quick remux of the files into another container.  You could use ffmpeg for this and just stream copy the codec into an mp4 or mkv file which would write header information which might be enough.

No clue. How fast does a car go?  All depends on car model or GPU used.  Is it a straight line or curvy road?   How about the destination formation and codecs.
Hopefully you get what I'm saying.  No one can answer this other than a "general" start here. but handbrake is basically just point and click unlike ffmpeg where you have to piece the conversion string together based on the formats you start with, the formats you want to end with, deinterlacing if needed, etc...

Tivimate isn't doing a recording having to save the transmission in a format that meets specific specs/standards knowing it could be played back in a browser, roku, apple, ios, android mobile, android tv, LG or Samsung TV, media player like Theater or our favorite shipper's little fire tv boxes.  Emby has to make sure the specs are very close to what they must be as it deals with lots of different hardware with every major vendor who all have  their own requirements.

Tivimate doesn't record or have to worry about anything except to say here Display output this.  What it can't handle can be adjusted on the fly, have a filter applied, drop frames to cope or numerous other things cause all it needs to worry about it output.

Tivimate is the cabbie driving the car who'll get you from point A to B and do a decent job of it but it's a limited job.  Emby on the other hand is like a master mechanic on an F1 team handling all the different things that pop up on sensors, headers, etc so the driver can set track records. Yea, I know a bit over the top and I'm exaggerating to make a point that they are doing way different things so it's comparing Apples to French Poodles.

you didnt mention why the VirtualTV plugin works perfectly . Also if recording is the problem then we should be able to disable recording in emby.

Link to comment
Share on other sites

I don't have it installed or use besides a side load once in a while to check out what's new and be able to suggest it to others when they are looking for something like that.  I've not had a need for that specific functionality personally with the multiple tuners (OTA/Cable/IPTV) I already have.

I've known pünktchen from the forums and testing alpha/beta products for a long, long time and he does great work and is one of the more senior Emby users (meant in a good way). My expectation would be that it does work very well!

But again, it's doing something completely different than recording as already explained. There is a crazy stupid amount of things that need to be done to properly record stream in the fashion Emby needs them to allow stream sharing, some users direct playing, some remuxing, some transcoding the stream while it's recording it.  All those different things going on while all the crazy stuff happens in the streams.  Just touching the tip of the iceberg: You get audio changes from a movie to a commercial. subs on  subs off, CC on sometimes, sometimes not during commercials.  You can have different aspect ratios, different interlacing and all kinds of things that have to be dealt with in real time.  Again it can't be handed off to the hardware to handle.

Link to comment
Share on other sites

eeeeeesy
1 hour ago, cayars said:

I don't have it installed or use besides a side load once in a while to check out what's new and be able to suggest it to others when they are looking for something like that.  I've not had a need for that specific functionality personally with the multiple tuners (OTA/Cable/IPTV) I already have.

I've known pünktchen from the forums and testing alpha/beta products for a long, long time and he does great work and is one of the more senior Emby users (meant in a good way). My expectation would be that it does work very well!

But again, it's doing something completely different than recording as already explained. There is a crazy stupid amount of things that need to be done to properly record stream in the fashion Emby needs them to allow stream sharing, some users direct playing, some remuxing, some transcoding the stream while it's recording it.  All those different things going on while all the crazy stuff happens in the streams.  Just touching the tip of the iceberg: You get audio changes from a movie to a commercial. subs on  subs off, CC on sometimes, sometimes not during commercials.  You can have different aspect ratios, different interlacing and all kinds of things that have to be dealt with in real time.  Again it can't be handed off to the hardware to handle.

ok thanks ill talk to punktchen

Link to comment
Share on other sites

eeeeeesy
3 hours ago, pünktchen said:

I wouldn't say it's necessary a problem with the source files. It's more likely a problem in ErsatzTV.
@eeeeeesy what you should try is this: create a FFmpeg Profile in ErsatzTV that forces a transcode of your source files, maybe by just lowering the bitrate.
If ErsatzTV then throws ffmpeg errors, the problem is your source files.
If ErsatzTV has no problem and also not Emby, then the problem is the way ErsatzTV creates the mpegts file if no transcoding is needed.
If ErsatzTV has no problem but Emby has, then the problem could be the streaming server part of ErsatzTV. There's some packet loss or something like that.

ive been using my ffmpeg profile in ersatz set to transcoding enabled. ill try disabling transcoding in ersatz.

 

how can i fix packet loss? would that be by adjusting mtu and mss in my pfsense router?

Edited by eeeeeesy
Link to comment
Share on other sites

Unless the streams have been changed I don't see the results changeing.

Run a verify task on the file like I did.
 

ffmpeg -v error -i "Madtv - Raging Rudolph-1 2022_01_02_19_10_49.ts" -f null - 2>error.log
Link to comment
Share on other sites

eeeeeesy

now that i turned off hardware acceleration in emby, i went back to trying dizquetv/pseudotv in emby and its working perfectly. i played through 5 transitions without any problem. now i see what you guys mean by the problem is with ersatzTV. DizqueTV uses HTTP and HLS i believe so maybe thats why it works because i have it set to HTTP. I will try letting the ersatz dev know.

Link to comment
Share on other sites

eeeeeesy
17 hours ago, pünktchen said:

I wouldn't say it's necessary a problem with the source files. It's more likely a problem in ErsatzTV.
@eeeeeesy what you should try is this: create a FFmpeg Profile in ErsatzTV that forces a transcode of your source files, maybe by just lowering the bitrate.
If ErsatzTV then throws ffmpeg errors, the problem is your source files.
If ErsatzTV has no problem and also not Emby, then the problem is the way ErsatzTV creates the mpegts file if no transcoding is needed.
If ErsatzTV has no problem but Emby has, then the problem could be the streaming server part of ErsatzTV. There's some packet loss or something like that.

now that i know the problem is with erstazTV, what should i ask the ersatzTv dev?

Link to comment
Share on other sites

eeeeeesy
On 1/4/2022 at 2:24 PM, pünktchen said:

How does he merge the single source video files into one continous mpegts stream?

JD the ErsatzTV dev fixed the 3 transition freezing issue. I tested it and its definitely the fix. I have gotten well beyond 3 transitions and still playing the stream. transitioning is also a lot smoother. I think your hint gave him the idea but i didnt ask him if thats where he got the idea. i didnt want to rub it in his face.

 

this is what he said about the updated mpegts mode

Quote

its served to clients as a single stream (mpeg-ts). kind of similar to if you stick xteve between etv and a client

he will include this updated mode in the next ersatz release.

Link to comment
Share on other sites

  • Solution
eeeeeesy
45 minutes ago, ebr said:

So, this entire issue was with the source as we had thought and you are good now?

the issue was not my source video files. the issue was partly due to enabling hw acceleration to Yes in emby server. that was fixed by either disabling hw acceleration or enabling all settings in the transcoding hw acceleration advanced tab to fix freezing at start up and possibly ghost streams. the other problem was erstazTV mpegTS mode, the custom channel program called ErstazTV needed an update to the mpegTS mode whch is fixed in the next release of ersatzTV, that fixes the 3 transitions freezing issue when the chanel transitions to the next movie or show the 3rd time. But yes i am good now.

Edited by eeeeeesy
Link to comment
Share on other sites

52 minutes ago, eeeeeesy said:

the other problem was erstazTV mpegTS mode,

From Emby's perspective, that is the source so that's what I meant.

Glad you are sorted now.  Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...