aspect ratio is changed with codec copy and sameq

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

aspect ratio is changed with codec copy and sameq

vrparekh@gmail.com
This post was updated on .
Hello,

i want to extract clip from one mp4 video,

i tried with "-vcodec copy -acodec copy" and "-sameq"

(
ffmpeg -sameq -i "input file" "output file"

ffmpeg -i "input file" -acodec copy -vcodec copy "outputfile"
)

in both, aspect ratio of generated file is changed.

source file is of aspect ratio
sar=4:3
dar=4:3

new file is has aspect ratio
sar=4:3
dar=1:1

please help me to solve this problem,

thanks
vishal parekh

Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

Carl Eugen Hoyos
vrparekh <at> gmail.com <vrparekh <at> gmail.com> writes:

> i want to extract clip from one mp4 video,
>
> i tried with "-vcodec copy -acodec copy" and "-sameq"
>
> in both, aspect ratio of generated file is changed.

Please provide command line together with complete, uncut console output.

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

vrparekh@gmail.com
Thanks Carl,

one weird thing is when i see details in another video tool, it shows me
sar=4:3
dar=4:3
of original video

but when i use command ffpeg -i sourcefile, it shows me
sar=300:400
dar=1:1

below is command line output of codec copy

ffmpeg.exe -ss 5 -t 150 -i "d:\source.mp4" -acodec
 copy -vcodec copy "d:\output.mp4"
ffmpeg version N-38938-ge01f478 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 19 2012 23:18:25 with gcc 4.6.2
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzli
b --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable
-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-l
ibrtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-li
bvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-l
ibx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 42.100 / 51. 42.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 65.101 /  2. 65.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\source.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2012-01-26 21:00:03
  Duration: 00:05:00.32, start: 0.000000, bitrate: 539 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 400x300 [
SAR 300:400 DAR 1:1], 469 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 60 tbc
    Metadata:
      creation_time   : 2012-01-26 21:00:03
      handler_name    :
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 32000 Hz, stereo, s16, 64
kb/s
    Metadata:
      creation_time   : 2012-01-26 21:00:03
      handler_name    :
strptime() unavailable on this system, cannot convert the date string.
Output #0, mp4, to 'd:\output.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42isom
    creation_time   : 2012-01-26 21:00:03
    encoder         : Lavf54.2.100
    Stream #0:0(eng): Video: h264 (![0][0][0] / 0x0021), yuv420p, 400x300 [SAR 3
00:400 DAR 1:1], q=2-31, 469 kb/s, 29.97 fps, 90k tbn, 90k tbc
    Metadata:
      creation_time   : 2012-01-26 21:00:03
      handler_name    :
    Stream #0:1(eng): Audio: aac (@[0][0][0] / 0x0040), 32000 Hz, stereo, 64 kb/
s
    Metadata:
      creation_time   : 2012-01-26 21:00:03
      handler_name    :
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 9001 fps=0.0 q=-1.0 Lsize=   19815kB time=00:05:00.29 bitrate= 540.6kbits
/s
video:17212kB audio:2350kB global headers:0kB muxing overhead 1.294060%
Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

Carl Eugen Hoyos
vrparekh <at> gmail.com <vrparekh <at> gmail.com> writes:

> one weird thing is when i see details in another video tool, it shows me
> sar=4:3
> dar=4:3
> of original video
>
> but when i use command ffpeg -i sourcefile, it shows me
> sar=300:400
> dar=1:1

If the input file is decoded incorrectly, please provide a sample.

>
> below is command line output of codec copy
>
> ffmpeg.exe -ss 5 -t 150 -i "d:\source.mp4" -acodec
>  copy -vcodec copy "d:\output.mp4"

What does ffmpeg -i output.mp4 show?

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

vrparekh@gmail.com
> ffmpeg.exe -i d:\output.mp4
ffmpeg version N-38938-ge01f478 Copyright (c) 2000-2012 the FFmpeg developers
  built on Mar 19 2012 23:18:25 with gcc 4.6.2
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3
 --disable-w32threads --enable-runtime-cpudetect --enable-avisynth --enable-bzli
b --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable
-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-l
ibrtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-li
bvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-l
ibx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      51. 42.100 / 51. 42.100
  libavcodec     54. 12.100 / 54. 12.100
  libavformat    54.  2.100 / 54.  2.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 65.101 /  2. 65.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  7.100 /  0.  7.100
  libpostproc    52.  0.100 / 52.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\output.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.2.100
  Duration: 00:05:00.32, start: 0.000000, bitrate: 540 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 400x300 [
SAR 300:400 DAR 1:1], 469 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 60 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 32000 Hz, stereo, s16, 64
kb/s
    Metadata:
      handler_name    :
At least one output file must be specified
Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

Carl Eugen Hoyos
vrparekh <at> gmail.com <vrparekh <at> gmail.com> writes:

>     Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
> 400x300 [SAR 300:400 DAR 1:1]

This is exactly the same as your input file shows.
Where is the problem?

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

Rodney Baker
On Wed, 21 Mar 2012 17:45:36 Carl Eugen Hoyos wrote:

> vrparekh <at> gmail.com <vrparekh <at> gmail.com> writes:
> >     Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
> >
> > 400x300 [SAR 300:400 DAR 1:1]
>
> This is exactly the same as your input file shows.
> Where is the problem?
>
> Carl Eugen
>

Carl, I think the key is in this quote from a previous mail in this thread:

>one weird thing is when i see details in another video tool, it shows me
>sar=4:3
>dar=4:3
>of original video

>but when i use command ffpeg -i sourcefile, it shows me
>sar=300:400
>dar=1:1

In other words, ffmpeg appears to be detecting the SAR and DAR differently to
"another video tool" and creating the output file the same as the alledgedly
incorrectly detected input file aspect ratio (thus incorrectly altering the
aspect ratio to something different from the source file. At least, that is
how I read it.

--
===================================================
Rodney Baker VK5ZTV
[hidden email]
===================================================

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

Carl Eugen Hoyos
Rodney Baker <rodney.baker <at> iinet.net.au> writes:

> >one weird thing is when i see details in another video tool, it shows me
> >sar=4:3
> >dar=4:3
> >of original video
>
> >but when i use command ffpeg -i sourcefile, it shows me
> >sar=300:400
> >dar=1:1
>
> In other words, ffmpeg appears to be detecting the SAR and DAR
> differently to "another video tool"

My answer was:
"If the input file is decoded incorrectly, please provide a sample."
I assumed the original report was about FFmpeg destroying some
information when remuxing the stream. That some information is
possibly read incorrectly sounds different to me.

Thank you for your help, Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: aspect ratio is changed with codec copy and sameq

vrparekh@gmail.com
i have done like find actual aspect ratio using mediainfo,

and pass -aspect x:y as ffmpeg param.



Thanks,
Vishal Parekh