NextPVR Forums

Full Version: Transcoding Experts... is my hardware up to the task?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello all,

I use transcoding for access on my android phone on the go with nDroid. My home internet upload is 5-7mbps on average, however the latency just doesn't allow viewing the uncompressed tv.

My dedicated tuner box is a P4 3.0GHz dual core (not sure if I have a prescott or northwood) running on XP SP3 32bit stripped to minimum installation/services). Only other thing this box does is WFS, HTTP server (only used for me accessing movies on the go using a PHP directory script) and MySQL server for XBMC database.
1.5G RAM
GeForce 210
Pinnacle 800i

I am only able to do live transcoding of HD sources at 400K using nDroid. Otherwise the video gets very choppy at around 10 seconds of playback. This is not a bandwidth issue as far as I can tell. When viewing a live un-compressed TV source, my bandwidth throughput on my phone is around 5mbps. When viewing a transcoding source, it drops to 200kb/sec to 500kb/sec. I'm assuming here ffmpeg can't transcode the data fast enough.

Is there any tweaking of the ffmpeg arguments that I can try? I've tried reading up on ffmpeg but I get lost very quickly. Here is the NPVR config info as it stands now.

Code:
<TranscodeExe>.\other\ffmpeg.exe</TranscodeExe>
    <TranscodeArgs>-y -v 0 -i [SOURCE] -f mpegts -acodec libfaac -ar 48000 -ac 2 -ab 64k -s [RESOLUTION] -vcodec libx264 -b [BITRATE] -flags +loop -cmp +chroma -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 96k -bufsize 96k -threads 2 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -level 30 -aspect [ASPECT] -g 30 -async 2  [TARGET]</TranscodeArgs>

I'm still using the ffmpeg that came with NPRV. I tried replacing it with he newest build but it would no longer function. I'm assuming something in the allowed arguments has changed.

Also here is some codec information if that helps.

Code:
Codec Tweak Tool | Log file | Generated at 2014-01-06 11:52:49


#####  System Information  #####

OS:           Microsoft Windows XP Service Pack 3 (5.01.2600)
DirectX:      9.0c
CPU name:      Intel(R) Pentium(R) 4 CPU 3.00GHz
CPU speed:    3016 MHz
Memory:       1536 MB
Screen size:  1280x720 (32bits) (60Hz)
Video card:   NVIDIA GeForce 210
              VendorID: 10de, DeviceID: 0a65
Video mem:    1024 MB
Video driver: nv4_disp (Version 327.23)
Audio device: NVIDIA High Definition Audio
Audio driver: nvhda32.sys (Version 1.3.26.4) (6-16-2013)

#####  K-Lite Codec Pack  #####

KLCP version: 10.1.5
KLCP type:    mega

MPC renderer: VMR-7 (windowed)
MPC subs:     1


#####  Decoder Settings #####

LAV Video (x86):
H264=1|0 VC1=1|0 MPEG2=0|0 MPEG4=1|0 FLV1=1 WMV3=0

LAV Audio (x86):
MP3=1 AAC=1 Vorbis=1 AC3=1 DTS=1 LPCM=1 WMA=0

ffdshow (x86):
H264=0 VC1=0 MPEG2=0 XVID=0 DX50=0 DIV3=0 FLV1=0 RAW=0
MP3=0 AAC=0 Vorbis=0 AC3=0 DTS=0 LPCM=0 RAW=0


#####  DirectShow Filters (32-bit)  #####

Description:  ffdshow Video Decoder
File name:    c:\program files\k-lite codec pack\filters\ffdshow\ffdshow.ax
CLSID:        {04FE9017-F873-410E-871E-AB91661A4EF7}
Merit:        FF800001

Description:  ffdshow Audio Decoder
File name:    c:\program files\k-lite codec pack\filters\ffdshow\ffdshow.ax
CLSID:        {0F40E1E5-4F79-4988-B1A9-CC98794E6B55}
Merit:        FF800001

Description:  LAV Splitter
File name:    c:\program files\k-lite codec pack\filters\lav\lavsplitter.ax
CLSID:        {171252A0-8820-4AFE-9DF8-5C92B2D66B04}
Merit:        00800004

Description:  DirectVobSub (auto-loading version)
File name:    c:\program files\k-lite codec pack\filters\vsfilter.dll
CLSID:        {9852A670-F845-491B-9BE6-EBD841B8A613}
Merit:        00800002 = MERIT_PREFERRED + 2

Description:  DC-Bass Source
File name:    c:\program files\k-lite codec pack\filters\dcbass\dcbasssourcemod.ax
CLSID:        {ABE7B1D9-4B3E-4ACD-A0D1-92611D3A4492}
Merit:        00400000 = MERIT_UNLIKELY

