FAQ  •  Register  •  Login

Transcoding option to resize video

<<

jalla

User avatar

Serviio newbie

Posts: 15

Joined: Sun Apr 01, 2012 3:05 pm

Location: Bergen Norway

Post Thu Apr 05, 2012 1:14 pm

Transcoding option to resize video

As I understand it there's no option to specify size (-s) for ffmpeg from a transcoding profile. Are there technical reasons for this, or is it possible to add a "size" attribute?

It would be most useful to be able to do the resizing on the server instead of sending full HD to a low powered mobile for instance.

I find with the HTC Desire that I can play 720p with a bitrate up to about 4000k, but the phone can't handle 1080i even if I set maxVBitrate as low as possible.
Resizing the files to the Desire's native resolution of 800x480 they play perfect with a bitrate of 10000k.
<<

will

DLNA master

Posts: 2138

Joined: Mon Aug 30, 2010 11:18 am

Location: UK

Post Thu Apr 05, 2012 1:38 pm

Re: Transcoding option to resize video

Not at the moment, but I think it might be in the next big release. For now, a hacky way to do it would be to have an ffmpeg wrapper (bash/perl script), that looks for something unique to your phone's profile in the arguments, e.g. whatever maxVBitrate is turned into combined with 10000K, and add -s 800x480 to the list of arguments before calling ffmpeg. Here is an example perl one for fixing aspect ratio on some tvs viewtopic.php?f=11&t=2956&p=34000&p34000#p34000 or viewtopic.php?f=5&t=5806 shows one for dropping the volume of online feeds from 4oD, and it then also shows replacing the audio codec.
Will

ServiiDroid (Android Console) Developer: Download | Home | Support
ServiiGo (Android 3G/4G/WiFi Playback App) Developer: Download | Home | Support
<<

jalla

User avatar

Serviio newbie

Posts: 15

Joined: Sun Apr 01, 2012 3:05 pm

Location: Bergen Norway

Post Thu Apr 05, 2012 3:21 pm

Re: Transcoding option to resize video

Excellent, I'll go with the shellscript for now

Just testing the following and it looks promising


  Code:
gong:/usr/local/bin# cat ffwrap.sh
#!/bin/sh

trap "exit 1" 0 1 2 15

while [ "$1" != "-y" ]
do
   case  $1 in
      -i) ;;
       *) n="$n $1";;
   esac
   shift
done

n=$(echo $n|sed -e 's/^ //')
/usr/local/bin/ffmpeg -i "$n" 2>&1 | grep -q -E '(1920x1080|1280x720)'
test $? -eq 0 && s="-s 800x480"
logger -p local1.info -t ffwrap "transcoder called with -i \"$n\" $s $@"
/usr/local/bin/ffmpeg -i "$n" $s $@
r=$?
logger -p local1.info -t ffwrap "transcoder done, status $r"
exit $r

Return to Feature requests

Who is online

Users browsing this forum: No registered users and 43 guests

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