Transcode .WTV?

Need help? Post your questions here.

Moderator: moderators

Transcode .WTV?

Postby deleet » Sat Aug 20, 2011 5:33 am

Are there any transcoders out there that would let me stream unprotected .wtv files over my subsonic server without having to manually convert the files myself? It'd be nice to be able to stream the TV shows I set to record without having to wait until I get home and convert them manually. I tried googling it myself, but the closest I can find is a command-line converters to .dvr-ms format.
deleet
 
Posts: 12
Joined: Sun Jul 17, 2011 6:23 pm

Re: Transcode .WTV?

Postby GJ51 » Sat Aug 20, 2011 5:48 am

ffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset fast -threads 0 -
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Transcode .WTV?

Postby deleet » Sat Aug 20, 2011 6:17 am

Thanks for the speedy reply!

I added that, but my files still aren't showing up. I already have ffmpeg installed (and can stream .avi movies fine), but is there anything else I need to do short of adding that line to the settings menu?

Under the transcoding menu of settings:
Name: wtv > flv
From: wtv
To: flv
Step 1: ffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset fast -threads 0 -
Step 2 and 3: [blank]
Default and enabled are checked.
deleet
 
Posts: 12
Joined: Sun Jul 17, 2011 6:23 pm

Re: Transcode .WTV?

Postby GJ51 » Sat Aug 20, 2011 6:25 am

Check any Player that was created before you added the new string. You may need to check the box for previously created players to use the new settings.

The -threads 0 setting may require an updated version of ffmpeg, if you set "-threads 1" then it should work with older versions. If not try:

ffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -

.wtv files play fine on my setup.

http://maplegrovepartners.subsonic.org/share/tqzQt
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Transcode .WTV?

Postby deleet » Sat Aug 20, 2011 7:07 am

Well, after further digging, I made two stupid errors.
1. I forgot to add .wtv as a video mask under Settings -> General (this is what was probably keeping the file from showing up)
2. I neglected to enable the transcoding under Settings -> Players -> Active Transcoders (this is what you noted)

Both of these errors have since been rectified, and I have tried all three variations on the "Step 1" (and made sure that it was active each time).

Now the files are showing up, but get added to the queue at the bottom as though they were music files and don't play anything. In the queue, they appear as:
[File Name] [File Folder] flv [File Size]

...is there anything else silly I could be missing?

EDIT:
If it's of any help, here's a sample of the debug output in the log:
Code: Select all
[8/20/11 2:03:43 AM CDT]    DEBUG   TranscodeInputStream   Starting transcoder: [c:\subsonic\transcode\ffmpeg] [-ss] [%o] [-i] [m:\recorded tv\Arthur\Arthur_KUHTDT_2011_08_19_14_28_00.wtv] [-async] [30] [-b] [128k] [-r] [23-.976] [-s] [%wx%h] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-vcodec] [libx264] [-preset] [fast] [-threads] [0] [-]
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) ffmpeg version N-31653-gfaa3381, Copyright (c) 2000-2011 the FFmpeg developers
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) built on Jul 28 2011 01:57:12 with gcc 4.6.1
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) libavutil 51. 11. 0 / 51. 11. 0
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) libavcodec 53. 9. 0 / 53. 9. 0
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) libavformat 53. 6. 0 / 53. 6. 0
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) libavdevice 53. 2. 0 / 53. 2. 0
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) libavfilter 2. 27. 3 / 2. 27. 3
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) libswscale 2. 0. 0 / 2. 0. 0
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) libpostproc 51. 2. 0 / 51. 2. 0
[8/20/11 2:03:43 AM CDT]    DEBUG   InputStreamReaderThread   (c:\subsonic\transcode\ffmpeg) Invalid duration specification for ss: %o


The last line strikes me as odd, given that %o is the second parameter given to all of the default ffmpeg transcoders anyways...
deleet
 
Posts: 12
Joined: Sun Jul 17, 2011 6:23 pm

Re: Transcode .WTV?

Postby GJ51 » Sat Aug 20, 2011 3:55 pm

Sorry, I think there's another mod that has to be made to one of the .jsp files to make this work. I'll post it as soon as I can find it in my notes. It is also already posted somewhere here in the forum if you want to do some searching, but I should be able to find it in a bit.

I think this is what I did:

edited playlist.jsp

}
if (song.format == "aac" || song.format == "m4a" || song.format == "wtv") {


I didn't think it was really a necessary step, but it may in fact be required to identify .wtv as a video file.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Transcode .WTV?

Postby deleet » Sat Aug 20, 2011 9:27 pm

After adding that code I can view and play .wtv files.

However, I still have two (relatively minor) problems.

1. The progress bar does not display the current time, total length, or progress. (I could live with this if it came down to it, though.)
2. The image is distorted. The program I was trying to play was originally a 4:3 aspect ratio, but when it was transmitted over ATSC it was letterboxed to 16:9. When played in subsonic, it gets letterboxed from 4:3 to 16:9 AGAIN, resulting in a near-square in the center of the 16:9 display box.
I am not certain if this has anything to do with the fact that it was originally 4:3 and it's reading some kind of included metadata wrong, or if it will do this with all .wtv files. I currently do not have any .wtv files that were originally 16:9 to confirm/deny this with.

Current Step 1:
ffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset fast -threads 1 -
deleet
 
Posts: 12
Joined: Sun Jul 17, 2011 6:23 pm

Re: Transcode .WTV?

Postby GJ51 » Sun Aug 21, 2011 12:31 am

Yes, wtv files do not allow you to seek within the file unless they are played in WMC, the progress bar does not work.

The %wx%h settings in the transcode string can be changed, but I'm not really an expert on the subject. I learned most of what I did to make it work from others here in the forum.

I have read that Sindre plans to incorporate wtv support into an upcoming build and is working on transcodings as well, so hopefully a more flexible solution is in the works. I record almost everything at 1080i off my cable, so I haven't had the aspect ration problems you mention. http://ffmpeg.org/ has the documentation that explains all the option in the transcode strings if you want to look into it further, but it's a bit deep for me.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Transcode .WTV?

Postby deleet » Sun Aug 21, 2011 2:02 am

I'm glad to hear that, although I certainly hope he has more luck with it than I have had...

So, I managed to fix the aspect ratio by forcing -r to something that was 16:9 (ex hd480). Interestingly, the -aspect flag didn't work.

However, now I'm having streaming problems. I can watch fine for about :15 seconds until it stops and forces me to start over from the beginning. Each time I restart, I can get a little farther before it does this again. Lowering the bitrate on the player or forcing a lower resolution seems to increase the time until it cuts off, but I can't make it through the opening song while still being able to see what's going on in the show.

Also, If I try to stream from a non-admin account, I get a "video not found or access denied" error in the player.
deleet
 
Posts: 12
Joined: Sun Jul 17, 2011 6:23 pm

Re: Transcode .WTV?

Postby GJ51 » Sun Aug 21, 2011 4:30 am

Sounds like your CPU may not be able to handle the demans of the transcoding, it takes a ggod bit of CPU power. I'm running a quad core Xeon so I'm good for everything up to Blue Ray quality. The less CPU power you have, the lower the quality the transcoding can handle and still keep up with the data stream.

Subsonic has to have permission to the folder of the file being transcoded. This works fine in windows if the data is stored on a local drive as Subsonic has local user rights by default, but if you try to access a network share, the you have to edit the Subsonic logon properties to give it logon rights of a user account that has access to the share.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Transcode .WTV?

Postby deleet » Sun Aug 21, 2011 5:01 am

I'm pretty sure it's not the processor power; If I unload everything else my computer is doing and try to transcode the .wtv files, I only report around 30% average CPU usage, although one out of the four cores looks like it's taking about 60%-70%. Additionally, I can transcode movies from Blu-ray quality avis to 500 kbps flv without any problems and with the CPU only at about 20-25% load. (I haven't sat through a whole movie, granted, but it gets through the first 5 minutes or so with no problems.) Do wtv files take that much more processing power...?

Also, the files are stored on a local drive, albeit one that isn't the same as the one that the OS is on. I'm not sure if it's clear in my earlier post, but I meant an admin account on Subsonic. I first noticed the issue when I switched back to my normal (non-admin) account to stream music after having been logged in to the Admin account to adjust the settings for transcoding. (It should be noted that this non-admin account can still view movies with no problems.)
Last edited by deleet on Sun Aug 21, 2011 5:13 am, edited 1 time in total.
deleet
 
Posts: 12
Joined: Sun Jul 17, 2011 6:23 pm

Re: Transcode .WTV?

Postby GJ51 » Sun Aug 21, 2011 5:13 am

Change the transcoding to "-threads 0"

If it doesn't work, then you have to get one of the newer releases of ffmpeg and update in the transcode directory.


ffmpeg - go to http://ffmpeg.zeranoe.com/builds/ and download the latest static build for your system. This site is for Windows builds. Check http://www.ffmpeg.org/download.html for other OS's. I just extracted the ffmpeg.exe and replaced the file in C:\Subsonic\transcode
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Transcode .WTV?

Postby deleet » Sun Aug 21, 2011 5:28 am

Updating the version of ffmpeg did the trick-- I got through the first 5 minutes or uneventfully. I should've learned that by now, given how many times running on outdated software has given me grief....

Thanks again for helping!

EDIT: I still didn't fix the errors I got when not on an administrative account, but by flagging my "non admin" account as an admin, but removing the ability to change any settings/passwords, I was able to find a suitable compromise.
deleet
 
Posts: 12
Joined: Sun Jul 17, 2011 6:23 pm

Re: Transcode .WTV?

Postby ncaahockeyfan » Mon Sep 05, 2011 4:48 pm

thank you for the instructions. I can now stream WTV through Subsonic; however, whenever I stream a WTV file w/5.1 audio, I get NO audio in the stream. WTV files w/stereo audio stream the audio fine. any suggestions? thanks again!
ncaahockeyfan
 
Posts: 1
Joined: Mon Sep 05, 2011 4:45 pm

Re: Transcode .WTV?

Postby GJ51 » Tue Jan 31, 2012 7:51 pm

Sorry I've been gone for a bit. i used to have problems with 5.1, but they work fine now with ver. 4.6 and the latest ffmpeg. WTV still needs support in SS for the seek bar and time indexing to work. It would also be cool if it could pick up any description data and display it as well. Still very cool to be able to play recorded TV files on SS if you have the CPU power and bandwidth.

I just picked up a used HP XW8600 workstation on ebay with dual quad core Xeon's at 2.83GHz and 16 GB ram. It can handle multiple transcoded video streams very well. I've tested 3 at once with NO buffering. I can now finally watch a 1080i recorded TV program on my Android phone when I have a good connection on my phone, sometimes even over 3G. Truly Amazing. :mrgreen:
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Next

Return to Help

Who is online

Users browsing this forum: No registered users and 19 guests