Poor quality output when converting avi to mp4

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Poor quality output when converting avi to mp4

Ute Willmore
Hi everyone,

I am hoping someone on this list can help me with a problem I am having
when converting a .avi video to .mp4 using FFmpeg. The output I get starts
out looking good, but then degrades and by the time the 18 second video
finishes it is hard to recognize what's on the screen. The colors are all
off, some areas are just single color blobs where there used to be trees.

I am really hoping someone here will be able to help.

I have the latest version 20170718-012620a of ffmpeg. This is the static 64
bit version for Windows running on Windows 10 Pro.

I started out using the following command to convert the video:

ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4

After some research and reading on various websites, I tried this:

ffmpeg   -v verbose -i hd.avi -c:v h264  -crf 19 -preset slow
 scaledoutput.mp4

I tried different crf and preset values but nothing made a difference.
Eventually I tried to just copy the video using this command:

ffmpeg   -v verbose -i hd.avi -c copy -map 0  scaledoutput.mp4

and the result was just as bad.

Next I started looking for another converter to see if I could get better
results and found that Adobe and VLC work just fine. There are others as
well, but I need a converter is free and can be run from the command line,
because the conversion will be done in a .NET Desktop application. VLC
seems to fit the bill best, at least for now.

I really would like to do this with ffmpeg for a number of reasons,
including the speed of ffmpeg. It is so much faster and can do so much more
than any other media converter, but if I can't get it to produce a decent
quality video when converting avi to mp4  I may end up using something else.

BTW, when I run ffprobe on the output file produced by ffmpeg and on the
output file produced by VLC,  I get get the same information for the video
stream. The video stream is stream 0, 0, the encode is h264 and pixel
 format is yuv420p. Here is the relevant output from ffprobe:

For the output created by VLC:
Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 6378 kb/s, 50 fps, 50 tbr, 1000k tbn, 100 tbc (default)

For the output created by ffmpeg:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 8482 kb/s, 50 fps, 50 tbr, 12800 tbn, 100 tbc (default)

The meta data encode used by the 2 converters is different and audio is
handled differently as well, but that should not impact the video quality,
right?

The file produced by VLC looks great when I run it but the file produced by
ffmpeg is really very poor quality,

If you need to see the files I am working with, try getting them from
Dropbox.com

Here is the link to the input file:
dropbox.com/s/dw6ml8iwnnkmoz9/hd.avi?dl=0
<https://www.dropbox.com/s/dw6ml8iwnnkmoz9/hd.avi?dl=0>
and the output file is here:
dropbox.com/s/p19vsn9iasb99km/scaledoutput.mp4?dl=0
<https://www.dropbox.com/s/p19vsn9iasb99km/scaledoutput.mp4?dl=0>

If that does not work for you, let me know if I can post videos to the list
and I will try that. I have not found any method for doing so, but maybe I
overlooked something or I am too new to the list?

Anyway, if anyone can help figure this out, I would be very grateful. If
more details are needed, please let me know what I missed and I will try to
provide it.

TIA

urw
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Reindl Harald


Am 24.07.2017 um 20:26 schrieb Ute Willmore:

> I am hoping someone on this list can help me with a problem I am having
> when converting a .avi video to .mp4 using FFmpeg. The output I get starts
> out looking good, but then degrades and by the time the 18 second video
> finishes it is hard to recognize what's on the screen. The colors are all
> off, some areas are just single color blobs where there used to be trees.
>
> I am really hoping someone here will be able to help.
>
> I have the latest version 20170718-012620a of ffmpeg. This is the static 64
> bit version for Windows running on Windows 10 Pro.
>
> I started out using the following command to convert the video:
>
> ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4

without a bitrate param the results are poor because of ridiculous low
bitrate defaults, at least that was the case many years ago as we
implemented our php-wrapper
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Gyan
On Tue, Jul 25, 2017 at 12:15 AM, Reindl Harald <[hidden email]>
wrote:


> ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4
>
>
>
> without a bitrate param the results are poor because of ridiculous low
> bitrate defaults, at least that was the case many years ago as we
> implemented our php-wrapper
>

Not an issue here, as MP4 defaults to libx264, when available, which in
turn defaults to CRF 23.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Phil Rhodes-3
I'd be interested to know what "crf 23" actually means.
How do I get it to do, say, 2.5Mbps?
P
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Gyan
In reply to this post by Ute Willmore
On Mon, Jul 24, 2017 at 11:56 PM, Ute Willmore <[hidden email]>
wrote:

