FAQ  •  Register  •  Login

Force AVC transcoding for Bravia

<<

fgouvea

Serviio newbie

Posts: 9

Joined: Sun Feb 20, 2011 8:47 pm

Post Fri Apr 20, 2012 4:18 am

Force AVC transcoding for Bravia

Hi guys,

I`m trying to force Matroska AVC to be transcoded for my 2010 Bravia. The problem is that I have Serviio running on 54g Wifi, and I have a couple of high quality MKVs that I would like transcoded with maxVBitrate="17000". The way things are now, I get choppy video depending on the scene bit rate (fireworks, water and such demand a very high bit rate).

After reading the tutorial and lots of posts, I considered myself an expert :lol: and changed my profile.

Then I went to profile 9, and right after the ASF transcoding, I added mine:


<Video targetContainer="mpegts" targetACodec="ac3" forceVTranscoding="true" forceInheritance="true">
<Matches container="asf" vCodec="mpeg2video" />
</Video>

<!-- Transcoded mkv AVC as well so we can limit bandwidth o video for WIFI 54G -->
<Video targetContainer="mpegts" forceVTranscoding="true" targetVCodec="mpeg2video" maxVBitrate="17000" targetACodec="ac3" aBitrate="384" forceInheritance="true">
<Matches container="matroska" vCodec="h264" />
</Video>



I also commented out matroska rule from the remuxing profiles:

<!-- Remux h264 video with AC3 audio to MPEG-TS stream without transcoding -->
<!-- expected profile AVC_TS_MP_HD_AC3_ISO -->
<Video targetContainer="mpegts" forceInheritance="true">
<Matches container="avi" vCodec="h264" aCodec="ac3" />
<Matches container="mp4" vCodec="h264" aCodec="ac3" />
<!-- Transcoded mkv AVC as well so we can limit bandwidth o video for WIFI 54G -->
<!-- Matches container="matroska" vCodec="h264" aCodec="ac3" -->

</Video>
<!-- Remux all other h264 video to MPEG-TS stream with ac3 audio transcoding -->
<!-- expected profile AVC_TS_MP_HD_AC3_ISO -->
<Video targetContainer="mpegts" targetACodec="ac3" aBitrate="384" forceInheritance="true">
<Matches container="avi" vCodec="h264" />
<Matches container="mp4" vCodec="h264" />
<Matches container="flv" vCodec="h264" />
<!-- Transcoded mkv AVC as well so we can limit bandwidth o video for WIFI 54G -->
<!-- Matches container="matroska" vCodec="h264" -->

<!-- if audio different to ac3, must be transcoded -->
<Matches container="mpegts" aCodec="aac" />
<Matches container="mpegts" aCodec="mp3" />
<Matches container="mpegts" aCodec="dca" />
<Matches container="mpegts" aCodec="lpcm" />
<Matches container="mpeg" aCodec="dca" />
<Matches container="ogg" vCodec="mpeg4" />
</Video>


But I still get my movie remuxed as follows:

2012-04-20 00:42:05,654 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: C:\Users\ASUS\Videos\Enrolados.(Tangled).2010.BluRay.1080p.pt-br.eng\Enrolados.2010.BluRay.1080p.Dublado (1) (1).mkv
2012-04-20 00:42:05,655 DEBUG [ProcessExecutor] Starting C:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i C:\Users\ASUS\Videos\Enrolados.(Tangled).2010.BluRay.1080p.pt-br.eng\Enrolados.2010.BluRay.1080p.Dublado (1) (1).mkv -y -async 1 -vcodec copy -vbsf h264_mp4toannexb -copyts -acodec ac3 -ab 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts C:\Windows\TEMP\Serviio\transcoding-temp-587-MPEG2TS.stf


Does anybody know what the noob is missing here? The full profile is attached, just in case :)

Thanks
Attachments
profiles.xml
My modified profile
(58.49 KiB) Downloaded 549 times
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Fri Apr 20, 2012 7:18 am

Re: Force AVC transcoding for Bravia

fgouvea wrote:...
But I still get my movie remuxed as follows:
...
Does anybody know what the noob is missing here? The full profile is attached, just in case :)


Strange, your profile seems good:
forceVTranscoding="true" could be removed
  Code:
         <!-- Transcoded mkv AVC as well so we can limit bandwidth o video for WIFI 54G -->
         <Video targetContainer="mpegts" targetVCodec="mpeg2video" maxVBitrate="17000" targetACodec="ac3" aBitrate="384" forceInheritance="true">
            <Matches container="matroska" vCodec="h264" />
         </Video>


Stupid question, do you restart serviio service after profile modification? (you can also restart the PC)
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

fgouvea

Serviio newbie

Posts: 9

Joined: Sun Feb 20, 2011 8:47 pm

Post Sat Apr 21, 2012 3:51 am

Re: Force AVC transcoding for Bravia

Thank you Illico, the stupid here was just stopping the server and deleting the temp transcoded file (from c:\windows\temp\serviio).

Now, the movie is being recognized as MPEG_TS_SD_NA_ISO. It was AVC_HD_* something...

And this is how ffmpeg has been invoked for transcoding:

C:\Program Files\Serviio\bin\\..\lib/ffmpeg.exe -i Tangled.mkv -y -threads 2 -async 1 -vcodec mpeg2video -b 17000k -maxrate 17000k -bufsize 17000k -r 24000/1001 -g 15 -copyts -acodec ac3 -ab 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts C:\Windows\TEMP\Serviio\transcoding-temp-587-MPEG2TS.stf


Well, now I have two problems:
First is that the resulting transcoded video is a bit wider than it was originally (I have black bars on the top and bottom of the image, and people look a bit fat now ;) ). But that is not the real problem.
The second and real problem is that transcoding is taking forever! So video is still choppy. If I pause it for a couple of minutes (in order to give ffmpeg some room), then when I resume the video, it goes ok for a couple of seconds and then gets choppy again. (by the way, see the spec of my laptop in my signature - not bad).
It has been transcoding for more than one hour, and the temp file is still around 2.5gb (I remember that when ffmpeg as using -vcode copy, the final file size was 7.5 gb). The video is only one hour and 40 mins long.

By studying the logs today, I just realized I could use ffmpeg to give me information about the original video. That is what ffmpeg tells about the file I`m trying to get transcoded:

