transcoding quality lower than ffmpeg encoding.

About encoding, codec settings, muxers and filter usage
weeraman
Blank Cone
Blank Cone
Posts: 41
Joined: 18 Sep 2009 14:49

transcoding quality lower than ffmpeg encoding.

Postby weeraman » 16 Apr 2010 14:46

Hi,

i was testing transcoding of a MPEG PS with mpeg 4 codec with VLC and FFMPEG separately.
Though i select the encoder as FFMPEG with VLC, the quality is very poor comparing with the FFMPEG encoded clip.
also i'm very much bandwidth restricted and that's why i'm keeping 200kbps/18 fps, i simply cannot afford bandwidth.

VLC transocde code: (under windows, only the sout is shown here)

Code: Select all

:no-sout-audio :sout=#transcode{venc=ffmpeg,vcodec=mp4v,width=320,height=240,vb=200,fps=18}:display
FFMPEG encoding of the same clip

Code: Select all

ffmpeg -i music.mpg -vcodec mpeg4 -vb 200000 -r 18 -s 320x240 -an -f mp4 music.mp4
i want to use VLC for this purpose, but i cannot match the quality of ffmpeg encoding (for same encoding parameters)

any ideas how to improve the quality with mpeg4 transcoding in VLC ? Since VLC only allow few ffmpeg options, i cannot use ffmpeg solely.

( i played with the advanced ffmpeg options mentioned in the wiki, but still it couldn't match the original ffmpeg encoder it seems)

weeraman
Blank Cone
Blank Cone
Posts: 41
Joined: 18 Sep 2009 14:49

Re: transcoding quality lower than ffmpeg encoding.

Postby weeraman » 21 Apr 2010 06:46

no idea about this ?

Just want to know why there is a difference in quality when both VLC and FFMPEG use same encoding parameters ?

appreciate any feedback on this.

thanks.

GEFORCEXTREME
Blank Cone
Blank Cone
Posts: 36
Joined: 11 Jan 2010 16:03

Re: transcoding quality lower than ffmpeg encoding.

Postby GEFORCEXTREME » 29 Apr 2010 09:22

Were you streaming across a network?

Or were you simply doing transcoding using the sout (by streaming to a file)?

Did you have a fast enough computer for the transcoding?


IMHO, I think transcoding in VLC are done in a some what different way compared to other converters/transcoders. For example, if you rip a DVD and convert it to a MPEG-4 AVI for example, the trancoding rate varies with your computer specs but that is not a problem since we will only use the video file after it has completed converting/transcoding.

Whereares in VLC, transcoding is done while streaming, it has to be done fast enough and (in real-time maybe?) because the video will be stream to a client which will be watching the stream. So any of the factors (slow network, slow computer) might play a part to the quality of the transcoded stream.

I don't know much about VLC, but that is what I think. Correct me if I am wrong.

weeraman
Blank Cone
Blank Cone
Posts: 41
Joined: 18 Sep 2009 14:49

Re: transcoding quality lower than ffmpeg encoding.

Postby weeraman » 29 Apr 2010 10:59

hi,
i assume it uses 'libavcodec' provided by ffmpeg, to transcode from mpeg2 to mpeg4.

i have done the testing on the same machine, same input file, same encoding parameters (bit rate/framre rate/size) but both produced drastically different clips.
I just need to know why there is such a difference, since the core of the transcoding is the same.

GEFORCEXTREME
Blank Cone
Blank Cone
Posts: 36
Joined: 11 Jan 2010 16:03

Re: transcoding quality lower than ffmpeg encoding.

Postby GEFORCEXTREME » 29 Apr 2010 12:59

Ya, it may use the ffmpeg's libraries (libavformat & libavcodec) but the implementation is not the same.

ffmpeg main program (ffmpeg.exe in Windows or simply ffmpeg in Linux) is just a program that uses its own libraries. And in ffmpeg, you're doing offline transcoding.
In VLC, you're doing online transcoding (realtime encoding?) using ffmpeg's libraries (NOT like GUI front-end for some encoders as in Windows), so if you've a slow computer, or a poor network, the result you get varies.

Notice the difference? In offline transcoding, you wait for the whole process to finish, but in VLC's case, the transcoding part is actually part of the sout (stream-out) module, so it can't wait (if you've a slow computer, instead it will drop frames or something like that).

Again, I'm no expert in VLC, but that is what I believe what it is doing.

GEFORCEXTREME
Blank Cone
Blank Cone
Posts: 36
Joined: 11 Jan 2010 16:03

Re: transcoding quality lower than ffmpeg encoding.

Postby GEFORCEXTREME » 29 Apr 2010 13:01

Others are having the same problem, look here.

https://vlmc.org/viewtopic.php?f=4&t=74 ... 42#p248696

Lotesdelere
Cone Master
Cone Master
Posts: 9964
Joined: 08 Sep 2006 04:39
Location: Europe

Re: transcoding quality lower than ffmpeg encoding.

Postby Lotesdelere » 29 Apr 2010 13:16

The default values used by VLC for MPEG-4 ASP and MPEG-2 are meant for streaming mainly and not for conversion transcoding. For instance by default no B-frames are used, no trellis, etc...
This is the reason why at the same given bitrate the quality is lower than ffmpeg which is using many optimisations by default. To achieve the same quality you need to edit the settings of the ffmpeg encoder in the Preferences:
Tools -> Preferences (All) -> Input / Codecs -> Video codecs -> FFmpeg

weeraman
Blank Cone
Blank Cone
Posts: 41
Joined: 18 Sep 2009 14:49

Re: transcoding quality lower than ffmpeg encoding.

Postby weeraman » 30 Apr 2010 10:34

Thanks for the tips you have provided.

Lotesdelere: do you have an idea of what ffmpeg parameters to be adjusted in preferences...


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 27 guests