FAQ  •  Register  •  Login

Transcoding HD .wtv files

<<

Xenu

Serviio newbie

Posts: 10

Joined: Tue Jan 08, 2013 9:05 pm

Post Sun Nov 03, 2013 9:37 am

Transcoding HD .wtv files

I have been able to set up that WTV files play on my device with this entry:

  Code:
      <Transcoding>
         <Video targetContainer="mpegts" targetACodec="ac3" forceVTranscoding="true">
            <Matches container="wtv"/>
         </Video>
      </Transcoding>


This works nicely for SD files, but not for HD files. There is stuttering. I am on a fixed line (not wifi) but my PC is already a few years old. I am wondering if I should transcode the files in advance. I tried to look at what serviio/ffmpeg has done with the file:

ffmpeg -i wtv hd file: (size 5GB)

Duration: 00:49:57.80, start: 2.548022, bitrate: 13863 kb/s
Stream #0:0[0x4f](deu): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 256 kb/s
Stream #0:1[0x50]: Video: h264 (High), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 10000k tbn, 100 tbc
Stream #0:2[0x51](deu): Subtitle: dvb_teletext
Stream #0:3[0x52](mul): Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 256 kb/s
Stream #0:4[0x0]: Video: mjpeg, yuvj420p, 200x113 [SAR 96:96 DAR 200:113], 90k tbr, 90k tbn, 90k tbc


ffmpeg -i .stf file from serviio: (15 GB ?!)

Duration: 00:49:58.76, start: 1.400000, bitrate: 39953 kb/s
Program 1
Metadata:
service_name : PHOENIX HD
service_provider: PHOENIX HD
Stream #0:0[0x100]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 100 tbc
Stream #0:1[0x101](deu): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s

The command that ffmpeg has used (I set up debug):

ffmpeg.exe -threads auto -i XXXXX\HD.wtv -y -threads auto -c:v libx264 -profile:v baseline -level 3 -preset veryfast -crf 10 -r 50 -g 15 -bsf:v h264_mp4toannexb -flags -global_header -c:a ac3 -b:a 192k -ac 2 -map 0:1 -map 0:0 -sn -f mpegts XXXXXX\AppData\Local\Temp\Serviio\transcoding-temp-1592-9-ORIGINAL.stf

My questions:
1) why is the resulting file so huge?
2) what setting should I try so that it is less huge but in the same quality?
What I'd like to get is something that is about the size as the original file, but in a format that Sam Sung, or Teufel (user agent: "IPI/1.0 UPnP/1.0 DLNADOC/1.50") can handle.
Direct transcoding-while-streaming into such a format would be nice, but I'd already be happy with some offline conversion parameters. Most of my recordings are not watched immediately, but in a few days.
3) What does the extension ".stf" stand for?
<<

atc98092

User avatar

DLNA master

Posts: 5433

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Mon Nov 04, 2013 12:04 am

Re: Transcoding HD .wtv files

For the .STF file format, I'll take a wild guess but it's probably "Serviio Transcoded File" :)

I have both SD and HD WTV files that play perfectly on all my devices. My network is wired gigabit, and my server has four cores and 8 gig of ram.

What are you play them on (what's your viewing device)? TV? Blu Ray player? Media Player? They all potentially have different transcoding configurations.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

Xenu

Serviio newbie

Posts: 10

Joined: Tue Jan 08, 2013 9:05 pm

Post Mon Nov 04, 2013 5:16 am

Re: Transcoding HD .wtv files

atc98092 wrote:For the .STF file format, I'll take a wild guess but it's probably "Serviio Transcoded File" :)

I have both SD and HD WTV files that play perfectly on all my devices. My network is wired gigabit, and my server has four cores and 8 gig of ram.

What are you play them on (what's your viewing device)? TV? Blu Ray player? Media Player? They all potentially have different transcoding configurations.


My devices are a Samsung F series TV and a Teufel blu ray player (user agent: "IPI/1.0 UPnP/1.0 DLNADOC/1.50"). My network is also wired gigabit, and my server has four cores and 8 gig of ram. But my question is more about converting the HD file to a format that has about the same size and that I could then play immediately i.e. without transcoding. Both of my devices can play ".mp4" files immediately.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Nov 04, 2013 12:49 pm

Re: Transcoding HD .wtv files

that's a question for the ffmpeg mailing list. But you could use -f mov (instead of mpegts) and name your file with .mov extension (or .mp4). The other parameters look fine.
<<

atc98092

User avatar

DLNA master

Posts: 5433

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Tue Nov 05, 2013 1:59 am

Re: Transcoding HD .wtv files

Xenu wrote:
atc98092 wrote:For the .STF file format, I'll take a wild guess but it's probably "Serviio Transcoded File" :)

