NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Other Clients Old Stuff (legacy) MVP & NMT v
« Previous 1 … 63 64 65 66 67 … 115 Next »
Maintaining aspect ratio with ffmpeg transcoding

 
  • 0 Vote(s) - 0 Average
Maintaining aspect ratio with ffmpeg transcoding
jkressin262
Offline

Junior Member

Posts: 27
Threads: 6
Joined: May 2006
#21
2006-05-23, 03:42 AM
I now have the .bat working for me correctly. As was pointed out to me on another thread, the following has to be set in order for Trans2MVP.bat to work:

<MVPTranscodeUsingFFmpeg>false</MVPTranscodeUsingFFmpeg>

So, as I said, I have the batch file working, and it outputs the video beautifully. I had to add a bit more space on the sides to make it work with my tv - but it works.

New problem: once the ffmpeg command starts, there is no killing it. Hitting stop on the mediamvp doesn't stop this process for me. Additionally, I can't even kill it as the user I am running GBPVR as. I am guessing that the program runs it as a different user, thus denying me access. So, once an episode of something is started, I can't watch anything else until it is done decoding (and using 100% of the processor).

Anybody know if anything else in the script that needs to be set to make this thing killable? Another setting I missed perhaps?

Thanks!
Jonathan
drain
Offline

Member

Posts: 91
Threads: 12
Joined: Jun 2005
#22
2006-05-23, 06:08 AM
jkressin262 Wrote:New problem: once the ffmpeg command starts, there is no killing it. Hitting stop on the mediamvp doesn't stop this process for me.

I believe this is because ffmpeg is launched with the 'start' command. I did this because it was the only way I know of to make the task low priority. I suggest two options here.

1) remove the "start "Converting" /low /wait /b " form the ffmpeg command line. It will now hog cpu, but this may not be a problem for you.

2) You should be able to kill it with Ctrl-Break (Ctrl-C is not enough) while the command line window has the focus, and hit 'y' when prompted to end the batch file.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#23
2006-05-24, 11:48 AM
Code:
"C:\Program Files\devnz\gbpvr\Third Party\FFmpeg\ffmpeg" -i %1 2> ffmpegdata.txt

Hi... This command line doesn't work. I think it's the '2' parameter. I changed it to an output file name, and got something in the dos box, but nothing writes to the text file...
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
drain
Offline

Member

Posts: 91
Threads: 12
Joined: Jun 2005
#24
2006-05-24, 08:04 PM
zehd Wrote:
Code:
"C:\Program Files\devnz\gbpvr\Third Party\FFmpeg\ffmpeg" -i %1 2> ffmpegdata.txt

Hi... This command line doesn't work. I think it's the '2' parameter. I changed it to an output file name, and got something in the dos box, but nothing writes to the text file...

You need the '2' because ffmpeg outputs it's data to STDERR instead of STDOUT. (Appending '> file.txt' to a command puts all STDOUT data to the file, and '2> file.txt' puts all STDERR data to a file.)

For me, the command as it stands puts nothing on the screen, but does create a file (like the one attached). What does it do on your system?
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#25
2006-05-25, 10:06 AM
Here you go...

[ATTACHMENT NOT FOUND]

Thanmks for looking into this.

BTW, do you know yet whether all this work will be even uselful in the new version of GB-PVR 97.7 ?

Thanks
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
jkressin262
Offline

Junior Member

Posts: 27
Threads: 6
Joined: May 2006
#26
2006-05-25, 01:59 PM
zehd Wrote:BTW, do you know yet whether all this work will be even uselful in the new version of GB-PVR 97.7 ?

This works perfectly fine in my installation of the new version. The only difference is that the options for ffmpeg/ffshow are defaulted in config.xml and cannot be changed in the configuration program. Otherwise, it works beautifully.

