DeepMosaics icon indicating copy to clipboard operation
DeepMosaics copied to clipboard

Is it possible to set the bitray

Open bwrw88 opened this issue 2 years ago • 6 comments

Can you make it come out in the same size as the original video?

bwrw88 avatar Dec 01 '21 15:12 bwrw88

DeepMosaics seems to be using CRF for output conversion, unfortunately it seems nobody wants to share the secret of how to change is, since this question, or others very similar have been asked before but never answered. Whatever CRF is used by default, it's not good enough in my opinion. There is a noticeable loss of detail in areas that aren't getting processed...

Lukas-52 avatar Jan 06 '22 12:01 Lukas-52

When you run the master code directly you can edit the util/ffmpeg.py file. Just edit the line below "image2video". Mine currently looks like this while using the png option: os.system('ffmpeg -y -r '+str(fps)+' -i '+imagepath+' -vcodec libx264 -crf 20 -tune film -preset slow -pix_fmt yuv420p -vf colormatrix=bt601:bt709 -sws_flags +accurate_rnd+full_chroma_int '+os.path.split(voicepath)[0]+'/video_tmp.mp4')

d0ne187 avatar Jan 16 '22 08:01 d0ne187

And if i am using the prebuild exe Version provided under the releases tab?

I haven't found anything hinting towards ffmpeg settings in there.

Lukas-52 avatar Jan 17 '22 10:01 Lukas-52

I don't know if and how you could change the built version. But if you install Python and the prerequisites you just have to execute one command line. I would just recommend to install pytorch using the instructions on their site with the correct Cuda version. On my first install the code didn't use my graphics card. But maybe I just had the wrong Cuda version.

d0ne187 avatar Jan 17 '22 17:01 d0ne187

Maybe it would be good feature to make it possible to pass the video setting to ffmpeg using the advanced options in the Precompiled version. If you have never worked with python its a royal pain to get it running. Especially under windows.

Lukas-52 avatar Jan 22 '22 06:01 Lukas-52

And if i am using the prebuild exe Version provided under the releases tab?

I haven't found anything hinting towards ffmpeg settings in there.

What I do to get maximum quality is using the temp png file sequence. To avoid DeepMosaics automatically deleting the png temp sequence just create a [your video name]_clean.mp4 in DeepMosaics\result\ , and then DeepMosaics will stop before creating the final video file and deleting the top quality png sequence, asking for your confirmation: File '../result/[your video name]_clean.mp4' already exists. Overwrite? [y/N]

Now you can copy/move the png sequence from DeepMosaics\core\tmp\DeepMosaics_temp\replace_mosaic\ to other safe path, before DeepMosaics delete it.

Then you can use NmKoder, Premiere or whatever to make the final video with your chosen settings.

Milincho avatar Apr 19 '22 10:04 Milincho