Duration: 01:40:16.51, start: 0.000000, bitrate: 8671 kb/s
Chapter #0.0: start 0.097000, end 6016.513000
Metadata:
title : 00:00:00.097
Stream #0:0(por): Video: h264 (High), yuv420p, 1876x1080, SAR 1:1 DAR 469:270, 23.98 fps, 48 tbr, 1k tbn, 47.95 tbc
Metadata:
title : Tangled.2010
Stream #0:1(por): Audio: mp3, 44100 Hz, stereo, s16, 128 kb/s (default)
Metadata:
title : Portugues-BR
Stream #0:2(eng): Audio: aac, 48000 Hz, stereo, s16


First thing I noticed is that the original bitrate is 8671 kb/s. So, looks like maxVBitrate="17000" is useless, isn`t it? So, does any body know how could I make transcoding faster and the resulting video lighter while still keep a reasonable (slightly above DVD) quality? I know for instance that I hardly ever get choppy videos on 720p, but what I read on the forum so far shows that resizing is not simple to be done, right?

Thank you very much!

Core I5-430M + 4GB RAM
ATI Mobility Radeon HD 5470 (DDR3 1GB)
<<

fgouvea

Serviio newbie

Posts: 9

Joined: Sun Feb 20, 2011 8:47 pm

Post Tue Apr 24, 2012 4:11 am

Re: Force AVC transcoding for Bravia

Yes, I was thinking a bit further about the bit rate ffmpeg gave me, I thought that was too low. So I used bitrate viewer and realized ffmpeg gives me the average, while that movie has peaks of 51kbps!
It seems the best thing I can do is to re-encode the video following the recomendations from http://wiki.serviio.org/doku.php?id=sony_bravia_tv
And then let Serviio to do only the remux from MKV to MPEGTS.

Thank you all!
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Tue Apr 24, 2012 7:12 am

Re: Force AVC transcoding for Bravia

I make some test and it seems that when "maxVBitrate=17000" is used, ffmpeg try to set video bitrate to 17Mbps ?!
I try with BigBuckBunny-DivXPlusHD.mkv sample file, with bitrateviewer : average 6Mbps with 21Mbps peak

  Code:
ffmpeg.exe -i "%1" -y -threads 2 -async 1 -vcodec mpeg2video -b 17000k -maxrate 17000k -bufsize 17000k -r 24000/1001 -g 15 -copyts -acodec ac3 -ab 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts "D:\Samples\Test.ts"

Test.ts with bitrateviewer : average 13Mbps with 31Mbps peak !!!

Suggest to remove "maxVBitrate=17000" option from the profile, or try with lower value like "maxVBitrate=10000" or "maxVBitrate=5000"
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

fgouvea

Serviio newbie

Posts: 9

Joined: Sun Feb 20, 2011 8:47 pm

Post Tue Jun 19, 2012 11:39 pm

Re: Force AVC transcoding for Bravia

Hello guys,
Sorry for the late reply. I was taking the time to understand better how VBV works. I also took the time to do lots of encoding tests.

I extracted a portion of the animation where I was having most of the freezing issues. The sequence had both high and slow motion scenes, and the main problem was water.

Looks like Bravia has two limitations: one is that it doesn`t handle bit rates greater than 20mbps (that I think is not any news anymore). The second is that the video buffer is really small. My tests showed that it is 1mb long.