To get this batch file to work correctly on my NTSC setup for 640x480 videos, I made a few changes. First, I set up a top and bottom border size (because my tv will normally cut off the tops and bottoms of standard 740x480 video coming from the mvp. Then, I run the math to get a new width while preserving the height (minus the defaulted borders). I then get the border size I need for the left and right side. My final ffmpeg line has all four borders added. By giving myself a top and bottom border of 24 pixels, I don't even see the borders on the top and bottom, and just have black bars on the side. I do need to have another variable to add/subtract to each sidebar to center the image a bit more (again, due to my tv) - but the picture quality is the best I have gotten from both the default setup of gbpvr and the mediamvp software.

Jonathan
HtV
Offline

Posting Freak

Posts: 3,470
Threads: 46
Joined: Dec 2005
#27
2006-05-25, 04:05 PM
Could you perhaps share with us the working bat-file, I can't get it to work. I know I'm not the only one. The beginning of the bat is my problem I think. I get GBPVR to call the bat but it almost immediately stops.
AMD Athlon 64 3000, HDD: 80, 120, 200 GB, Hauppauge 350 + 150, MVP, Asus 6000L Laptop client, Asus X50sl client,
Fritz!box 7140 modem/router, GBPVR 1.3.7.
jkressin262
Offline

Junior Member

Posts: 27
Threads: 6
Joined: May 2006
#28
2006-05-25, 04:32 PM
I'll post my revised version of the .bat file when I get home tonight. I just need to pull out some of the debugging stuff I placed in it (to verify it was running). I know one of my gotchas was that the dimensions for everything has to be divisible by 2. For a while, I told the program to create a 25 pixel border - which promptly broke the rest of the script.

Jonathan
drain
Offline

Member

Posts: 91
Threads: 12
Joined: Jun 2005
#29
2006-05-25, 08:11 PM
zehd Wrote:Here you go...

[ATTACHMENT NOT FOUND]
Hmmm, it seems to work fine for me. I changed the script to read your file rather than run ffmpeg like so:
Code:
for /f "eol=; tokens=1 delims=~" %%a in (ffmpegdata.txt) do (
and I get the attached output. The first couple of lines starting with **** are debug lines added to the findvideosize subroutine. I'm not sure how to proceed now. Are you sure you are running the latest incarnation? What OS are you using?
jkressin262
Offline

Junior Member

Posts: 27
Threads: 6
Joined: May 2006
#30
2006-05-26, 02:31 AM
Ok,

Here is my current working version of Trans2MVP.bat
Not quite a finished product yet, but it works fine for me, so give it a try Smile

On a side note - got my 150 capture card running today, and it works beautifully with the mvp. The actual picture quality looks better then the crap dvr unit that Time Warner charges me every month to use. That's going back quick *grin*

Sorry it was so late to get this out. It's been a busy night.

Jonathan


Code:
@echo off
setlocal enabledelayedexpansion
cd "c:\Program Files\devnz\gbpvr\Third Party\FFmpeg"
set inputfile=%1
if "%2"=="" (
  set outputfile="%~dpn1.mpg"
) else (
  set outputfile=%2
)
set outputxsize=720
set outputysize=480
set border_top=24
set border_bottom=24


for /f "eol=; tokens=1 delims=~" %%a in ('ffmpeg -i %inputfile% 2^>^&1') do (
  call :findvideosize %%a
)

echo Input video size is %inputxsize% by %inputysize%
set /a newysize=%inputysize%*%outputxsize%/%inputxsize%
if %newysize% gtr %outputysize% goto padsides
echo Resized video is %outputxsize% by %newysize%

set /a padding=(%outputysize%-%newysize%)/2
echo Top and bottom padding needed is %padding%
set /a padding=(%padding%/2)*2
set /a newysize=outputysize-(padding*2)
echo Corrected padding is %padding%
echo Corrected resized height is %newysize%

ffmpeg -y -i %inputfile% -b 4000 -ac 2 -ab 224 -r 25 -s %outputxsize%x%newysize% -padtop %padding% -padbottom %padding% -f svcd %outputfile%
goto end


:padsides
echo Preserving Height instead of Width
set /a modifiedy=%outputysize%-%border_top%-%border_bottom%
set /a newxsize=%inputxsize%*%modifiedy%/%inputysize%
echo Resized video is %newxsize% by %modifiedy%
set /a padding=(%outputxsize%-%newxsize%)/2

echo Left and Right padding needed is %padding%
set /a padding=(%padding%/2)*2
set /a newxsize=%outputxsize%-(%padding%*2)
echo Corrected padding is %padding%
echo Corrected resized width is %newxsize%
ffmpeg -y -i %inputfile% -b 4000 -ac 2 -ab 224 -r 25 -s %newxsize%x%modifiedy% -padleft %padding% -padright %padding% -padtop %border_top% -padbottom %border_bottom% -f svcd %outputfile%
goto end



:usecropping
echo Resized video is %outputxsize% by %outputysize%
set /a cropping=(%newysize%-%outputysize%)/2
echo Top and bottom cropping needed is %cropping%
set /a cropping=(%cropping%/2)*2
echo Corrected cropping is %cropping%
set /a newoutputysize = %newysize%-%cropping%*2
echo Corrected resized height is %newoutputysize%

start "Converting" /low /wait /b "ffmpeg" -y -i %inputfile% -b 4000 -ac 2 -ab 224 -r 25 -s %outputxsize%x%newysize% -croptop %cropping% -cropbottom %cropping% -f svcd %outputfile%
goto end

:end
endlocal
pause
goto :eof

:findvideosize
  :: first look for "video:"
  shift
  if "%1"=="" goto :eof
  if not "%1"=="Video:" goto findvideosize
  :findvideosizeloop
  shift
  if "%1"=="" goto :eof
  set temp=%1
  if not "%temp:~3,1%"=="x" goto findvideosizeloop
  set /a inputxsize=%temp:~0,3%
  set /a inputysize=%temp:~4,3%
goto :eof
« Next Oldest | Next Newest »

Users browsing this thread: 7 Guest(s)

Pages (8): « Previous 1 2 3 4 5 … 8 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  MVP transcoding? dinki 12 9,275 2014-02-03, 09:35 PM
Last Post: mvallevand
  Change FFMPEG commandline Astraeus 5 3,471 2012-01-22, 06:49 PM
Last Post: mvallevand
  LiveTV & ffmpeg MVP playback stops pvruser 4 3,282 2009-02-27, 10:44 PM
Last Post: Bobins
  MVP Transcoding drbenjamin 1 1,715 2008-12-01, 06:07 AM
Last Post: mvallevand
  MVP transcoding with TS Mux daneo 0 1,452 2008-11-09, 09:20 AM
Last Post: daneo
  Transcoding files times out before they begin Zato 3 2,173 2008-10-13, 04:01 AM
Last Post: Zato
  Any way to automatically save MPG output file when transcoding jonrigg68 2 2,111 2008-06-27, 04:14 PM
Last Post: HtV
  MVP TS transcoding config.xml bug. BerkA 1 1,986 2008-06-07, 11:47 AM
Last Post: sub
  Transcoding causes pc to shut down jonrigg68 5 2,507 2008-06-07, 11:04 AM
Last Post: psycik
  MVP problems (Live TV/transcoding) natty 5 2,642 2008-04-11, 06:57 PM
Last Post: sub

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode