Posts: 92
Threads: 16
Joined: Mar 2021
@echo off
if "%~1"=="" (
echo function: adjust video Display Aspect Ratio, will copy video and audio streams to a new file.
echo usage: ffmpeg-new-aspect [file] [-aspect a:b]
echo -aspect, default aspect is 4:3
goto end
)
set aspectStr="4:3"
if "%2"=="-aspect" set aspectStr="%3"
set file=%~1
set newFile=%~n1[new-aspect]%~x1
@echo on
# ffmpeg -i "%file%" -scodec copy -acodec copy -vcodec copy -aspect 4:3 "%newFile%"
ffmpeg -i "%file%" -c copy -map 0 -aspect "%aspectStr%" "%newFile%"
:end
Posts: 10.598
Threads: 57
Joined: May 2017
Don't really get what is wrong with using the bash script you have, here you go:
- First you would need to figure out which PAR you want, since Hybrid does not use DAR, but PAR to specify aspect ratios. read: [INFO] About pixel aspect ratios,..
- Then you would tell Hybrid to passthrough audio, video and subtitle:
- set "Base->Processing->Video" to "passthrough"
- set "Base->Processing->Audio" to "passthrough (all)"
- enable "Config->Automation->Passthrough streams->Subtitle"
- then you would enable "Muxing->Overwrite->Pixel aspect ratio" and set it to the value you want. (Personally I would also enable 'adjust stream PAR', but that would be more than your bash script does.)
Note that:
a. ffmpeg does process audio&video&subtitles in one go, which Hybrid does not, so if your streams or containers are broken Hybrid will more likely produce async output.
b. with a bit of reading the tool-tips this should have been easy to figure out on your own.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Posts: 92
Threads: 16
Joined: Mar 2021
this bat is used to chang par which isn't 1:1(such 8:9 16:15) into par 1:1 mp4 without re-encode.
I just want to if hybrid can do the same without re-encode.
Posts: 10.598
Threads: 57
Joined: May 2017
Quote:I just want to if hybrid can do the same without re-encode.
By "Muxing->Overwrite->Pixel aspect ratio" you will overwrite the PAR flag in the container.
By additionally enabling 'adjust stream PAR' Hybrid will also adjust the stream PAR if it's able to.
Note that this is different from what your batch script does.
There you specify the DAR (=display aspect ratio, i.e. 4:3, 16:9) not the PAR (=pixel aspect ration, i.e. 1:1, 8:9, 16:15).
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Posts: 92
Threads: 16
Joined: Mar 2021
Maybe I didn't say it clearly.The original file is PAR 8:9 SAR 3:2 DAR 4:3.Some platform mediaplayer such as MX player will display like the next picture as default,and everytime switch a new video you have to change to display as 4:3 again.
the hybrid output file is PAR 1:1 SAR 3:2 DAR 3:2
Is it possible to set PAR 1:1 SAR 4:3 DAR 4:3 without re-encode?then no matter what platform and no matter what mediaplayer will display the same.thank you.
Posts: 10.598
Threads: 57
Joined: May 2017
Since you are not changing the SAR (sample aspect ration = actual number of pixels in width divided by number of pixels in height), as soon as you change the PAR your change the DAR and the other way around.
Any decent media player should respect these the PAR and DAR flags and resize the content properly on playback.
If your content is already displayed correctly you should not change PAR or DAR unless you want to change the way the content is displayed.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.
Posts: 92
Threads: 16
Joined: Mar 2021
So I have to encode DVDISO/VOB from PAR 8:9 SAR 3:2 DAR 4:3/PAR 16:15 SAR 5:4 DAR 4:3 all the same to MP4/MKV VIDEO PAR 1:1 SAR 4:3 DAR 4:3,no matter what mediaplayer will display correctly.
Posts: 10.598
Threads: 57
Joined: May 2017
Yes, if you want everything to be square pixel, so that players which do not support anamorphic content also playback the file properly you need to reencode it. Just changing the aspect ratio can't do that.
Cu Selur
----
Dev versions are in the 'experimental'-folder of my GoogleDrive, which is linked on the download page.