> Hi everyone,
>
> I am hoping someone on this list can help me with a problem I am having
> when converting a .avi video to .mp4 using FFmpeg. The output I get starts
> out looking good, but then degrades and by the time the 18 second video
> finishes it is hard to recognize what's on the screen. The colors are all
> off, some areas are just single color blobs where there used to be trees.
>

Running your conversion command on your source, I see

Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
decoded;

Muxing to TS and playing that throws invalid NAL warnings.

So I ran

mp4box -aviraw video hd.avi

which produced hd_video.h264. This plays fine with ffplay.

Running

ffmpeg  -v verbose -i hd_video.h264 -i hd.avi -map 0 -map 1:a -vf
scale=640:480 out.mp4

produces an undistorted output.

As best as I can tell, ffmpeg does have issues with parsing non-standard
H.264 bitstreams. It's certainly not as resilient as other decoders.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Ute Willmore
In reply to this post by Phil Rhodes-3
crf stands for constant rate factor. Allowed values are between 0 and 51,
default is 23. To get better quality, use a lower number. The recommended
start value, if the default does not work for you, is 18. 0 is lossless.

You can read on the topic here: https://trac.ffmpeg.org/wiki/Encode/H.265

URW

On Mon, Jul 24, 2017 at 12:57 PM, Phil Rhodes <
[hidden email]> wrote:

> I'd be interested to know what "crf 23" actually means.
> How do I get it to do, say, 2.5Mbps?
> P
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Ute Willmore
In reply to this post by Gyan
Gyan,

I am still very new to video conversion and ffmpeg, so I don't understand
parts of your reply. Please explain:

What is non-standard about my input video?

I ran many conversion commands, and listed several of them in my original
message. Which one did you use?

What does "Muxing to TS" mean and why/how did you do that? What does
"Invalid NAL warnings mean?

I gather mp4box is another tool to use when dealing with videos and there
are all kinds of version available.

Is this the one you are using?
https://www.videohelp.com/software/MP4Box

I think you are saying that no matter what I will have to use MP4Box or
something similar to make a "standard" avi video and then convert that new
video to mp4 using the ffmpeg command you used. Is that correct?

Obviously, I would prefer not to process the video twice, because the real
video can be quite large. Do you have any idea what needs to be done to
produce a standard avi video in the first place?

Thanks

urw

On Mon, Jul 24, 2017 at 12:55 PM, Gyan <[hidden email]> wrote:

> On Mon, Jul 24, 2017 at 11:56 PM, Ute Willmore <[hidden email]>
> wrote:
>
> > Hi everyone,
> >
> > I am hoping someone on this list can help me with a problem I am having
> > when converting a .avi video to .mp4 using FFmpeg. The output I get
> starts
> > out looking good, but then degrades and by the time the 18 second video
> > finishes it is hard to recognize what's on the screen. The colors are all
> > off, some areas are just single color blobs where there used to be trees.
> >
>
> Running your conversion command on your source, I see
>
> Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
> decoded;
>
> Muxing to TS and playing that throws invalid NAL warnings.
>
> So I ran
>
> mp4box -aviraw video hd.avi
>
> which produced hd_video.h264. This plays fine with ffplay.
>
> Running
>
> ffmpeg  -v verbose -i hd_video.h264 -i hd.avi -map 0 -map 1:a -vf
> scale=640:480 out.mp4
>
> produces an undistorted output.
>
> As best as I can tell, ffmpeg does have issues with parsing non-standard
> H.264 bitstreams. It's certainly not as resilient as other decoders.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Gyan
On Tue, Jul 25, 2017 at 1:10 AM, Ute Willmore <[hidden email]>
wrote:

>
> What is non-standard about my input video?
>

That I don't know. Only that ffmpeg doesn't decode most of the frames from
the original file.


> I ran many conversion commands, and listed several of them in my original
> message. Which one did you use?
>

'ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4'

What does "Muxing to TS" mean and why/how did you do that? What does
> "Invalid NAL warnings mean?
>

H.264 data is stored in chunks called NAL units. I transferred the contents
to another container format just to test the result, so you can ignore this
part.



> Is this the one you are using?
> https://www.videohelp.com/software/MP4Box
>

Yes, but this is the download page at the official site:
https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/

mp4box is one of the tools bundled.


