Kodi Community Forum
mpeg2 hardware/software question - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166)
+---- Thread: mpeg2 hardware/software question (/showthread.php?tid=218709)

Pages: 1 2


mpeg2 hardware/software question - visata - 2015-02-17

I'm new with Kodi and have a quick question, I read that in order to be able to decode mpeg2 sources using hardware I'm supposed to buy mpeg2 license.

I installed Kodi on raspberry pi2, enabled simple IPTV plugin, added the playlist and was able to see all mpeg2 streams from my provider. Does Kodi decode mpeg2 in software mode as there is some kind of lag when switching between the channels (streams)? I was under the impression that it won't work at all or so laggy that would be impossible to watch.

By the way, how do I find out when it uses software/hardware method to decode anything? Is there some kind of icon?

Thanks


RE: mpeg2 hardware/software question - NiggyG - 2015-02-17

(2015-02-17, 16:08)visata Wrote: I'm new with Kodi and have a quick question, I read that in order to be able to decode mpeg2 sources using hardware I'm supposed to buy mpeg2 license.

I installed Kodi on raspberry pi2, enabled simple IPTV plugin, added the playlist and was able to see all mpeg2 streams from my provider. Does Kodi decode mpeg2 in software mode as there is some kind of lag when switching between the channels (streams)? I was under the impression that it won't work at all or so laggy that would be impossible to watch.

By the way, how do I find out when it uses software/hardware method to decode anything? Is there some kind of icon?

Thanks

If you've not bought the MPEG2 licence and your playing MPEG2 video then it's using software. The Pi1 couldn't cope with this, I've a Pi2 on order so I'm interested to know if it decodes in software without any problems. I doubt the slowness in changing channels is down to trouble decoding the files.


RE: mpeg2 hardware/software question - popcornmix - 2015-02-17

Press codec info key ('o' on keyboard). If you see:
omx-mpeg2 : hardware decode with omxplayer
mmal-mpeg2: hardware decode with dvdplayer and mmal acceleration
ff-mpeg2: software decode with ffmpeg


RE: mpeg2 hardware/software question - visata - 2015-02-17

It's running in software mode and I can confirm no lag with playback. Please note that all channels are in SD quality around 3.2Mb/s. The only issue I have is when I switch the channel, Kodi shows message "Working" and I have to wait around 5 seconds before it starts streaming. Would it help if I bought mpeg2 license? I don't have this problem if I use Windows Kodi version.

Or maybe channel switching issue occurs because I'm using a bit outdated OpenElec version (5.0.2). According to OpenElec description I should be using 5.0.3 because it contains some kind of bug... it was just easier to setup 5.0.2 with NOOBS.

HD channels are encoded using h264 codec and when I tested them like 10 minutes ago for some reason they were skipping some frames though I don't remember having this issue like 3-4 hours ago when I assembled my raspberry pi. Will do more testing.


RE: mpeg2 hardware/software question - popcornmix - 2015-02-17

If it's SD and there is no lag in playback then I don't expect the codec licence will change things.

Channel switch time is largely determined by the back end. mpegts needs to be identified (e.g. in mime type). See:
https://github.com/xbmc/xbmc/pull/6036

to allow the "fast channel switch" code path. Otherwise ffmpeg needs to analyse a few seconds of data to determine which audio/video/sub streams are present.


RE: mpeg2 hardware/software question - wrxtasy - 2015-02-18

I've tried mpeg2 live TV without a licence and had pretty ordinary combed video artifacts when the RPi 2 was deinterlacing using only ffmpeg.


RE: mpeg2 hardware/software question - Memphiz - 2015-02-18

same for me - all fine since i use the license key


RE: mpeg2 hardware/software question - popcornmix - 2015-02-18

(2015-02-18, 15:53)wrxtasy Wrote: I've tried mpeg2 live TV without a licence and had pretty ordinary combed video artifacts when the RPi 2 was deinterlacing using only ffmpeg.

Yes, deinterlace is handled in the MMAL decoder which is only used for hardware decode. Software decode won't be deinterlaced.


RE: mpeg2 hardware/software question - visata - 2015-02-18

I didn't pay attention to this but I must be also experiencing combing artifacts (visible horizontal lines when there is some kind of motion) like described here http://www.100fps.com but what's interesting that I see the same issue when I watch streams via VLC player, so I thought it's normal.

I'm attaching the screenshot from VLC:
http://imgur.com/swj5NU7

Maybe my VLC is also set to use software decoder that's why I see combing effects? I will check that out... Or it might be the source of the stream?

Regarding fast channel switching, is it possible to define codecs in advance (like in m3u list or in that window where I could set aspect ratio, post processing options...), so backend doesn't have to detect it everytime? Like I mentioned there is no lag when I use Windows Kodi version on my PC.


RE: mpeg2 hardware/software question - naloj - 2015-02-19

Just started playing with the rpi2 today and can say that 1080i via software was very choppy as was expected. I purchased and activated the mpeg2 codec license and playback has been very smooth during some short testing.


RE: mpeg2 hardware/software question - NiggyG - 2015-02-19

(2015-02-18, 17:00)visata Wrote: I didn't pay attention to this but I must be also experiencing combing artifacts (visible horizontal lines when there is some kind of motion) like described here http://www.100fps.com but what's interesting that I see the same issue when I watch streams via VLC player, so I thought it's normal.

