Page 1 of 1

Config file, CustomMencoderOptions, harddup parameter

Posted: Fri Dec 13, 2013 12:44 am
by ge2001
Hi,
writing a config file for my UPNP client i set "CustomMencoderOptions" in the config file. My OS and UMS are up to date.

Using this line everything works fine so far (sometimes AV sync problems), i.e i can watch flv movies:
CustomMencoderOptions = -mc 0 -noskip -vf scale=720:576 harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:acodec=mp2:abitrate=224 -ofps 25

To avoid further AV sync problems i read the MEncoder doc page and i realize that there should be a comma in front of "harddup":
CustomMencoderOptions = -mc 0 -noskip -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:acodec=mp2:abitrate=224 -ofps 25

Adding the comma i'm not able to watch flv movies. The flv video starts and stops without showing the video.
Removing "harddup" completly, the same error (no video).
I'm very confused. Can anybody help me with this issue?
The log files are attached.

Regards

Re: Config file, CustomMencoderOptions, harddup parameter

Posted: Sat Dec 14, 2013 4:51 am
by DeFlanko
From mplayer(1):
> harddup
>
> Only useful with MEncoder. If harddup is used when encoding, it will
> force duplicate frames to be encoded in the output. This uses
> slightly more space, but is necessary for output to MPEG files or if
> you plan to demux and remux the video stream after encoding. Should
> be placed at or near the end of the filter chain unless you have a
> good reason to do otherwise.
7.1.12.1. Improving muxing and A/V sync reliability

You may experience some serious A/V sync problems while trying to mux your video and some audio tracks, where no matter how you adjust the audio delay, you will never get proper sync. That may happen when you use some video filters that will drop or duplicate some frames, like the inverse telecine filters. It is strongly encouraged to append the harddup video filter at the end of the filter chain to avoid this kind of problem.

Without harddup, if MEncoder wants to duplicate a frame, it relies on the muxer to put a mark on the container so that the last frame will be displayed again to maintain sync while writing no actual frame. With harddup, MEncoder will instead just push the last frame displayed again into the filter chain. This means that the encoder receives the exact same frame twice, and compresses it. This will result in a slightly bigger file, but will not cause problems when demuxing or remuxing into other container formats.

You may also have no choice but to use harddup with container formats that are not too tightly linked with MEncoder such as the ones supported through libavformat, which may not support frame duplication at the container level.
so i think then the correct usage is...:

Code: Select all

CustomMencoderOptions = -mc 0 -noskip -vf scale=720:576,harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:acodec=mp2:abitrate=224 -ofps 25
i'm wondering if the output fps is 25 is the cause of the issue if its trying to inject frames to keep everything in sync... can you try a different -ofps? maybe 24 instead?

Re: Config file, CustomMencoderOptions, harddup parameter

Posted: Sat Dec 14, 2013 5:31 am
by ge2001
Hi,
thank you for the answer.
In the meantime i realize all that strang AV sync problems were a result of the poor LAN chip inside my client M740AV (~22 Mbit/s).
So, inside UMS, under Transcode settings i select "keyint=25:vqmax=5:vqmin=2". All (!) the AV sync problems are gone, Yeah ... :-)
Also while resuming, fast forward or fast rewind. In the past sometimes a video stopped without a reason. Everything is fixed now. :-)
This could be a hint for other users with AV sync or simular problems.

My client don't support ac3 audio (only mpa) in the generated mpeg2 file, that was the main trouble for me with UMS.
But now everything works perfect. As a wish, maybe the developers could add another Profile, "TranscodeVideo = MPEGPSMPA", or so ...

Harddup comma issue is realy strange, but everything works fine now, without the comma. Who cares ... :-) :-) :-)
One thing do not work, NTSC videos with 29.97 fps causes audio disturbance. But that is realy a small problem for me in Europe.
25 fps ist the european video standard, but i can try to set it to 24 fps, just for fun.

Again, i'm very happy with UMS; muchas gracias flys to the Developers!
I will update the Siemens Gigaset M740AV Render Thread tomorrow. Because i can upload zip files now :-) i'll include some screenshots of my UMS settings.

Regards

Re: Config file, CustomMencoderOptions, harddup parameter

Posted: Sat Dec 14, 2013 8:41 am
by DeFlanko
haha, well whatever works i guess =)

Re: Config file, CustomMencoderOptions, harddup parameter

Posted: Fri Dec 20, 2013 9:24 am
by ge2001
Hi again,
some minutes ago i found a solution for the (my) NTSC framerate problem.
NTSC videos with 23.976 or 29.970 fps causes audio disturbance transcoding to my PAL device which uses 25 fps.
Inside UMS select Transcode settings Tab and select MEncoder.
Click Expert settings and insert this code in the box:

framerate == 23.976 :: -speed 25025/24000 -ofps 25
framerate == 29.970 :: -speed 25025/30000 -ofps 25

Don't forget to save. Restart UMS and enjoy.

Regards
Snapshot_08.jpg
Snapshot_08.jpg (314.17 KiB) Viewed 10652 times