Re: Sony Bravia - Aspect Ratio fixing
Posted: Fri Nov 25, 2011 4:53 pm
I wasn't aware it's possible, as usually the parameters need to be in certain order for ffmpeg to work.
zip wrote:I wasn't aware it's possible, as usually the parameters need to be in certain order for ffmpeg to work.
FFmpeg
============================
...
*Windows* build has been configured as:
./configure --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-memalign-hack \
--enable-libmp3lame --enable-librtmp --arch=x86 --enable-runtime-cpudetect --enable-pthreads \
--extra-ldflags=-L/static/lib --extra-cflags=-I/static/include --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm'
pizzaguy541 wrote:...Are you saying that the Sony Bravia profile needs every file transcoded to mpeg2video in order for this to work?
zip wrote:So I would not invoke transcoding just because file has wrong PAR, but only fix the transcoding command that is used.
2012-01-13 20:10:32,811 WARN [ProcessExecutor] Process cmd has a return code of 1! This is a possible error.
2012-01-13 20:10:40,300 ERROR [ResourceTransportRequestHandler] Error while processing resource, sending back 500 error. Message: Transcoded file 'C:\Windows\TEMP\Serviio\transcoding-temp-2-MPEG2TS.stf' cannot be found, FFmpeg execution probably failed
java.io.IOException: Transcoded file 'C:\Windows\TEMP\Serviio\transcoding-temp-2-MPEG2TS.stf' cannot be found, FFmpeg execution probably failed
at org.serviio.delivery.resource.transcode.FileBasedTranscodingDeliveryStrategy.createInputStream(FileBasedTranscodingDeliveryStrategy.java:45)
at org.serviio.delivery.resource.transcode.AbstractTranscodingDeliveryEngine.retrieveTranscodedResource(AbstractTranscodingDeliveryEngine.java:129)
at org.serviio.delivery.resource.AbstractDeliveryEngine.deliver(AbstractDeliveryEngine.java:96)
at org.serviio.delivery.MediaResourceRetrievalStrategy.retrieveResource(MediaResourceRetrievalStrategy.java:121)
at org.serviio.upnp.webserver.ResourceTransportRequestHandler.handleRequest(ResourceTransportRequestHandler.java:116)
at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:54)
at org.apache.http.protocol.HttpService.doService(HttpService.java:293)
at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:58)
at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:212)
at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:187)
2012-01-13 20:11:33,454 WARN [ProcessExecutor] Process cmd has a return code of 1! This is a possible error.
2012-01-13 20:11:40,947 ERROR [ResourceTransportRequestHandler] Error while processing resource, sending back 500 error. Message: Transcoded file 'C:\Windows\TEMP\Serviio\transcoding-temp-6-MPEG2TS.stf' cannot be found, FFmpeg execution probably failed
java.io.IOException: Transcoded file 'C:\Windows\TEMP\Serviio\transcoding-temp-6-MPEG2TS.stf' cannot be found, FFmpeg execution probably failed
at org.serviio.delivery.resource.transcode.FileBasedTranscodingDeliveryStrategy.createInputStream(FileBasedTranscodingDeliveryStrategy.java:45)
at org.serviio.delivery.resource.transcode.AbstractTranscodingDeliveryEngine.retrieveTranscodedResource(AbstractTranscodingDeliveryEngine.java:129)
at org.serviio.delivery.resource.AbstractDeliveryEngine.deliver(AbstractDeliveryEngine.java:96)
at org.serviio.delivery.MediaResourceRetrievalStrategy.retrieveResource(MediaResourceRetrievalStrategy.java:121)
at org.serviio.upnp.webserver.ResourceTransportRequestHandler.handleRequest(ResourceTransportRequestHandler.java:116)
at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:54)
at org.apache.http.protocol.HttpService.doService(HttpService.java:293)
at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:58)
at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:212)
at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:187)
use strict;
my $args = '';
foreach my $arg (@ARGV) {
$args = $args . "\"$arg\" ";
}
if ($args =~ /^(.*)\s\"mpeg2video\"\s(.*)$/) {
$args = $1 . ' "mpeg2video" "-vf" "pad=max(iw\,ih*16/9):max(ih\,iw/16*9):(ow-iw)/2:(oh-ih)/2:blue,setdar=4:3" ' . $2;
}
my $cmd = "\"C:\\Program Files (x86)\\Serviio\\lib\\ffmpeg.exe\" $args";
open(LOGFILE, ">>C:\\Program Files (x86)\\Serviio\\log\\ffmpeg-wrapper.log");
if (system($cmd) != 0) {
print LOGFILE scalar localtime . " Failed: " . $cmd . " with $?\n";
close (LOGFILE);
die "Failed\n";
} else {
print LOGFILE scalar localtime . " Success: " . $cmd . "\n";
close (LOGFILE);
}
Xmantium wrote:Is there a Linux method?
Xmantium wrote:I don't think Sony Bravia will fix it themselves on their tvs.
Xmantium wrote:This fix should be built in Serviio!
Like a custom bravia profile
armthehomeless wrote:I'm also keen to know if there's any update to this. I tried the Perl method and got a 'Cannot access server at this time' message.
This is a great media server! Loving it apart from the stupid Bravia AR issue. I wish they'd just fix it in a firmware update.
#!/usr/bin/perl
use strict;
my $args = '';
foreach my $arg (@ARGV) {
$args = $args . "\"$arg\" ";
}
if ($args =~ /^(.*)\s\"mpeg2video\"\s(.*)$/) {
$args = $1 . ' "mpeg2video" "-vf" "pad=max(iw\,ih*16/9):max(ih\,iw/16*9):(ow-iw)/2:(oh-ih)/2:blue,setdar=4:3" ' . $2;
}
my $cmd = "/usr/bin/ffmpeg-serviio $args";
open(LOGFILE, ">>/var/log/ffmpeg-wrapper.log");
if (system($cmd) != 0) {
print LOGFILE scalar localtime . " Failed: " . $cmd . " with $?\n";
close (LOGFILE);
die "Failed\n";
} else {
print LOGFILE scalar localtime . " Success: " . $cmd . "\n";
close (LOGFILE);
}
ffmpeg version N-42368-gbf53863 Copyright (c) 2000-2012 the FFmpeg developers
built on Jul 26 2012 19:36:00 with gcc 4.6.3
configuration: --enable-static --disable-shared --bindir=/tmp/ffmpeg --disable-ffplay --disable-ffserver --enable-pthreads --disable-mmx --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-version3 --enable-librtmp --pkg-config=pkg-config
libavutil 51. 64.100 / 51. 64.100
libavcodec 54. 33.100 / 54. 33.100
libavformat 54. 15.102 / 54. 15.102
libavdevice 54. 1.100 / 54. 1.100
libavfilter 3. 1.100 / 3. 1.100
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 15.100 / 0. 15.100
libpostproc 52. 0.100 / 52. 0.100
Input #0, avi, from 'Penn & Teller; Bullshit! - (1-01) - Talking to the Dead.avi':
Metadata:
encoder : Nandub v1.0rc2
Duration: 00:26:05.79, start: 0.000000, bitrate: 1246 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (XVID / 0x44495658), yuv420p, 576x432 [SAR 1:1 DAR 4:3], 29.97 tbr, 29.97 tbn, 29.98 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, s16, 112 kb/s