hi i wanted the simplest method to change the AR of a mp4 x264 file (16-9 > 4-3)
i used mediacoder since it seems the best one
now i changed that the AR in the video settings... and the file plays fine in the new AR
but the filesize is almost doubled, how come ? i only changed the the AR and it needed to re process the whole file ?
with mediacoder you cannot just change the header info without reprocessing the file?
is there a way to change the AR without the file getting bigger (in the process of reprocessing) or even just change header info`?
+ Reply to Thread
Results 1 to 17 of 17
-
-
can't you with eg mediacoder not JUST change the AR and leave the video (or all other video settings) itself untouched?
-
I have never used mediacoder. And never will.
But check if you can copy the video and ausio streams. -
Use Mp4Box with the following command line:
Mp4Box -par 1=PAR video.mp4
Substitute video.mp4 by the name of your video and PAR by the pixel aspect ratio calculated this way:
PAR = 4/3 * H/W ; where H = video height (pixels) and W = video width (pixels) and PAR should be in the form of N : D (withgout the spaces) where N and D are integers.Last edited by Keyser; 12th Jan 2014 at 12:54.
"The greatest trick the Devil ever pulled was convincing the world he didn't exist." -
the problem is, if i put 4:3 it will stretch even more
goes from this to this
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 16:9
Width : 640 pixels
Height : 360 pixels
Display aspect ratio : 2.40:1 -
640x360 is a 16:9 aspect with square pixels, so I guess your video is 16:9 and you have to crop it vertically to get 4:3 aspect.
Or it's really a 4:3 footage and you should have set MediaCoder to 512x384, in that case, you just have to change AR in stream header with FFmpeg (can be done with DVDx 4.1 Free Converter but it will re-rencode). -
it IS 4:3 FOOTAGE
can you tell me the command too? (AR CHANGE)
i read u can change it in the header AND video stream - i guess what i tried and failed (mp4box) was just the header while your suggestion is the video stream, maybe after i fix your suggestion i should retry fixing the other as well -
One way to change the bitstream AR value is to use this modified ffmpeg build in this thread
http://forum.doom9.org/showthread.php?t=152419
If you have a 640x360 square pixel video that plays with a DAR of 16:9 , but you want it to play with a DAR of 4:3
Display Aspect Ratio = Frame Aspect Ratio * Sample Aspect Ratio
4/3 = 640/360 * x/y , where x/y is the sar value or sample aspect ratio
So the value for SAR , x/y = 3:4
Code:ffmpeg -i input.mp4 -vcodec copy -acodec copy -vbsf h264_changesps=sar=3:4 output.mp4
-
I don't understand..... if the stream and container aspect ratios are the same.......
I'm fairly sure the Bluray player in this house which supports anamorphic MKV/MP4s ignores the container aspect ratio and uses the stream aspect ratio. Or maybe it's the other way around.... I forget. By default, LAV filters gives preference to the container aspect ratio.Last edited by hello_hello; 15th Jan 2014 at 17:18.
-
Container AR is supposed to override everything , but I've seen some cases where there were multiplicative causing extreme distortions depending on the decoding chain and software used to view
There are also container inconsistencies between different containers - but I find MKV is the most consistent -
thanks for the calculation, i would have never gotten that
i did try the 3:4 result with mp4box and it did work out !!
so unless my player will not play it i won'T even need ffmpeg
i did read somewhere else that it is advisable to change it both ways so it will not mess up
edit :
mediainfo now spits out the correct 4:3 instead of the cinema format -
it's sar, not dar
You need to use the modified ffmpeg build . You can rename it if you want e.g ffmpeg.roozhou.exe
Yes you can batch process a folder , But it gets trickier to do it from a text file or processing subfolders , but it should be possible as well
For one folder:
Code:for %a in ("*.mp4") do ffmpeg -i %a -vcodec copy -acodec copy -vbsf h264_changesps=sar=3:4 %~na.new.mp4
-
it seems i still got the syntax slighty wrong... do i have to put some path somewhere?
C:\Program Files (x86)\tools\test>for %a in ("*.mp4") do "C:\Program Files (x86)
\tools\ffmpg\ar change\ffmpeg.exe" -i %a -vcodec copy -acodec copy -vbsf h264_ch
angesps=sar=3:4 %~na.new.mp4
C:\Program Files (x86)\tools\test>"C:\Program Files (x86)\tools\ffmpg\ar change\
ffmpeg.exe" -i The Jets - Crush On You (1985) - YouTube.mp4 -vcodec copy -acodec
copy -vbsf h264_changesps=sar=3:4 The Jets - Crush On You (1985) - YouTube.new.
mp4
ffmpeg version N-31792-g51fb933, Copyright (c) 2000-2011 the FFmpeg developers
built on Aug 11 2011 23:13:25 with gcc 4.5.2
configuration:
libavutil 51. 11. 1 / 51. 11. 1
libavcodec 53. 10. 0 / 53. 10. 0
libavformat 53. 6. 0 / 53. 6. 0
libavdevice 53. 2. 0 / 53. 2. 0
libswscale 2. 0. 0 / 2. 0. 0
The: No such file or directory -
Open the command prompt in the same directory as the files , and you don't need to specify the paths , except for ffmpeg.exe path . If the modified ffmpeg is in the system directory, or set up as environment variable, then you don't need to specify the ffmpeg path either . If I were you , I would rename the ffmpeg binary - so as not to confuse it with the "normal" one (in the example below I named it "ffmpeg.roozhou"
The Jets - Crush On You (1985) - YouTube.mp4
e.g
Code:for %a in ("*.mp4") do "PATH\ffmpeg.roozhou" -i "%a" -vcodec copy -acodec copy -vbsf h264_changesps=sar=3:4 "%~na.new.mp4"
Last edited by poisondeathray; 16th Jan 2014 at 16:19.
-
thanks
thats what i did ... it was the quotes that i forgot (as you can see there are spaces in the title names)
Similar Threads
-
Simple: Rip from DVD, put simple custom menu, burn back to DVD. HOW?
By Lorcan in forum Newbie / General discussionsReplies: 4Last Post: 20th May 2013, 13:41 -
need help with something simple
By HandsomePete in forum DVD RippingReplies: 6Last Post: 4th Dec 2011, 02:40 -
Simple task, not so simple (rip/quicksync)
By Trife in forum Newbie / General discussionsReplies: 10Last Post: 12th Aug 2011, 19:57 -
Adding extra material to the end of a simple 1 movie dvd (with simple menu)
By ColinKe in forum Authoring (DVD)Replies: 4Last Post: 24th Jul 2009, 22:38 -
Can we keep it simple?
By AlSat in forum DVD RippingReplies: 14Last Post: 26th Jan 2009, 14:46