Description:  LAV Splitter Source
File name:    c:\program files\k-lite codec pack\filters\lav\lavsplitter.ax
CLSID:        {B98D13E7-55DB-4385-A33D-09FD1BA26338}
Merit:        00400001 = MERIT_UNLIKELY + 1

Description:  VP7 Decompressor
File name:    c:\program files\k-lite codec pack\filters\vp7dec.ax
CLSID:        {C204438D-6E1A-4309-B09C-0C0F749863AF}
Merit:        00800000 = MERIT_PREFERRED

Description:  LAV Audio Decoder
File name:    c:\program files\k-lite codec pack\filters\lav\lavaudio.ax
CLSID:        {E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491}
Merit:        00800003 = MERIT_PREFERRED + 3

Description:  LAV Video Decoder
File name:    c:\program files\k-lite codec pack\filters\lav\lavvideo.ax
CLSID:        {EE30215D-164F-4A92-A4EB-9D4C13390F9F}
Merit:        FF800000

Description:  DScaler Mpeg2 Video Decoder
File name:    c:\program files\k-lite codec pack\filters\mpegvideo.dll
CLSID:        {F8904F1F-0371-4471-8866-90E6281ABDB6}
Merit:        00800000 = MERIT_PREFERRED

Description:  NPVR MP3 Reader
File name:    c:\program files\npvr\npvrmp3reader.ax
CLSID:        {FA497213-FF30-4D43-9D1E-558D5FBB28C1}
Merit:        00400000 = MERIT_UNLIKELY

(A total of 105 filters, 11 shown, 94 hidden)


#####  ICM Class Manager (32-bit)  #####

Description:  ffdshow video encoder
File name:    c:\program files\k-lite codec pack\filters\ffdshow\ffdshow.ax
CLSID:        {4DB2B5D9-4556-4340-B189-AD20110D953F} (ffdshow video encoder)
Merit:        00100000 = MERIT_SW_COMPRESSOR

(A total of 4 filters, 1 shown, 3 hidden)


#####  Default source filters (32-bit)  #####