I'm attaching the screenshot from VLC:
http://imgur.com/swj5NU7

Maybe my VLC is also set to use software decoder that's why I see combing effects? I will check that out... Or it might be the source of the stream?

Regarding fast channel switching, is it possible to define codecs in advance (like in m3u list or in that window where I could set aspect ratio, post processing options...), so backend doesn't have to detect it everytime? Like I mentioned there is no lag when I use Windows Kodi version on my PC.

In VLC when watching your video right click on the screen and choose Viceo -> Deinterlace -> On.

(2015-02-19, 09:06)naloj Wrote: Just started playing with the rpi2 today and can say that 1080i via software was very choppy as was expected. I purchased and activated the mpeg2 codec license and playback has been very smooth during some short testing.

Is your source definitely MPEG2? Where do you come across 1080i MPEG2? The broadcast 1080I HD in the US is x264.


RE: mpeg2 hardware/software question - noggin - 2015-02-19

(2015-02-19, 11:22)NiggyG Wrote: Is your source definitely MPEG2? Where do you come across 1080i MPEG2? The broadcast 1080I HD in the US is x264.

That isn't correct.

The US ATSC 8VSB HDTV broadcast standard for over-the-air transmission uses MPEG2 (also known as H262) for both SD and HD broadcasts, and has since it launched in 1998. With the exception of some little watched mobile ATSC broadcasts, and a couple of little-watched sub-channels, H264 (also known as MPEG4 part 10/AVC) isn't used for over-the-air broadcasts in the US. If you are watching NBC or CBS stations over the air you are likely to be watching 1080i MPEG2, if you are watching ABC or Fox then you are likely to be watching 720p MPEG2. PBS is usually 1080i but in some cases is cross-converted to 720p.

ATSC QAM cable transmissions also usually use MPEG2 (though I believe H264 is now being rolled out as well) with the same formats as above. ESPN will be 720p too.

First generation digital TV systems were based around MPEG 2. The US, Canada and Australia launched HD on their first gen systems, as did Japan and Korea. Most of the rest of the world (most of Europe - including the UK) continued with SD (though added 16:9 SD) on their digital TV platforms.

HDTV in most countries (other than North America, Japan, Korea and Australia) launched later, on second gen (or modified first gen) platforms in many cases, and was able to use H264 encoding for HD (and in some cases SD) broadcasts. (The US still hasn't rolled out a second gen digital OTA system)

Of course, many copies of US MPEG2 broadcasts shows are re-encoded using x264 for illegal sharing...


RE: mpeg2 hardware/software question - noggin - 2015-02-19

(2015-02-18, 17:00)visata Wrote: I didn't pay attention to this but I must be also experiencing combing artifacts (visible horizontal lines when there is some kind of motion) like described here http://www.100fps.com but what's interesting that I see the same issue when I watch streams via VLC player, so I thought it's normal.

I'm attaching the screenshot from VLC:
http://imgur.com/swj5NU7

Maybe my VLC is also set to use software decoder that's why I see combing effects? I will check that out... Or it might be the source of the stream?

Regarding fast channel switching, is it possible to define codecs in advance (like in m3u list or in that window where I could set aspect ratio, post processing options...), so backend doesn't have to detect it everytime? Like I mentioned there is no lag when I use Windows Kodi version on my PC.

Broadcast MPEG2 is interlaced, though the contents of the broadcast may be progressive (drama, documentary usually), and if you are in a 60Hz region like North America, then you also have 3:2 pulldown to contend with.

You will need to deinterlace. 50Hz interlaced broadcasts containing 25p progressive content can usually just be weaved. 60Hz interlaced broadcasts containing 24Hz 3:2 content need something to cope with the video frames that contain fields from two different source frames (3:2 pull-down removal)

Native 50 and 60Hz content (news, sport, entertainment) will need proper de-interlacing - the most basic form of which is Bob. If you see constant 'combing' (lines) on moving content then try enabling Bob deinterlace. If you are in VLC then try enabling YADIF 2x (though the Pi may only be able to cope with this on SD content ?)

I think that VLC usually only uses hardware acceleration for H264 content and uses software for MPEG2 - but the Pi builds may be different.


RE: mpeg2 hardware/software question - visata - 2015-02-19

Thanks for the replies.

I enabled deinterlacing on VLC as suggested, no more horizontal lines!

I also played around with kodi on raspberry pi. The video was interlaced with standard kodi settings. So I tried changing deinterlacing option from auto to yes and used all deinterlacing algorithms but it didnt have any effect - horizontal lines were visible in all cases. I suppose it will go away when I buy my mpeg2 license?

Im curious why my streams arent laggy/choppy like others reported? The stream I was testing today a news channell, resolution 720x576, around 3.7Mbps, mpeg2 encoding And if that matters Im from Europe.


RE: mpeg2 hardware/software question - wrxtasy - 2015-02-20

Conclusion - just buy the cheap as mpeg2 licence and all Deinterlacing issues will go away Smile

Leave deinterlacing on Auto when you have the licence, then save as default for all videos, If "On" or "Yes" is left as the default for all video, you will then have problems with 720/1080p video.