I have both SD and HD WTV files that play perfectly on all my devices. My network is wired gigabit, and my server has four cores and 8 gig of ram.

What are you play them on (what's your viewing device)? TV? Blu Ray player? Media Player? They all potentially have different transcoding configurations.


My devices are a Samsung F series TV and a Teufel blu ray player (user agent: "IPI/1.0 UPnP/1.0 DLNADOC/1.50"). My network is also wired gigabit, and my server has four cores and 8 gig of ram. But my question is more about converting the HD file to a format that has about the same size and that I could then play immediately i.e. without transcoding. Both of my devices can play ".mp4" files immediately.


OK, I see no hardware issues there. I know that .wtv files are transcoded for all my devices, but I honestly don't see a noticable delay starting one. I just tried three different videos using my BDP-S3100: a DVD ripped to MKV (plays natively), an SD and an HD .wtv file. The .wtv files are transcoded to M2TS, and actually start playing faster than the native MKV file. Any of them begin playback within 6-10 seconds. My Panasonic TV takes a little longer, but then it's older. And none of them stutter. I'm perplexed. :?
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

Xenu

Serviio newbie

Posts: 10

Joined: Tue Jan 08, 2013 9:05 pm

Post Tue Nov 05, 2013 9:22 pm

Re: Transcoding HD .wtv files

But why is the converted file much bigger, although it is also h264, but in a different container? I tried to watch the converted file on the Teufel device (btw the .mov file is also much bigger than the wtv file) and do also get stuttering. So this suggests that it is too much for the network, sadly. Or are there two different h264 formats, one for WTV files and one for transcoding for DLNA?
<<

atc98092

User avatar

DLNA master

Posts: 5433

Joined: Fri Aug 17, 2012 10:22 pm

Location: Washington (the state)

Post Wed Nov 06, 2013 12:23 am

Re: Transcoding HD .wtv files

Xenu wrote:But why is the converted file much bigger, although it is also h264, but in a different container? I tried to watch the converted file on the Teufel device (btw the .mov file is also much bigger than the wtv file) and do also get stuttering. So this suggests that it is too much for the network, sadly. Or are there two different h264 formats, one for WTV files and one for transcoding for DLNA?


We are now out of my league. Transcoding is something I still haven't learned much about. I've been fortunate that it just works for my devices. I'll have to leave further troubleshooting to Zip and others.
Dan

LG NANO85 4K TV, Samsung JU7100 4K TV, Sony BDP-S3500, Sharp 4K Roku TV, Insignia Roku TV, Roku Ultra, Premiere and Stick, Nvidia Shield, Yamaha RX-V583 AVR.
Primary server: AMD Ryzen 5 5600GT, 32 gig ram, Windows 11 Pro, 22 TB hard drive space | Test server: Intel i5-6400, 16 gig ram, Windows 10 Pro

HOWTO: Enable debug logging HOWTO: Identify media file contents
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Wed Nov 06, 2013 12:55 am

Re: Transcoding HD .wtv files

The ffmpeg command being invoked by Serviio appears to be transcoding the video (the bit that reads -c:v libx264 -profile:v baseline -level 3). This will be the cause of the file size increase.

Not sure why this is happening though. Given your profile, I would have thought it should simply remux the video stream. Maybe remuxing isn't viable in this case and Serviio is recognising that and invoking a re-encode - zip again I'm afraid ;) . While awaiting his response you could see if remuxing works for this file - ffmpeg -i sourcefile.wtv -map 0 -c:v copy -c:a ac3 -b:a 192k -f mpegts destfile.mpeg substituting file names and ffmpeg location as appropriate.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

Xenu

Serviio newbie

Posts: 10

Joined: Tue Jan 08, 2013 9:05 pm

Post Wed Nov 06, 2013 6:30 am

