Previous topicNext topic

Movie export problem

Questions, comments, feedback, etc.
Post Reply
j.h.
Posts: 7
Joined: Wed Nov 23, 2016 11:40 am

Movie export problem

Post by j.h. »

Hi there

I have used magic for only a short while but managed to create a few nice animations for my music . So far so good. Now I wanted to export the animations as mp4. I went with the default setup and resolution. When I play the file later on Windows Media Player or VLC the quality is very poor. Same when I import the file to my video editor. It stutters all the time and the resolution is very poor , so I can see the pixels. I use a fairly good PC with NVIDIA GeForce GTX970. OS is Windows 7. It is really frustrating . Everything works nice in the program, so I don´t understand that the exported result has nothing to do with what I see in magic. Anybody else had this problem ? Any idea how to solve this ? I would really appreciate some help here.
J.
Magic
Site Admin
Posts: 3680
Joined: Wed Apr 09, 2014 9:28 pm

Re: Movie export problem

Post by Magic »

In the Export Movie window, what value did you use for the bit rate?
j.h.
Posts: 7
Joined: Wed Nov 23, 2016 11:40 am

Re: Movie export problem

Post by j.h. »

100 mb/s 25 frames
Magic
Site Admin
Posts: 3680
Joined: Wed Apr 09, 2014 9:28 pm

Re: Movie export problem

Post by Magic »

It could be that your hard drive isn't fast enough to play a video at that bit rate, thus it would stutter. I'm not sure though. Is there any way you could upload your video to YouTube so I can take a look? Or maybe even better, upload the original video file to DropBox and share it directly?
j.h.
Posts: 7
Joined: Wed Nov 23, 2016 11:40 am

Re: Movie export problem

Post by j.h. »

here´s the link for the exported file. I just exported a couple of minutes. It should be enough to see the problem.

https://www.dropbox.com/s/y381hafafndyk ... 1.mp4?dl=0
Terry Payman
Posts: 808
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Movie export problem

Post by Terry Payman »

Eric wrote:...upload the original video file to DropBox ...
Perfect. Now we can all see the problem. It seems that in this case the issue is LOW bit rate, approx 500kb/s, leading to excessive blockiness.

The subtle gradations in your project are particularly challenging, being very different from the typical content for which Magic's movie encoding is likely to be optimised.

The solution is to take complete control of the encoding process by exporting a .png image sequence, then encoding externally to Magic. For a detailed explanation see the Magic User's Guide section Exporting Movies and the sub-section Further Processing for .png's.

I suggest you also upload to Dropbox the .png sequence for the same section of your project. Then any of us can try our favourite encoders/workflow and share/compare results.
j.h.
Posts: 7
Joined: Wed Nov 23, 2016 11:40 am

Re: Movie export problem

Post by j.h. »

Thanks for the input so far

here´s the link for the png sequence

https://www.dropbox.com/s/nht9tcxq5eyia ... g.zip?dl=0

so the 100mB/s is not the rate for the MP4 file. ? Sorry I´m not very experienced with this formats and encoding. I exported now a AVI file from virtual dub imported it to my video editor ( Magix video pro ) and exported it from there as MPEG . The result was ok.
As i said I´m not very familiar with the encoding stuff. What could you recommend to get the best possible result encoding directly from virtual dub. I couldn´t make it work with external encoder. What I need to do with virtual dub to use external encoding ?
Terry Payman
Posts: 808
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Movie export problem

Post by Terry Payman »

I'm glad you now have OK results.

I normally use Adobe Premiere Pro & Media Encoder for encoding my .png sequences, and I'm not familiar with Virtual Dub. However I too tried to make Virtual Dub work with an external encoder http://forum.videohelp.com/threads/3674 ... er-feature, but also failed. It ran very slowly, then crashed out of the encode with an error.

I also looked for GUI front ends for FFmpeg & x264, but most I found showed some malicious content when checked with virustotal, and I didn't find any where I could see how to include an audio file. Hopefully someone else can help.

