SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #121  
Old 10-28-2021, 06:47 AM
jvl711's Avatar
jvl711 jvl711 is offline
Sage Fanatic
 
Join Date: Jan 2004
Posts: 790
Quote:
Originally Posted by phelme View Post
I tried an H.265 MKV the other day through my HD300 and while it definitely was being transcoded through the plugin (x64) , the quality wasn't great and was very pixelated. The server is a 4-core AMD so should be able to handle it.

Is there something I maybe need to configure that I haven't?

I'm not sure which version I'm using so I'll have to double check that.
I think the Server handles the transcoding for the HD300. I think it will dynamically adjust the rate based on bandwidth. I have not used the HD300 in some time since moving to 4k/h.265. Maybe someone else would have an better idea.

It is awesome to hear it is actually working. I put a lot of work trying to get to that point . I never actually tested it because I am using all android clients.
__________________
Projects I am currently maintaining
SageTV Andoid Client
Media Format Parser Plugin
JavaFFmpegLibrary
SageTVTranscoder

If you like the work I am doing and would like to support it you can become a Patreon member.
Reply With Quote
  #122  
Old 10-28-2021, 04:30 PM
KryptoNyte's Avatar
KryptoNyte KryptoNyte is offline
SageTVaholic
 
Join Date: Dec 2006
Posts: 2,603
Hmmmm. Maybe I'm going to have to start testing the HD300 at my other place, remotely, and see how it goes. I've never actually been able to get an HD300 connected remotely, so this might be interesting.
Reply With Quote
  #123  
Old 10-30-2021, 06:29 PM
pjpjpjpj pjpjpjpj is offline
Sage Icon
 
Join Date: Feb 2008
Posts: 2,154
I've been very sporadic in following this thread (life, sigh...) and I see some stuff on the prior page but not *exactly* my question...

I record OTA via HDHR (raw MPEG-2). I know this has historically caused all sorts of issues with transcoding and remote clients, and I believe somewhere I read that a solution is using OpenDCT, but I haven't followed that enough to jump into it. I believe some say it requires IJK (maybe?) but ExoPlayer is what everyone "wants" to use. I've been very busy and not able to spend a lot of time so I'd love it if this were the old-school Sage plugin compatibility of "install the plugin and it just works".

Long story short, will this plugin allow me to transcode an OTA recording from a HDHR in real time to MKV and send it to a remote client?