Re: Transcoding HD .wtv files

DenyAll wrote:The ffmpeg command being invoked by Serviio appears to be transcoding the video (the bit that reads -c:v libx264 -profile:v baseline -level 3). This will be the cause of the file size increase.

Not sure why this is happening though. Given your profile, I would have thought it should simply remux the video stream. Maybe remuxing isn't viable in this case and Serviio is recognising that and invoking a re-encode - zip again I'm afraid ;) . While awaiting his response you could see if remuxing works for this file - ffmpeg -i sourcefile.wtv -map 0 -c:v copy -c:a ac3 -b:a 192k -f mpegts destfile.mpeg substituting file names and ffmpeg location as appropriate.


Thanks!!

The resulting file is slightly smaller, and I was able to watch it on both devices and without stuttering. (I had to make a slight change, replaced "-map 0" with "-map 0:1 -map 0:0" because of the error msg "Encoder (codec none) not found for output stream #0:2", but then it worked quickly.

So thanks again, I do now have a solution for converting HD files, even if my next question isn't answered (I think its similar to what you wrote):

Is there a serviio transcoding setting (xml) that would make this on the fly and result in a similar ffmpeg command?
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Wed Nov 06, 2013 12:09 pm

Re: Transcoding HD .wtv files

You know sometimes you look at things multiple times and still not see it..... the transcoding profile you included in the OP includes the command forceVTranscoding="true". Not sure why you included this but this is what is triggering re-encoding rather than simply remuxing the video. If you remove it I'm pretty sure you'll be right.

ps. you may also want to set an audio bitrate to give you better audio (default is 192k from memory):
eg. use <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384"> to remux your video and transcode your audio to AC-3 with a 384k bit rate.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

Xenu

Serviio newbie

Posts: 10

Joined: Tue Jan 08, 2013 9:05 pm

Post Wed Nov 06, 2013 4:52 pm

Re: Transcoding HD .wtv files

DenyAll wrote:You know sometimes you look at things multiple times and still not see it..... the transcoding profile you included in the OP includes the command forceVTranscoding="true". Not sure why you included this but this is what is triggering re-encoding rather than simply remuxing the video. If you remove it I'm pretty sure you'll be right.

ps. you may also want to set an audio bitrate to give you better audio (default is 192k from memory):
eg. use <Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384"> to remux your video and transcode your audio to AC-3 with a 384k bit rate.


I got the forceVTranscoding="true" from here (note also who responded :-) ):
viewtopic.php?p=15300#p15300

I will test your suggestions later this week, thanks.
<<

DenyAll

DLNA master

Posts: 2257

Joined: Fri Mar 08, 2013 11:16 pm

Location: Adelaide, Australia

Post Wed Nov 06, 2013 9:40 pm

Re: Transcoding HD .wtv files

That post seemed to be dealing with a limitation at the time in ffmpeg, which is now resolved. If I read it correctly, it was also re-encoding the video stream only where the source had a mpeg2 video stream (the matches command included the specific video type), and not h264 as yours does.

It was correct at the time to overcome an issue with transcoding WTV files with an mpeg2 video stream..... not so much now and not really applicable to your case.
DenyAll
Panasonic Viera FX800A | Panasonic Viera CS610A | Sony PS4 | Sony PS3 | Panasonic DMP-BD79 | Yamaha RX-V500D | iPad | Windows 10 | Serviio 1.10.1 Pro
WinHelper | MediaInfo

Beta Tester, Moderator
Please do not PM me for support as any solution cannot be shared with others.
<<

Xenu

Serviio newbie

Posts: 10

Joined: Tue Jan 08, 2013 9:05 pm

Post Sun Nov 10, 2013 2:12 pm

Re: Transcoding HD .wtv files

Xenu wrote:I will test your suggestions later this week, thanks.


Seems to work nicely, thanks. Although the Teufel device is much more capable than the Samsung TV.
<<

Randy12

Serviio newbie

Posts: 1

Joined: Wed Aug 28, 2013 6:32 am

Post Mon Nov 11, 2013 5:26 am

Re: Transcoding HD .wtv files

Hi!
I would really like to know what YOU consider the best Transcoding HD. wtv filesl. Please let me know what you think. I will test suggest it is nice. thanks 

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.