.3g2    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.3gp    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.3gp2   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.3gpp   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.aac    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ac3    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.alac   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.amr    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ape    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.bdmv   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.bmp    {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.dib    {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.dts    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.dv     {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.dvr-ms {C9F5FE02-F851-4eb5-99EE-AD602AF1E619}  StreamBufferSource
.evo    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.f4v    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.flac   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.flv    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.gif    {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.hdmov  {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.jfif   {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.jpe    {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.jpeg   {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.jpg    {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.m2t    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.m2ts   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.m3u    {e436ebb5-524f-11ce-9f53-0020af0ba770}  File Source (Async.)
.m4a    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.m4v    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mka    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mks    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mkv    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mov    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mp3    {E436EBB5-524F-11CE-9F53-0020AF0BA770}  File Source (Async.)
.mp4    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mp4v   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mpc    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mpls   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mpv4   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.mts    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ofr    {ABE7B1D9-4B3E-4ACD-A0D1-92611D3A4492}  DC-Bass Source
.ofs    {ABE7B1D9-4B3E-4ACD-A0D1-92611D3A4492}  DC-Bass Source
.oga    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ogg    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ogm    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ogv    {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ra     {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.rm     {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.rmvb   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.tak    {ABE7B1D9-4B3E-4ACD-A0D1-92611D3A4492}  DC-Bass Source
.tga    {7DF62B50-6843-11D2-9EEB-006008039E37}  Generate Still Video
.tp     {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.ts     {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.webm   {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
.wv     {B98D13E7-55DB-4385-A33D-09FD1BA26338}  LAV Splitter Source
continued...

Code:
#####  ACM and VFW Codecs (32-bit)  #####

Description:  Lagarith lossless video codec
ID:           VIDC.LAGS
File name:    C:\WINDOWS\system32\lagarith.dll

Description:  x264 H.264 video codec
ID:           VIDC.X264
File name:    C:\WINDOWS\system32\x264vfw.dll

Description:  Xvid MPEG-4 video codec 1.3.2
ID:           VIDC.XVID
File name:    C:\WINDOWS\system32\xvidvfw.dll

Description:  ffdshow video codec
ID:           VIDC.FFDS
File name:    C:\WINDOWS\system32\ff_vfw.dll

Description:  AC3 ACM codec
ID:           msacm.ac3acm
File name:    C:\WINDOWS\system32\ac3acm.acm

(A total of 28 codecs, 5 shown, 23 hidden)
Do you need to transcode audio? And try specifying only resolution and vcodec with preset ultrafast (or superfast) for video. That should give you a better conversion speed with reasonable quality.
I think -acodec copy will do fine, and have since started removing some arguments to see if I get an increase in performance.

I considered using a preset, but was unsure if it would work with nDroid. Since with nDroid, you choose an option for bitrate. This I'm assuming fills in the the [OPTION] tags. So if those tags are removed, does that data still get "piped in?" I'm going to experiment in the mean time. I'm fine with not needing to change between bitrates. If my mobile speed won't allow streaming, oh well. I have near constant 10+mbps 4G or Wifi available 95% of the time anyways. So as long as it works with my internet's max upload I'm fine. As of right now, ffmpeg can't send the data over the pipe anywhere near that level. The bottleneck is my processor Sad

Thanks for the assistance so far, going to experiment a little.
Seems specifying resolution gets over ridden by nDroid when it requests the URL for the stream. Resolution and bitrate. I've essentially stripped it down to this:

-y -v 0 -i [SOURCE] -f mpegts -vcodec libx264 -acodec copy -preset ultrafast -pix_fmt yuv420p -threads 2 [TARGET]

I tried adding -s 480x270 but the output would always vary based on the nDroid option selected (over ridden). I added -pix_fmt yuv420p as some encoding options would not stream. MX Player on android or BS Player wouldn't play them. After adding this it seems to play any encoding option. No idea why.



I have noticed a slight increase in performance. I can stream 800k now a lot longer before it starts to jitter. 2 minutes or so.

This may be a long shot, but is there away to have a NPVR client do the encoding? Example: I have a laptop that I use as a HTPC client, much faster machine. Obviously can't hook up my PCI TV tuner to it, but could I have the laptop get the live .ts file, and then encode it and send it to the nDroid client?
EDIT: It may be worth mentioning the laptop is connected over 10/100 lan, and is on 24/7.
poor_red_neck Wrote:Seems specifying resolution gets over ridden by nDroid when it requests the URL for the stream. Resolution and bitrate.
Hmmm, not sure really. When transcoding using Live TV, nDroid simply creates a URL which is used to call the npvr web server. I'm not at my dev machine at the moment but I think it looks something like...
Code:
http://<ip-address>:<port>/transcode?channel=<channel>&resolution=<XY>&bitrate=<bitrate>
...when the npvr web server receives it, npvr then uses the <TranscodeArgs> command line and substitutes [RESOLUTION] and [BITRATE] for whatever has been passed to it in the URL. Basically at that point it is out of the hands of nDroid and it comes down to how npvr handles your modified <TranscodeArgs>.

To be honest transcoding with nDroid is limited and sub admits the /transcode url and ffmpeg approach used by npvr is hit and miss (not his exact words but I'm sure he'd agree with the sentiment).

As far as nDroid and playback are concerned (transcoded or not) I'm looking into using VLC via NEWA. UJB has done a lot of work creating new services which are more Android-friendly and initial tests with streaming using VLC are very promising.

Cheers,
Brian
P4's are single core. A few had hyperthreading available, just before the Core2Duo chips arrived on the scene, but were still just single core CPU's. Have you checked CPU usage on the host PC while it's trying to transcode? A P4 seems quite weak for that task.

You could also run CPU-Z to get the nitty-gritty details for your P4. If it is one of the newer design P4's (Socket 775?), then it may be possible to upgrade to a Core2Duo chip for very low bucks. I swapped up from a P4 HT CPU to an e4600 Core2Duo on my old HP DX2300 and it made a world of difference having a real 2nd core. IIRC, I got it for around $20 on eBay.
@HarryH3: There are actual dual-core Pentium 4's, using Prescott cores (though known as Smithfield and Pressler in dual-core form), for Socket 775. P4's with dual cores don't have hyperthreading though, so you don't get 4 logical cores like a Core i3 (except for the rare and expensive Extreme Edition). However I do suspect the OP has a single-core w/hyperthreading.
Thank you everyone for your replies. If I may bring up a previous question. Is it possible to have a 2nd machine do the transcoding? ie have one machine with the hardware tuner card and another accessing the live .ts stream over LAN and have it run ffmpeg to send to my phone? Please let me know if that wasn't described well enough.

Sent from my Galaxy Note 2 using Tapatalk
poor_red_neck Wrote:,,,, Is it possible to have a 2nd machine do the transcoding? ,,,

It would be better to upgrade to a quad core (or better)

I tried doing a lot of post processing transcoding and my P4 3.4 pinged at 100%. Upgraded to an AMD quad (see signature below) and I'm never above 60% with live TV on and 2-3 recordings processing. My Postproccessing.bat will first call comskip, then convert to avi at a resolution suited to my phone plus boost the audio +10db and finishing by creating a second avi copy less commercials and moving the copies to their respective folders.

Now I know you are talking about live TV but this machine was streaming live TV on LAN with nDroid no problem (my problems with nDroid are my upload (256k) and Windows firewall issues).
Pages: 1 2