> Do you have any idea what needs to be done to
> produce a standard avi video in the first place?
>

How are these AVIs produced?
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Moritz Barsnick
In reply to this post by Gyan
On Tue, Jul 25, 2017 at 00:25:36 +0530, Gyan wrote:
> Running your conversion command on your source, I see
>
> Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
> decoded;
>
> Muxing to TS and playing that throws invalid NAL warnings.

But that was a conversion, right?

> mp4box -aviraw video hd.avi
>
> which produced hd_video.h264. This plays fine with ffplay.

That was remuxing, right?

> As best as I can tell, ffmpeg does have issues with parsing non-standard
> H.264 bitstreams. It's certainly not as resilient as other decoders.

I did a different test:
- Playing the original video with ffplay produces the peculiar image
  Ute is probably seeing.
- Playing with mplayer produces an acceptable image. (mplayer uses
  ffmpeg's libavcodec for decoding the video..)
- Playing with "mplayer -demuxer lavf" produces the same junk as
  ffplay.

So I come to the conclusion that ffmpeg/libavformat has an issue
demuxing the file. mplayer's native AVI demuxer doesn't. The latter is
also probably valid for VLC, if that works for Ute. mp4box also doesn't
have an issue. So, I think this is worth tracking as an ffmpeg bug (on
trac.ffmpeg.org), providing the sample as an attachment, the command
line and the complete, uncut console output.

My $0.02,
Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Ute Willmore
Thank you Moritz! I will at least consider doing that, but I was beginning
to suspect a bug myself. I just need to find a solution or work around
first before I can take the time to do some more testing with VLC to
confirm a bug. VLC allows you to use ffmpeg to convert a video from the
command line and I want to see what the output looks like before I report a
bug.

Ute

On Mon, Jul 24, 2017 at 2:05 PM, Moritz Barsnick <[hidden email]> wrote:

> On Tue, Jul 25, 2017 at 00:25:36 +0530, Gyan wrote:
> > Running your conversion command on your source, I see
> >
> > Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
> > decoded;
> >
> > Muxing to TS and playing that throws invalid NAL warnings.
>
> But that was a conversion, right?
>
> > mp4box -aviraw video hd.avi
> >
> > which produced hd_video.h264. This plays fine with ffplay.
>
> That was remuxing, right?
>
> > As best as I can tell, ffmpeg does have issues with parsing non-standard
> > H.264 bitstreams. It's certainly not as resilient as other decoders.
>
> I did a different test:
> - Playing the original video with ffplay produces the peculiar image
>   Ute is probably seeing.
> - Playing with mplayer produces an acceptable image. (mplayer uses
>   ffmpeg's libavcodec for decoding the video..)
> - Playing with "mplayer -demuxer lavf" produces the same junk as
>   ffplay.
>
> So I come to the conclusion that ffmpeg/libavformat has an issue
> demuxing the file. mplayer's native AVI demuxer doesn't. The latter is
> also probably valid for VLC, if that works for Ute. mp4box also doesn't
> have an issue. So, I think this is worth tracking as an ffmpeg bug (on
> trac.ffmpeg.org), providing the sample as an attachment, the command
> line and the complete, uncut console output.
>
> My $0.02,
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Ute Willmore
In reply to this post by Gyan
Gyan,
thanks for getting back to me and taking the time to explain.

I am not sure how they are produced, except that someone takes a video, it
may be stored on a DVR before it is downloaded to a PC, but it could be
downloaded from the camera straight to the PC as well. This is for a
commercial product so all kinds of video cameras are used, whatever the
client wants to use. I don't know if the problem happens only when they are
stored on a DVR before they are downloaded to the PC or not.

I am a software person! So I know very little about the hardware involved
in this. I just write the code for the software that uses the videos. :-)

I'll try to find out though and let you know when I do.

For now, I hope I can replace ffmpeg with mp4box. I thought the version on

On Mon, Jul 24, 2017 at 1:57 PM, Gyan <[hidden email]> wrote:

> On Tue, Jul 25, 2017 at 1:10 AM, Ute Willmore <[hidden email]>
> wrote:
>
> >
> > What is non-standard about my input video?
> >
>
> That I don't know. Only that ffmpeg doesn't decode most of the frames from
> the original file.
>
>
> > I ran many conversion commands, and listed several of them in my original
> > message. Which one did you use?
> >
>
> 'ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4'
>
> What does "Muxing to TS" mean and why/how did you do that? What does
> > "Invalid NAL warnings mean?
> >
>
> H.264 data is stored in chunks called NAL units. I transferred the contents
> to another container format just to test the result, so you can ignore this
> part.
>
>
>
> > Is this the one you are using?
> > https://www.videohelp.com/software/MP4Box
> >
>
> Yes, but this is the download page at the official site:
> https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/
>
> mp4box is one of the tools bundled.
>
>
> > Do you have any idea what needs to be done to
> > produce a standard avi video in the first place?
> >
>
> How are these AVIs produced?
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Moritz Barsnick
In reply to this post by Ute Willmore
On Mon, Jul 24, 2017 at 16:07:00 -0600, Ute Willmore wrote:
> confirm a bug. VLC allows you to use ffmpeg to convert a video from the
> command line and I want to see what the output looks like before I report a
> bug.

Actually, vlc (or the command line version cvlc) has its own "engine"
for conversion of videos. It does make use of libavformat/libavcodec, I
believe, but not exclusively. So vlc could be used to convert, instead
of ffmpeg, or at least to remux for ffmpeg's use.

I personally have a lot of trouble wrapping my head around vlc's
command line syntax though, I'm hardly of any help. (One of many guides
is here: https://wiki.videolan.org/Transcode/)

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Ute Willmore
I understand what you mean, Moritz! I used to work under UNIX so command
line was all I used. It's been a while since then, but when I use a tool
like ffmpeg it comes back quickly. Looking at the command line
documentation for VLC yesterday, I got confused. The problem is, that they
allow you (or force you) to nest options. That leads to using "" and ( or {
and before you know it, you get lost counting double quotes and brackets.
:-)
That's what happened to me last night, so I called it a day and went home.
:-)

I'll figure it out when I can take the time to play with it and I am not as
tired as I was last night.

I just don't want to report a bug that is not a bug and I would like to
know what I get when I tell VLC to use ffmpeg to convert the file...

I'll keep you posted, if you like.

Ute

On Mon, Jul 24, 2017 at 4:57 PM, Moritz Barsnick <[hidden email]> wrote:

> On Mon, Jul 24, 2017 at 16:07:00 -0600, Ute Willmore wrote:
> > confirm a bug. VLC allows you to use ffmpeg to convert a video from the
> > command line and I want to see what the output looks like before I
> report a
> > bug.
>
> Actually, vlc (or the command line version cvlc) has its own "engine"
> for conversion of videos. It does make use of libavformat/libavcodec, I
> believe, but not exclusively. So vlc could be used to convert, instead
> of ffmpeg, or at least to remux for ffmpeg's use.
>
> I personally have a lot of trouble wrapping my head around vlc's
> command line syntax though, I'm hardly of any help. (One of many guides
> is here: https://wiki.videolan.org/Transcode/)
>
> Moritz
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Carl Eugen Hoyos-2
In reply to this post by Ute Willmore
2017-07-24 20:26 GMT+02:00 Ute Willmore <[hidden email]>:
> dropbox.com/s/dw6ml8iwnnkmoz9/hd.avi?dl=0

This is now ticket #6551, thank you for the sample!

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Carl Eugen Hoyos-2
In reply to this post by Gyan
2017-07-24 20:55 GMT+02:00 Gyan <[hidden email]>:
> As best as I can tell, ffmpeg does have issues with parsing non-standard
> H.264 bitstreams. It's certainly not as resilient as other decoders.

Could you elaborate?
FFmpeg decoders (and demuxers) were written with the intent to
read as many non-standard files as possible and this is what we
have been experiencing (for a decade) - bugs such as the one
described in this ticket are of course possible.

Do you have (many) samples that fail with FFmpeg but work with
other decoders?

Or do you mean that error resilience for damaged (as opposed to
non-standard) H.264 is not as good as expected? Use
single-threaded decoding for improved error resilience with FFmpeg.
(Multi-threaded error resilience is non-trivial, and multi-threaded
decoding seemed - much - more important a few years ago than
error resilience.)

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Gyan
On Tue, Jul 25, 2017 at 12:42 PM, Carl Eugen Hoyos <[hidden email]>
wrote:

> 2017-07-24 20:55 GMT+02:00 Gyan <[hidden email]>:
> > As best as I can tell, ffmpeg does have issues with parsing non-standard
> > H.264 bitstreams. It's certainly not as resilient as other decoders.
>
> Could you elaborate?
>

Every few weeks, there's a question at one of the SE sites about a file
that does not convert as expected with ffmpeg. Most of the time, VLC or
Potplayer (Win player that I use) plays these files without a hitch. Many
of these tend to be from surveillance cameras or similar niche
applications. When I come across these in the future, I'll open tickets.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Ute Willmore
In reply to this post by Gyan
Gyan,

I am having trouble with mp4box and I am hoping you can help me once again.
I downloaded and installed the 32 bit and 64 bit version of GPAC but when I
try to run either one, I get errors or a file that won't play. I am running
mp4box on the cmd line using this command:

mp4box -aviraw video hdout.mp4

But the 32 bit version produces a file I cannot play with media player or
mplayer.

I repeated the command using the 64 bit version, but I get a message saying
the applicatiThis is on the 64 on started wrong and to click ok to close it.

So I looked around some and found an example for converting avi to mp4
using mp4vbox and tried it:

mp4box.exe -add hd.avi hdout.mp4

But I get:

Unfortunately, mp4box.exe had stopped working.

This was using the 64 bit version.

What am I doing wrong? I got both version from the GPAC download page here:

https://gpac.wp.imt.fr/downloads/ using the links in the first paragraph
labeled Windows 32 bits and Windows 64 bits.

When installation was done, I copied the exe files to a local driectory and
renamed on to mp4box32.exe and left the 64 bit version named mp4box.exe.
That way I know for sure which version I am running and I have all the
files in one sub-directory on my desktop where I am working using the
command prompt.

When I got the error saying mp4box stopped running, I started using the
mp4box executable in program files by using the full path to tghe
executable butIstill get the error.

Please help if you can.

Ute

Ute



On Mon, Jul 24, 2017 at 1:57 PM, Gyan <[hidden email]> wrote:

> On Tue, Jul 25, 2017 at 1:10 AM, Ute Willmore <[hidden email]>
> wrote:
>
> >
> > What is non-standard about my input video?
> >
>
> That I don't know. Only that ffmpeg doesn't decode most of the frames from
> the original file.
>
>
> > I ran many conversion commands, and listed several of them in my original
> > message. Which one did you use?
> >
>
> 'ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4'
>
> What does "Muxing to TS" mean and why/how did you do that? What does
> > "Invalid NAL warnings mean?
> >
>
> H.264 data is stored in chunks called NAL units. I transferred the contents
> to another container format just to test the result, so you can ignore this
> part.
>
>
>
> > Is this the one you are using?
> > https://www.videohelp.com/software/MP4Box
> >
>
> Yes, but this is the download page at the official site:
> https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/
>
> mp4box is one of the tools bundled.
>
>
> > Do you have any idea what needs to be done to
> > produce a standard avi video in the first place?
> >
>
> How are these AVIs produced?
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Gyan
You have to run

mp4box -aviraw video hd.avi       which will create hd_video.h264

The h264 file cannot be played by many (most?) players but it can be used
by ffmpeg, as shown in the subsequent command. The h264 file only contains
video, no audio so it has to be combined with the audio from the original
source. The 2nd command does that.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Ute Willmore
Thanks Guam,

That helps, but I don't see the second command to get the audio or use
ffmpeg to play the video.

Did something get truncated, or did you forget to type it?

I am reading your mail on my phone using Chrome to access gmail. Maybe that
is causing problems?

The message I received is show in full below. Do you see the commands you
mentioned in your email? Is the message different from what you typed?

Please try to send the commands again.

Thanks
Ute

On Tuesday, July 25, 2017, Gyan <[hidden email]> wrote:

> You have to run
>
> mp4box -aviraw video hd.avi       which will create hd_video.h264
>
> The h264 file cannot be played by many (most?) players but it can be used
> by ffmpeg, as shown in the subsequent command. The h264 file only contains
> video, no audio so it has to be combined with the audio from the original
> source. The 2nd command does that.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email] <javascript:;>
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] <javascript:;> with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Poor quality output when converting avi to mp4

Gyan
On Wed, Jul 26, 2017 at 9:50 PM, Ute Willmore <[hidden email]>
wrote:


> That helps, but I don't see the second command to get the audio or use
> ffmpeg to play the video.
>

The 2nd command in my original post (where I presented this method).

It is,

ffmpeg  -v verbose -i hd_video.h264 -i hd.avi -map 0 -map 1:a -vf
scale=640:480 out.mp4

Gyan
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
12
Loading...