Activity › Forums › Compression Techniques › AVI to AVI 16:9 conversion
-
AVI to AVI 16:9 conversion
Posted by Kora Richardson on May 28, 2010 at 12:26 amHi just wondering if you can convert uncompressed avi to uncompressed avi 16:9 conversion using ffmpeg? I have 4:3 stretched avi’s I would like to be turned to 16:9 which is what the footage was shoot in
Thanks for any help
Pete Page replied 15 years, 9 months ago 3 Members · 6 Replies -
6 Replies
-
Michael Rampe
May 28, 2010 at 7:35 amDo you want to convert anamorphic to square pixel 16:9 for the web or use this in a video editing application?
The simple answer is “yes”, FFmpeg can do the task you require.
The more complex answer is “they already are (most likely) 16:9 but the player is ignoring the aspect ratio flag”
There are three values which dictate aspect ratio. SAR, PAR and DAR.
SAR=source aspect ratio
This is the aspect ratio of the source pixels. It can be calculated by dividing the width by the height. In standard definition D1 pal, this is 5:4 or 1.25 (720×576)DAR=display aspect ratio
This is the intended display aspect. Usually 16:9 or 4:3 for standard definition, always 16:9 for high definition.PAR=pixel aspect ratio
This is usually deduced by dividing DAR by SAR. In a 16:9 PAL example as used above: PAR=DAR/SAR therefore PAR=16:9/5:4 =16×4/9×5 =64/45 =1.42For 16:9 D1 PAL:
SAR=1.25 or 5/4
DAR=1.78 or 16/9
PAR=1.42 or 64/45Your player is most likely ignoring these settings and just showing the source pixels as they are. Most editing applications will read these settings correctly or allow you to assign them to the footage.
To give you more help it would be good to get the ffmpeg readout of the file you are trying to convert.
Use the command:
ffmpeg -i yourfile.avi
Paste the console/shell readout to a new post.This will allow me to see whether the footage has the correct 16:9 settings already or needs them added by FFmpeg.
Michael
“half-way to world domination A.K.A. the belligerent blue bike shed”
-
Kora Richardson
May 30, 2010 at 10:58 pmC:\Documents and Settings\Administrator\My Documents\ffmpeg>ffmpeg -i gillian.av
i
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: –enable-gpl –enable-postproc –enable-swscale –enable-avfilt
er –enable-avfilter-lavf –enable-pthreads –enable-avisynth –enable-libfaac –
-enable-libfaad –enable-libmp3lame –enable-libspeex –enable-libtheora –enabl
e-libvorbis –enable-libxvid –enable-libx264 –enable-memalign-hack
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 0. 4. 0 / 0. 4. 0
libswscale 0. 7. 1 / 0. 7. 1
libpostproc 51. 2. 0 / 51. 2. 0
built on Mar 16 2009 16:09:18, gcc: 4.2.4 [Sherpya]
Input #0, avi, from ‘gillian.avi’:
Duration: 00:03:06.64, start: 0.000000, bitrate: 250244 kb/s
Stream #0.0: Video: rawvideo, bgr24, 720×576, 25 tbr, 25 tbn, 25 tbc
Stream #0.1: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
At least one output file must be specifiedThats what I get…
The issue is that i’m outputting using dps velocity 8.2 and it doesn’t have a 16:9 aspect ratio rather it only have a fixed size which is cuts down to when clicked… 720 x 404 … which i would think is not correct so i’m outputting 720×576 … and then i’m just adding 16:9 output when uploading to the web through ffmpeg…. i’m wanting to send the uncompressed avi to a client and i think if they see it 4:3 stretched then they won’t understand that it can be 16:9 when compressed for the web…. therefore i was wondering if ffmpeg could output 16:9 avi with a simply no quality loss conversion… i’m just quite new to ffmpeg and aren’t to sure the coding to use…
-
Michael Rampe
May 31, 2010 at 12:13 amTry:
ffmpeg -i yourfile.avi -vcodec copy -acodec copy -aspect 16:9 output.avi
The -vcodec copy command will ensure no recompression is done.
The -aspect 16:9 command sets the correct aspect ratio flags.Let me know if this works for you.
Michael
“half-way to world domination A.K.A. the belligerent blue bike shed”
-
Pete Page
November 1, 2010 at 10:42 pmI am slowing 1440×1080 video (with aspect ratio 16:9) from my hdr fx1000 using the command lifted from cinelerra controls.
ffmpeg -i dvgrabinput.m2t -an -f yuv4mpegpipe – | yuvfps -s 5:1 -r 5:1 | ffmpeg -f yuv4mpegpipe -i – -f mpeg2video -r 25 -an -qscale 2 slowoutput.mpg
the output file now has an aspect of 4:3 but when I try to convert to 16:9 with
ffmpeg -sameq -i slowoutput.mpg -aspect 16;9 slowoutputr.mpg
the ratio remains unchanged -still 4:3
If I convert to mp4
ffmpeg -sameq -i slowoutput.mpg -aspect 16;9 slowoutputr.mp4
then the aspect is changed. Any ideas how to change the aspect ratio and keep mpg format?
Thanks -
Michael Rampe
November 2, 2010 at 9:17 amI think your problem is that you are using -vcopy which, by its nature, does not process the video stream and hence does not change the aspect ratio in the stream. .mpg is an old and limited container in regards to this matter. .mp4 as in your example can store the aspect ratio in the container and works.
[Pete Page] “the ratio remains unchanged -still 4:3”
This is the source aspect ratio which means the display aspect is probably not being held by the container. Do a header read on the mpg output and post the result. (ffmpeg -i slowoutputr.mpg)Michael
-
Pete Page
November 2, 2010 at 7:26 pmInput #0, mpeg, from ‘slowoutputr.mpg’:
Duration: 00:02:02.76, start: 1.000000, bitrate: 4092 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 1440×1080 [PAR 1:1 DAR 4:3], 104857 kb/s, 25 fps, 25 tbr, 90k tbn, 25 tbcThanks
Reply to this Discussion! Login or Sign Up