pyTivo Discussion Forum Forum Index pyTivo Discussion Forum
Answers and the development of pyTivo a TiVo transcoding server
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

ffmpeg Negative values are not acceptable error & hack/f

Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> Support
 View previous topic :: View next topic  
Author Message

Joined: 14 Sep 2013
Posts: 7

PostPosted: Sun Sep 15, 2013 12:28 am    Post subject: ffmpeg Negative values are not acceptable error & hack/f Reply with quote

This is listed as an open issue in wmcbrine's repo. I'm making this post to provide more info & offer a temporary hack/workaround.

Tivo Series 2, default settings, which according to the web interface help text are: width: 544, height: 480

The error message:

[Parsed_pad_1 @ 0x9a2d0c0] Negative values are not acceptable.
[Parsed_scale_0 @ 0x9a02c40] Failed to configure input pad on Parsed_pad_1

Some relevant debug output:

Code: vCodec=h264 vWidth=592 vHeight=336 vFps=25.00 millisecs=707520 TIVO_HEIGHT=480 TIVO_WIDTH=544

The ffmpeg version: (I built this from source, problem also happens with the standard ubuntu version, ffmpeg version 0.8.6-4:0.8.6-0ubuntu0.12.04.1)

ffmpeg version git-2013-09-14-8728360 Copyright (c) 2000-2013 the FFmpeg developers
  built on Sep 14 2013 01:49:09 with gcc 4.6 (Ubuntu/Linaro 4.6.3-1ubuntu5)
  configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldf
lags=-L/root/ffmpeg_build/lib --bindir=/root/bin --extra-libs=-ldl --enable-gpl --enable-libass --en
able-libfdk-aac --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-
libvpx --enable-libx264 --enable-nonfree

The ffmpeg command:

Quote: -i /home/erh/projects/tubedl/video/_seen/D-Day_I
n_Color_1_4.flv -vcodec mpeg2video -r 29.97 -b 4096k -maxrate 30000k -bufsize 1024k -aspect 16:9 -vf
scale=544:482,pad=544:480:0:-2 -ab 448k -ar 44100 -acodec ac3 -copyts -map 0:0 -map 0:1 -f vob -

I have bolded the parts that are the problem. As you can see, TIVO_HEIGHT is 480, but is coming up with a height of 482. It is then adding a -2 padding to compensate for this. The -2 padding is what causes the "negative values" error. Changing that to 0 but leaving the 482 results in a "Input area 0:0:544:482 not within the padded area 0:0:544:480" error. So the real problem is the 482. That should be 480.

Here is my hack. I'll be honest, I'm not smart enough to figure out how to fix this problem for real. But this temporary fix seems to do the trick:

$ git diff
diff --git a/plugins/video/ b/plugins/video/
index f99a2de..d4bdf90 100644
--- a/plugins/video/
+++ b/plugins/video/
@@ -392,6 +392,10 @@ def pad_check():
 def pad_TB(TIVO_WIDTH, TIVO_HEIGHT, multiplier, vInfo):
     endHeight = int(((TIVO_WIDTH * vInfo['vHeight']) /
                       vInfo['vWidth']) * multiplier)
+    # xyzzy
+    if endHeight > TIVO_HEIGHT:
+        endHeight = TIVO_HEIGHT
     if endHeight % 2:
         endHeight -= 1
     topPadding = (TIVO_HEIGHT - endHeight) / 2

All I added was the endHeight > TIVO_HEIGHT... block.

I'm sure this is not the correct way to fix the problem, but thought it might be useful for others to use temporarily as people smarter than me figure out the proper fix.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    pyTivo Discussion Forum Forum Index -> Support All times are GMT
Page 1 of 1

Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
Site is in NO WAY affiliated with TiVo Inc

Powered by phpBB © 2001, 2005 phpBB Group

Get pytivo at Fast, secure and Free Open Source software downloads
[ Time: 0.0520s ][ Queries: 12 (0.0070s) ][ GZIP on - Debug on ]