FWIW using Adobe Media Encoder set to encode at 25Mb/s I get the following (silent) file which is actually around 7Mb/s. I cannot see any degradation compared to viewing the image sequence, so it looks like a modest bit-rate will be OK.
https://www.dropbox.com/s/2t6sewpf0i9b9 ... m.mp4?dl=0
j.h.
Posts: 7
Joined: Wed Nov 23, 2016 11:40 am

Re: Movie export problem

Post by j.h. »

yes ,that looks good, thanks for you effort .
My MP4 encoding looks a lot worse. The MPEG export on the other hand looks alright. I guess I need to get a bit more in this MP4 encoding or then I just go with the MPEG. What software and encoder you would recommend in general for this kind of material ?
Magic
Site Admin
Posts: 3680
Joined: Wed Apr 09, 2014 9:28 pm

Re: Movie export problem

Post by Magic »

Out of curiosity, did you specifically want your video to be so dark and desaturated? You would probably get a better mp4 export from Magic if you increased the variation of color and brightness. Mp4s are not very good at representing subtle gradients of dark colors.
j.h.
Posts: 7
Joined: Wed Nov 23, 2016 11:40 am

Re: Movie export problem

Post by j.h. »

As I said I have been using it only for a short time, but yes that was what I liked most for this kind of music. Because the audio material has no beats etc. it was also not easy to find a setup which gave me the right interaction between music and picture and it should have some mystical feeling. Also I want to mix it with other videos or animations later and I thought this might be a good base for that.
Terry Payman
Posts: 808
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Movie export problem

Post by Terry Payman »

Sorry about the delay. I've been researching and experimenting, as I'd also like to have a simpler workflow. I decided to try FFmpeg https://www.ffmpeg.org/

I'm no expert, so I'm sure others can improve on the following.

I followed the download links and got a Windows 64-bit static build of FFmpeg from https://ffmpeg.zeranoe.com/builds/.
The software didn't need to be installed, I simply expanded the zipfile and added the \bin directory to the Windows Path environment variable.

I extracted the audio from your .mp4 video so I'd have an audio file to include, and put it in the same directory as the .png sequence.

