Quantcast

AVI, WMV, FLV, MOV and MP4 to libx264 MP4 conversion bugs

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

AVI, WMV, FLV, MOV and MP4 to libx264 MP4 conversion bugs

Teshan Nanayakkara
Hi there,

I have used the following command line expression to compress and convert
AVI, WMV, FLV, MOV and MP4 files to libx264 MP4.

*ffmpeg -i abc.flv -vcodec libx264 -vf scale=-1:360 -qscale 7 -acodec
libvo_aacenc -ab 32 -ar 24000 abc.mp4*

To run this command I use PHP exec() function. I need to know the most
appropriate and the correct commands to convert each and every (above
mentioned) format to H.264 MP4 format without changing the aspect ratio and
video height less than or equal to 360 pixels. And with aac audio encoding
codec. Sometimes ffmpeg fails to convert above formats but not always. It
may be depending on the source file's codecs. So I need to know how the
above command should be modified to convert each video format mentioned
above.

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

Re: AVI, WMV, FLV, MOV and MP4 to libx264 MP4 conversion bugs

Lou-2
On Sat, 5 Jan 2013 00:53:21 +0530
Teshan Nanayakkara <[hidden email]> wrote:

> Hi there,
>
> I have used the following command line expression to compress and convert
> AVI, WMV, FLV, MOV and MP4 files to libx264 MP4.
>
> *ffmpeg -i abc.flv -vcodec libx264 -vf scale=-1:360 -qscale 7 -acodec
> libvo_aacenc -ab 32 -ar 24000 abc.mp4*
>
> To run this command I use PHP exec() function. I need to know the most
> appropriate and the correct commands to convert each and every (above
> mentioned) format to H.264 MP4 format without changing the aspect ratio and
> video height less than or equal to 360 pixels. And with aac audio encoding
> codec. Sometimes ffmpeg fails to convert above formats but not always. It
> may be depending on the source file's codecs. So I need to know how the
> above command should be modified to convert each video format mentioned
> above.
>
> Thanks

The complete console outputs are missing. Without the ffmpeg commands
and console outputs we can only make guesses since "fails to convert"
is not as descriptive as any actual ffmpeg messages or errors.

You should first run the ffmpeg commands manually, that is outside of
PHP, until you get a satisfactory result.

Some other stuff:

* libvo_aacenc isn't a great AAC encoder.

* libx264 probably ignores qscale resulting in the default of "-crf
  24". This usually provides a decent output buy maybe not what you
  want.

* "-ab" takes a value in bits, not kilobits, so use "-ab 32k".

* "-ar 24000" seems unnecessary.

* If the resulting width is an odd value then libx264 will complain
  with "height not divisible by 2". scale="trunc(oh*a*2)/2:360" should
  automatically round down to an even value if odd.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AVI, WMV, FLV, MOV and MP4 to libx264 MP4 conversion bugs

Teshan Nanayakkara
When I use this command in terminal for all the video formats it worked
like a magic. but i put it in a live online site it didnt work for some
files. So can you please write down the correct commands for each file
format (avi, flv, wmv, mov, mp4) ? Output video height should be less than
or equal to 360p, mp4, h.264 compatible,

On Sat, Jan 5, 2013 at 1:31 AM, Lou <[hidden email]> wrote:

> On Sat, 5 Jan 2013 00:53:21 +0530
> Teshan Nanayakkara <[hidden email]> wrote:
>
> > Hi there,
> >
> > I have used the following command line expression to compress and convert
> > AVI, WMV, FLV, MOV and MP4 files to libx264 MP4.
> >
> > *ffmpeg -i abc.flv -vcodec libx264 -vf scale=-1:360 -qscale 7 -acodec
> > libvo_aacenc -ab 32 -ar 24000 abc.mp4*
> >
> > To run this command I use PHP exec() function. I need to know the most
> > appropriate and the correct commands to convert each and every (above
> > mentioned) format to H.264 MP4 format without changing the aspect ratio
> and
> > video height less than or equal to 360 pixels. And with aac audio
> encoding
> > codec. Sometimes ffmpeg fails to convert above formats but not always. It
> > may be depending on the source file's codecs. So I need to know how the
> > above command should be modified to convert each video format mentioned
> > above.
> >
> > Thanks
>
> The complete console outputs are missing. Without the ffmpeg commands
> and console outputs we can only make guesses since "fails to convert"
> is not as descriptive as any actual ffmpeg messages or errors.
>
> You should first run the ffmpeg commands manually, that is outside of
> PHP, until you get a satisfactory result.
>
> Some other stuff:
>
> * libvo_aacenc isn't a great AAC encoder.
>
> * libx264 probably ignores qscale resulting in the default of "-crf
>   24". This usually provides a decent output buy maybe not what you
>   want.
>
> * "-ab" takes a value in bits, not kilobits, so use "-ab 32k".
>
> * "-ar 24000" seems unnecessary.
>
> * If the resulting width is an odd value then libx264 will complain
>   with "height not divisible by 2". scale="trunc(oh*a*2)/2:360" should
>   automatically round down to an even value if odd.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AVI, WMV, FLV, MOV and MP4 to libx264 MP4 conversion bugs

Lou-2
On Sat, 5 Jan 2013 02:26:22 +0530
Teshan Nanayakkara <[hidden email]> wrote:

> On Sat, Jan 5, 2013 at 1:31 AM, Lou <[hidden email]> wrote:
>
> > On Sat, 5 Jan 2013 00:53:21 +0530
> > Teshan Nanayakkara <[hidden email]> wrote:
> >
> > > Hi there,
> > >
> > > I have used the following command line expression to compress and convert
> > > AVI, WMV, FLV, MOV and MP4 files to libx264 MP4.
> > >
> > > *ffmpeg -i abc.flv -vcodec libx264 -vf scale=-1:360 -qscale 7 -acodec
> > > libvo_aacenc -ab 32 -ar 24000 abc.mp4*
> > >
> > > To run this command I use PHP exec() function. I need to know the most
> > > appropriate and the correct commands to convert each and every (above
> > > mentioned) format to H.264 MP4 format without changing the aspect ratio
> > and
> > > video height less than or equal to 360 pixels. And with aac audio
> > encoding
> > > codec. Sometimes ffmpeg fails to convert above formats but not always. It
> > > may be depending on the source file's codecs. So I need to know how the
> > > above command should be modified to convert each video format mentioned
> > > above.
> > >
> > > Thanks
> >
> > The complete console outputs are missing. Without the ffmpeg commands
> > and console outputs we can only make guesses since "fails to convert"
> > is not as descriptive as any actual ffmpeg messages or errors.
> >
> > You should first run the ffmpeg commands manually, that is outside of
> > PHP, until you get a satisfactory result.
> >
> > Some other stuff:
> >
> > * libvo_aacenc isn't a great AAC encoder.
> >
> > * libx264 probably ignores qscale resulting in the default of "-crf
> >   24". This usually provides a decent output buy maybe not what you
> >   want.
> >
> > * "-ab" takes a value in bits, not kilobits, so use "-ab 32k".
> >
> > * "-ar 24000" seems unnecessary.
> >
> > * If the resulting width is an odd value then libx264 will complain
> >   with "height not divisible by 2". scale="trunc(oh*a*2)/2:360" should
> >   automatically round down to an even value if odd.

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

Re: AVI, WMV, FLV, MOV and MP4 to libx264 MP4 conversion bugs

Lou-2
In reply to this post by Teshan Nanayakkara
Damn... I really need to change that keyboard send command.

On Sat, 5 Jan 2013 02:26:22 +0530
Teshan Nanayakkara <[hidden email]> wrote:

> When I use this command in terminal for all the video formats it worked
> like a magic. but i put it in a live online site it didnt work for some
> files. So can you please write down the correct commands for each file
> format (avi, flv, wmv, mov, mp4) ? Output video height should be less than
> or equal to 360p, mp4, h.264 compatible.

"Didn't work" means nothing without actual console outputs. "live
online site" is also not descriptive; more information is needed to
give you any more suggestions.

The input formats are not a great concern and the command will likely
not change due the varying formats.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: AVI, WMV, FLV, MOV and MP4 to libx264 MP4 conversion bugs

kaushik
In reply to this post by Teshan Nanayakkara
Hi there,

I have the slimier problem.
I am using a bit simple command and that works fine through terminal. but when I use it from web it gives me a blank mp4 file.
I have a centos 6 ser version and ffmpeg config is -
ffmpeg version 1.2
built on Mar 25 2013 20:01:59 with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-3)
configuration: --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libvo-aacenc --enable-libxvid --disable-ffplay --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --extra-cflags=-fPIC

I am running command like

"ffmpeg -i /path-to-videos/fail_1.flv -vcodec libx264  /path-to-videos/failed.mp4"

*path-to-videos = actual path in the server.
Loading...