Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
16th September 2008, 19:37 | #1 | Link |
Registered User
Join Date: May 2005
Posts: 1,462
|
Adding borders to H264 stream
Hello,
Does anyone know of a good program/method to add borders to an existing H264 stream? For example, I have a 1920x800 stream here, that I'd like to re-encode subtitles in (hardcoded). I just don't want the subtitles to appear within the 800px height (as would be the case now). Rather, I'd like to pad the 800 to 1080, and ideally shift the main movie 'up' a bit too, so as to keep room underneath for the subtitles. Is this possible yet? Thanks
__________________
Gorgeous, delicious, deculture! |
16th September 2008, 22:19 | #3 | Link | |
Registered User
Join Date: Jul 2008
Posts: 96
|
Quote:
Some guru on here told me to add Code:
-vf dsize=1920:1080:0,scale=0:0,expand=1920:1080 or Code:
-vf dsize=1280:720:0,scale=0:0,expand=1280:720 to my mplayer args... So the full mplayer line looks like this: Code:
mkfifo stream.y4m; /usr/local/bin/mplayer -vo yuv4mpeg:file=stream.y4m \ -nosound -vf dsize=1920:1080:0,scale=0:0,expand=1920:1080 <inputfile> Code:
x264 -r 3 --crf <19-21> --threads 0 --level="4.1" --sar 1:1 --partitions all --aud \ --mixed-refs --bframes 3 --b-pyramid --direct auto --direct-8x8 1 --8x8dct --analyse all \ --subme 6 --me umh --b-rdo --bime --weightb --trellis 1 --no-ssim --no-psnr --progress \ -o <output.mkv/264> stream.y4m; rm stream.y4m that mkfifo saves you a fewhundred GBytes of diskspace, since it generates a file that is kept at 0 bytes since it simulates a FIFO, meaning that mplayer writes into it while x264 reads from it, and mplayer is only allowed to write again after x264 has read from it. The end result is an uncropped 1080p video that plays on the PS3 and that, because it's full frame, can also be burned as AVCHD. ;-) Beware of the fps though, as AVCHD does not allow for 25fps (for 1080p it's 23,9 and 24 fps only I think)... From what I remember mplayer can also insert subtitles when decoding the video, try playing with the -sub and -sid options... Last edited by kaid; 19th September 2008 at 16:45. Reason: mentioned CRF vs 2pass |
|
18th September 2008, 22:46 | #5 | Link | |
Registered User
Join Date: May 2005
Posts: 1,462
|
Quote:
And yes, 'uncrop' wirhout re-encoding would be perfect.
__________________
Gorgeous, delicious, deculture! Last edited by asarian; 18th September 2008 at 23:31. |
|
18th September 2008, 23:52 | #6 | Link | |
Un-Registered User
Join Date: Mar 2008
Location: Audio Stream - 0x80
Posts: 341
|
Quote:
|
|
19th September 2008, 00:07 | #7 | Link | |
Registered User
Join Date: May 2005
Posts: 1,462
|
Quote:
__________________
Gorgeous, delicious, deculture! |
|
19th September 2008, 16:48 | #8 | Link | |
Registered User
Join Date: Jul 2008
Posts: 96
|
Quote:
|
|
19th September 2008, 16:53 | #9 | Link | ||
Registered User
Join Date: Jul 2008
Posts: 96
|
Quote:
Quote:
In order to do this "lossless passthrough" x264 would have to accept H.264 streams as input to start with, which it doesn't right now! ;-) |
||
19th September 2008, 23:06 | #10 | Link | |
Un-Registered User
Join Date: Mar 2008
Location: Audio Stream - 0x80
Posts: 341
|
Quote:
|
|
20th September 2008, 19:11 | #11 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
you can crop and add borders losslessly in the h264 stream. every compliant h264 decoder will display the video taking this info into account.
propably h264info can do that i dont know if such streams will be avchd compliant edit: sorry, its not possible to add borders that way (only cropping works)
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau) I know, that I know nothing (Socrates) MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide) Ogg Theora | Ogg Vorbis use WM9 today and get Micro$oft controlling the A/V market tomorrow for free Last edited by bond; 20th September 2008 at 19:45. |
Thread Tools | Search this Thread |
Display Modes | |
|
|