I opened a Command Window in the .png directory. (BTW my Windows 7-64 installation had somehow lost its "Open Command Window Here" function, which I fixed with the instructions here: http://www.sevenforums.com/tutorials/13 ... click.html - where the reg entries look safe, even if I don't understand them.)

After research (some links below) and experimentation, I arrived at the following command string (all one line)
ffmpeg -framerate 25 -thread_queue_size 4096 -i %08d.png -channel_layout stereo -i animation1.wav -pix_fmt yuv420p -crf 15 out.mp4

Brief explanation (I'm not pretending to fully understand this!) See https://trac.ffmpeg.org/wiki/Encode/H.264 for more details and perhaps other useful additions to the settings.
-framerate 25 Set 25fps rate for the output file
-thread_queue_size 4096 I think this needs to be a number greater than the number of .png files to avoid "Thread message queue blocking" warning.
-i %08d.png 8 digits in the png number sequence
-channel_layout stereo -i animation1.wav Stereo file "animation1.wav" to be used for audio.
-pix_fmt yuv420p For Quicktime compatibility
-crf 15 Quality factor. Try different settings (see above link for details).
out.mp4 Output to file "out.mp4"

..which produced this file, which looks and sounds OK to me https://www.dropbox.com/s/ek6lmfbk1zip5k6/out.mp4?dl=0 (Download, rather than using the Dropbox preview!)

Some links re .png sequence to video
http://trac.ffmpeg.org/wiki/Create%20a% ... m%20images

http://video.stackexchange.com/question ... ing-colour

http://hamelot.io/visualization/using-f ... o-a-video/
Terry Payman
Posts: 808
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Movie export problem

Post by Terry Payman »

ps Having the luxury of a new NVIDIA graphics card, I thought I'd try GPU encoding. This will work on GTX 600 series and later cards, although there are refinements with each new generation. https://en.wikipedia.org/wiki/Nvidia_NVENC.

I couldn't specify the quality with -crf, but NVENC produced a similar sized file to the CPU encode, in less than one third of the time (GPU: GTX 1070, CPU: Intel i5-3570K ).

ffmpeg -framerate 25 -thread_queue_size 4096 -i %08d.png -channel_layout stereo -i animation1.wav -pix_fmt yuv420p -vcodec h264_nvenc outGPU.mp4

where h264_nvenc specifies use of the NVIDIA GPU's NVENC

Here's the file:
https://www.dropbox.com/s/5xugqfrzjzaif ... U.mp4?dl=0
j.h.
Posts: 7
Joined: Wed Nov 23, 2016 11:40 am

Re: Movie export problem

Post by j.h. »

Thanks a lot for your research and instructions. :)
I´m on a weekend trip right now, but will check it out and try it when I´m back. I think my graphic card should be able to do the encoding like you suggested. I hope I can make it work . I´ll let you know .
Terry Payman
Posts: 808
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Movie export problem

Post by Terry Payman »

You're welcome. I hope it proves useful.

I did discover a way to get higher bitrate from the GPU encoder. Lower values of q push up the bitrate.

ffmpeg -framerate 25 -thread_queue_size 4096 -i %08d.png -channel_layout stereo -i animation1.wav -pix_fmt yuv420p -vcodec h264_nvenc -qmin 5 -qmax 7 outGPUq5-7.mp4

All that said I've seen comments that CPU encoding is higher quality (presumably for comparable bitrate/filesize), so it's worth comparing on differing material. I haven't had time yet.
JEL
Posts: 11
Joined: Sun Oct 30, 2016 1:11 pm

Re: Movie export problem

Post by JEL »

j.h. wrote:so the 100mB/s is not the rate for the MP4 file. ? Sorry I´m not very experienced with this formats and encoding. I exported now a AVI file from virtual dub imported it to my video editor ( Magix video pro ) and exported it from there as MPEG . The result was ok.
As i said I´m not very familiar with the encoding stuff. What could you recommend to get the best possible result encoding directly from virtual dub. I couldn´t make it work with external encoder. What I need to do with virtual dub to use external encoding ?
The mp4 export from Magic Music Visuals (aka MMV) doesn't specify the actual used bitrate, but a maximum possible one (has to do with Variable bitrate vs Constant bitrate)

So set the bitrate in MMV to the max you want (100 is very high, but an ok number) and create a subtle noise-field in your project (it doesn't have to be visible to the human eye, but just enough noise to fool the encoder to use a higher bitrate. For example, a noise-field that only modifies the luma-values by a few values (say, values between 0 (black) and 5 (almost black, but not completely black) or something like that))
This will make the exported video from MMV use a much higher bitrate because the encoder will try to preserve this 'invisible' noise-field by increasing the bitrate.

Basically; outputs that are too clean results in low bitrate (which won't look good), so make them just a tad noisy.

Alternatively; export to png images (you don't need any noise-field for this) and export to video in another video-program (and use Constant Bitrate in that program to force the mp4 encoder there to use a high bitrate)
This method, however, won't fool Youtube (if your video ends there) which may compress your video too much because it is too clean. Again, for youtube a noise-field can be the best way to maintain a high bitrate.

Hope this helps :)

EDIT: forgot to mention this; When exporting your video from Magix Edit Pro, you should use MP4. It's generally pretty good quality as is, but you can edit how much bitrate it uses if you need it higher. Just choose one of the better preset profiles (one of those with 50 or 60 fps) and not those aimed for web-export (those aimed for web-export are preset to lower bitrates).
I think the better presets are called something like full or local or pc or something like that (you can edit them when you've selected them, to change bitrate and other settings if you like)
Post Reply