(to be clear, if the answer is "no" or "not yet", that's cool, just asking. )
__________________
Server: AMD Athlon II x4 635 2.9GHz, 8 Gb RAM, Win 10 x64, Java 8, Gigabit network
Drives: Several TB of internal SATA and external USB drives, no NAS or RAID or such...
Software: SageTV v9x64, stock STV with ADM.
Tuners: 4 tuners via (2) HDHomeruns (100% OTA, DIY antennas in the attic).
Clients: Several HD300s, HD200s, even an old HD100, all on wired LAN. Latest firmware for each.
Reply With Quote
  #124  
Old 11-02-2021, 06:24 PM
Malfunction Malfunction is offline
Sage Aficionado
 
Join Date: Sep 2004
Location: Willoughby, Ohio
Posts: 386
Is there a command line option to reduce the resolution of something you're compressing with Matroska? I record a number of old shows that would look fine in 16:9 480p, but are recording in 1080p because they're on cable channels such as RFD-TV. I know this can be done with AVI.
__________________
ASRock B450M Pro4 AM4 MB, Ryzen 5 2600 3.4ghz, Crucial Ballistix Gaming 32GB (2 x 16GB) DDR4-3200, EVGA GT 1030SC, WD Black NVMe SSD 250GB, 1x WD120EFAX 12TB, 1x WD80EFAX 8TB, 1x WDBH2D0040HNC 4TB, USB-UIRT, Colossus 2, WinTV-DualHD USB, Windows 11 64bit
Reply With Quote
  #125  
Old 12-12-2021, 10:03 PM
CptKirk CptKirk is offline
Sage Advanced User
 
Join Date: Sep 2010
Posts: 237
Transcoding files problem

I've got the transcoding and detector plugins installed and have nplayer's mkv formats added. I use the MKV Fast setting to change most tv recordings from .ts to .mkv.

I looked at the Video Conversions a bit ago and notice a few Converted, a whole bunch of failed and another whole bunch of waiting.

I've got the following loaded up in Notepad++: Sage.properties, SageTVTranscoder.log, sagetv_0.txt, sagetv_1.txt, sagetv_1.txt, sagetv_1.txt

If I search for Converted files and Failed files I cannot really see anything in the SageTVTranscoder.log file that shows/tells why one converted and one failed.

Right now it has a whole bunch sitting in the Waiting status with the one on top showing "Converting - 0%".

If I look at the Task Manager, SageTVTranscoder.exe *32 is at a constant 30% CPU utilization and 179,664K memory usage.

Is there a way to try and debug why I am seeing so many failures?
__________________
SageTV running on: Win10 21H2
SageTV 9.2.6.976 (64 bit)
Java 1.8.0 311 (64 bit)
OpenDCT 0.5.32 (64 bit) (Comcast Music channels set to FFmpeg)
Clients: HD300 (x2)
HDHR3-CC Prime 20210624 (Comcast CableCard) - 3 Tuners
Hauppauge 1950 STB SD (USB-UIRT Zone 1)
Hauppauge 1950 STB SD (USB-UIRT Zone 2)
Reply With Quote
  #126  
Old 12-13-2021, 10:50 AM
jvl711's Avatar
jvl711 jvl711 is offline
Sage Fanatic
 
Join Date: Jan 2004
Posts: 790
Quote:
Originally Posted by CptKirk View Post
I've got the transcoding and detector plugins installed and have nplayer's mkv formats added. I use the MKV Fast setting to change most tv recordings from .ts to .mkv.

I looked at the Video Conversions a bit ago and notice a few Converted, a whole bunch of failed and another whole bunch of waiting.

I've got the following loaded up in Notepad++: Sage.properties, SageTVTranscoder.log, sagetv_0.txt, sagetv_1.txt, sagetv_1.txt, sagetv_1.txt

If I search for Converted files and Failed files I cannot really see anything in the SageTVTranscoder.log file that shows/tells why one converted and one failed.

Right now it has a whole bunch sitting in the Waiting status with the one on top showing "Converting - 0%".

If I look at the Task Manager, SageTVTranscoder.exe *32 is at a constant 30% CPU utilization and 179,664K memory usage.

Is there a way to try and debug why I am seeing so many failures?
I am not sure if the progress works with the new transcoder. SageTV is reading the STDOUT of the process and I think it is looking for a certain output for the percentage. This is something I need to look into at some point. So 0% progress does not really mean there was a failure. I would first look at the SageTV log files and see if there is any error from the transcode to go after. That is where I would start.

Josh
__________________
Projects I am currently maintaining
SageTV Andoid Client
Media Format Parser Plugin
JavaFFmpegLibrary
SageTVTranscoder

If you like the work I am doing and would like to support it you can become a Patreon member.
Reply With Quote
  #127  
Old 12-13-2021, 08:31 PM
CptKirk CptKirk is offline
Sage Advanced User
 
Join Date: Sep 2010
Posts: 237
Will do. I'm away from home for a week. I'll dig into this when I get back.
__________________
SageTV running on: Win10 21H2
SageTV 9.2.6.976 (64 bit)
Java 1.8.0 311 (64 bit)
OpenDCT 0.5.32 (64 bit) (Comcast Music channels set to FFmpeg)
Clients: HD300 (x2)
HDHR3-CC Prime 20210624 (Comcast CableCard) - 3 Tuners
Hauppauge 1950 STB SD (USB-UIRT Zone 1)
Hauppauge 1950 STB SD (USB-UIRT Zone 2)
Reply With Quote
  #128  
Old 12-15-2021, 12:38 AM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 128
Quote:
Originally Posted by jvl711 View Post
Awesome! I will try and package that up this week and push it out.

Thank you for taking a look.

Josh
I rebuild my SageTV using linux docker to use OpenDCT so playback with the miniclient is better. Since I have many recording I need to fix I tried to transcode with copy but for some reason it fails. I'm using it with Java11 and SageTv Server 9.2.6.1.

I get the following in SageTVTrancoder.log:
Code:
################################ Exiting ################################
################################ SageTVTranscoder (FFmpeg) starting ################################
Arguments: /opt/sagetv/server/ffmpeg -dumpmetadata -v 2 -i /var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.mpg 
################################ SageTVTranscoder (FFmpeg) starting ################################
Arguments: /opt/sagetv/server/ffmpeg -v 3 -y -threads 2 -sn -vsync 1 -async 100 -stdinctrl -i /var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.mpg -threads 7 -f matroska -c copy -aspect 16:9 -deinterlace -map 0:1 -map 0:0 /var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.tmp 
Exiting for some other reason
################################ Exiting ################################
If I copy paste the command in shell window I get the following output:
Code:
[matroska @ 0x25ef640] Starting new cluster with timestamp 2387680 at offset 3338167749 bytes
[matroska @ 0x25ef640] Writing block of size 1536 with pts 2387680, dts 2387680, duration 32 at relative offset 11 in cluster at offset 3338167749. TrackNumber 2, keyframe 1
[matroska @ 0x25ef640] Can't write packet with unknown timestamp
av_interleaved_write_frame(): Invalid argument
No more output streams to write to, finishing.
[matroska @ 0x25ef640] Writing block of size 1536 with pts 2387712, dts 2387712, duration 32 at relative offset 1554 in cluster at offset 3338167749. TrackNumber 2, keyframe 1
[matroska @ 0x25ef640] Writing block of size 35080 with pts 2387738, dts 2387738, duration 33 at relative offset 3097 in cluster at offset 3338167749. TrackNumber 1, keyframe 0
[matroska @ 0x25ef640] Writing block of size 38398 with pts 2387772, dts 2387772, duration 33 at relative offset 38185 in cluster at offset 3338167749. TrackNumber 1, keyframe 0
[matroska @ 0x25ef640] Can't write packet with unknown timestamp
[matroska @ 0x25ef640] end duration = 2387805
[matroska @ 0x25ef640] stream 0 end duration = 2387805
[matroska @ 0x25ef640] stream 1 end duration = 2387744
Error writing trailer of /var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.tmp: Invalid argument
frame=71552 fps=1763 q=-1.0 Lsize= 3260042kB time=0.010 bitrate=11182.6kbits/s speed=58.9x
video:3147424kB audio:111925kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.021282%
Input file #0 (/var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.mpg):
  Input stream #0:0 (audio): 74616 packets read (114610902 bytes);
  Input stream #0:1 (video): 71552 packets read (3222962133 bytes);
  Input stream #0:2 (audio): 0 packets read (0 bytes);
  Total: 146168 packets (3337573035 bytes) demuxed
Output file #0 (/var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.tmp):
  Output stream #0:0 (video): 71552 packets muxed (3222962133 bytes);
  Output stream #0:1 (audio): 74616 packets muxed (114610902 bytes);
  Total: 146168 packets (3337573035 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x261b0c0] Statistics: 2 seeks, 12736 writeouts
[AVIOContext @ 0x25f34c0] Statistics: 3466383504 bytes read, 2 seeks
Conversion failed!
Here are the steps I used to install SageTVTranscoder-FFmpeg, MediaFormatParserPlugin and updated transcode profiles:

Code:
###Install jv711_SageTVTranscoder-FFmpeg....This can also be installed as SageTV Plugin which is safer
mv /opt/sagetv/server/ffmpeg /opt/sagetv/server/ffmpeg.org 
wget https://github.com/jvl711/SageTVTranscoder-FFmpeg/releases/download/SageTVTranscoder_v1.0.6/SageTVTranscoderLinux_v1.0.6.zip
unzip -o SageTVTranscoderLinux_v1.0.6.zip -d /opt/sagetv/server
rm SageTVTranscoderLinux_v1.0.6.zip

###Install New Trancoder Profiles
echo '
transcoder/formats/MKV-H264\superfast\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset superfast -c:v libx264;]
transcoder/formats/MKV-H264\veryfast\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset veryfast -c:v libx264;]
transcoder/formats/MKV-H264\faster\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset faster -c:v libx264;]
transcoder/formats/MKV-H264\fast\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset fast -c:v libx264;]
transcoder/formats/MKV-H264\Medium\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset medium -c:v libx264;]
transcoder/formats/MKV-H264\slow\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset slow -c:v libx264;]
transcoder/formats/MKV-H264\slower\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset slower -c:v libx264;]
transcoder/formats/MKV-H264\veryslow\ MKV=f\=matroska;MCompressionDetails\=-c copy -preset veryslow -c:v libx264;]
transcoder/formats/MKV-Remux\ MKV=f\=matroska;MCompressionDetails\=-c copy;]
' >>  /opt/sagetv/server/Sage.properties

###Install jv711_MediaFormatParserPlugin
wget https://github.com/jvl711/MediaFormatParserPlugin/releases/download/0.7/MediaFormatParserPlugin_v0.7.zip
unzip -o MediaFormatParserPlugin_v0.7.zip -d /opt/sagetv/server/JARs
rm MediaFormatParserPlugin_v0.7.zip
sed -i '/mediafile_mediaformat_parser_plugin/d' /opt/sagetv/server/Sage.properties
echo 'mediafile_mediaformat_parser_plugin=jvl.mediaformat.MediaFormatParserPlugin' >>  /opt/sagetv/server/Sage.properties
It starts the conversion but stops midway
Code:
12/15/2021  12:17 AM     3,338,283,324 ForeverYoungSearchingfortheFountainofYouth-45451932-0.tmp
11/28/2021  10:00 PM     5,217,087,124 ForeverYoungSearchingfortheFountainofYouth-45451932-0.mpg
11/28/2021  11:17 PM               161 ForeverYoungSearchingfortheFountainofYouth-45451932-0.txt
11/28/2021  11:17 PM               135 ForeverYoungSearchingfortheFountainofYouth-45451932-0.edl
11/28/2021  11:00 PM             9,211 ForeverYoungSearchingfortheFountainofYouth-45451932-0.logo.txt
11/28/2021  11:17 PM           402,888 ForeverYoungSearchingfortheFountainofYouth-45451932-0.log
               6 File(s)  8,555,782,843 bytes
               0 Dir(s)  6,666,951,823,360 bytes free
I can get it to work if I add the following switch -fflags +genpts. Anyone know how to add this to a profile?
Code:
/opt/sagetv/server/ffmpeg -fflags +genpts -v 3 -y -threads 2 -sn -vsync 1 -async 100 -stdinctrl -i /var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.mpg -threads 7 -f matroska -c copy -aspect 16:9 -deinterlace -map 0:1 -map 0:0 /var/media/tv/ForeverYoungSearchingfortheFountainofYouth-45451932-0.mkv
I found a workaround by using a man in the middle script but it would be better to store in the profile
Code:
mv /opt/sagetv/server/ffmpeg /opt/sagetv/server/ffmpeg.run
echo '/opt/sagetv/server/ffmpeg.run -fflags +genpts "$@"' >  /opt/sagetv/server/ffmpeg
chmod 777 /opt/sagetv/server/ffmpeg

Last edited by hvymetal; 12-15-2021 at 01:57 AM.
Reply With Quote
  #129  
Old 01-06-2022, 06:32 PM
hvymetal hvymetal is offline
Sage Advanced User
 
Join Date: Nov 2007
Posts: 128
I found an issue with the plugin(At least for Linux). When you install a new version of SageTV it overwrites the ffmpeg that is installed via the plugin.

In the mean time I use the following workaround I posted above by using a man in middle script. If the plugin gets updated you need to remember to repeat step 1.

Code:
1.  Install the plugin
2.  ###rename ffmpeg to ffmpeg.run
     mv /opt/sagetv/server/ffmpeg /opt/sagetv/server/ffmpeg.run
3.  ###When using docker and the following lines to sagetv-user-script.sh
     ######Workaround for FFPEG options -fflags +genpts  
     echo '/opt/sagetv/server/ffmpeg.run -fflags +genpts "$@"' > /opt/sagetv/server/ffmpeg
     chmod 777 /opt/sagetv/server/ffmpeg
Reply With Quote
  #130  
Old 01-18-2022, 08:45 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,324
A question regarding this plugin - on Linux if that matters.

My understanding is that this program will transcode content in realtime. For example it will transcode a H.265 file that you play on a HD300 extender as an HD300 does not support H.265 files. Is that correct? Does it also transcode files to resolutions that are supported - such as transcoding a 2160p file to 1080p when you try to play it on an extender?

Will it also transcode files being played on Placeshifter - such as fix the problem where 1080i files have never played properly on SageTV Placeshifter?

Is there any way to specify which file types get transcoded? And what the destination resolution is - like if you want the destination playback to be 720p or 1080p or whatever?
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SageTVTranscoder.exe from 6.5.14 Stuntman SageTV Beta Test Software 2 05-13-2009 08:17 AM
What does SageTVtranscoder.exe do? autoboy SageTV Software 5 04-23-2008 01:55 PM
sagetvtranscoder.exe always at 50% showson1 SageTV Software 3 03-30-2008 01:46 AM
SageTVTranscoder.exe jgsouthard SageTV Beta Test Software 40 11-03-2007 01:13 PM
SageTvTranscoder.exe ?? mike_15 SageTV Software 4 10-21-2007 09:42 PM


All times are GMT -6. The time now is 01:29 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.