Note that the best combination seems to be 20mbps with 1mb of buffer size. I even tried 25mbps and 1mb and it didn`t work. I tried about 12 different combinations and the resulting size of the enconded file was within a 10% variation (which means the resulting quality was just about the same).

So I`m sticking "-maxrate 20000k" and "-bufsize 1000k". So far, so good.

Thank you all
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Wed Jun 20, 2012 7:10 am

Re: Force AVC transcoding for Bravia

fgouvea wrote:...I extracted a portion of the animation where I was having most of the freezing issues. The sequence had both high and slow motion scenes, and the main problem was water.

Thanks for this job, could you provide somewhere this sample sequence file ? I would like to test with my EX500.
fgouvea wrote:...Looks like Bravia has two limitations: one is that it doesn`t handle bit rates greater than 20mbps (that I think is not any news anymore). The second is that the video buffer is really small. My tests showed that it is 1mb long.

Very interesting information (buffer size)!
fgouvea wrote:Note that the best combination seems to be 20mbps with 1mb of buffer size....
So I`m sticking "-maxrate 20000k" and "-bufsize 1000k". So far, so good.

I'll check that.
Thanks
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Jun 20, 2012 5:40 pm

Re: Force AVC transcoding for Bravia

It looks like the latest FFmpeg (0.11.1) doesn't need the buffer parameter anymore and b:v works without it.
<<

devzorg

Serviio newbie

Posts: 1

Joined: Fri Nov 16, 2012 10:09 am

Post Fri Nov 16, 2012 10:12 am

Re: Force AVC transcoding for Bravia

Hi everyone.
I have the same problem with AVC, on a previous version of Serviio it played some mkv files, but now it not played any mkv file.
What happens ? :(
<<

Illico

User avatar

DLNA master

Posts: 4646

Joined: Fri Jul 23, 2010 8:08 am

Location: France

Post Fri Nov 16, 2012 12:36 pm

Re: Force AVC transcoding for Bravia

devzorg wrote:Hi everyone.
I have the same problem with AVC, on a previous version of Serviio it played some mkv files, but now it not played any mkv file.
What happens ? :(

Could you explain ? what is the file format (see signature link) ? what is exactly the problem ? what is your device model ? what is the profile selected ?....
Illico
Sony 2010 KDL-46EX501 | BDP-S373 | SMP-N100 | Windows 8-i7 | Network DD HD-CE1.5TLU2 | Livebox2-UHD86 | ServiiDroid | ServiiGo | BubbleUPnP
Serviio beta tester - Moderator

Return to Transcoding

Who is online

Users browsing this forum: No registered users and 35 guests

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