Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Narumon

#1
General Chat / Re: Edge emphasis screwup
November 14, 2018, 11:02:08 PM
Is it possible to do a script (.bat?) to automate this process?

1, ffmpeg -i INPUT.MOV image-%07d.png
2. Octave running the script then exit
3. ffmpeg -framerate 23.976 -i fixed%07d.png -i INPUT.MOV -vcodec mjpeg -q 0 -acodec copy -map 0:v:0 -map 1:a:0 INPUT_fixed.avi

Where INPUT = which is after the .bat file or script?
#2
General Chat / Re: Edge emphasis screwup
November 13, 2018, 08:56:49 AM
Quote from: Danne on November 12, 2018, 10:24:54 PM
Great octave stuff!
I had some success with a ffmpeg filterchain. It´s very fast too:

This is a more extreme cleaning but it can be easily tweaked:

Filter here:
https://ffmpeg.org/ffmpeg-filters.html#toc-removegrain

An alternative with not so strong filtering is this:
ffmpeg -i Input.mp4 -vf removegrain=4,removegrain=4,removegrain=4,removegrain=4,unsharp=7:7:0.8:7:7:0 -c:v libx264 -preset ultrafast -crf 10 Output.mov

You can put the command in a for loop and it will do all of you files in one go...

I will try these, but the above image is not good enough I think. Its roughly the same result as the Adobe Premiere built in median filter gives. Too plastic. :(
#3
General Chat / Re: Edge emphasis screwup
November 13, 2018, 08:54:52 AM
Quote from: a1ex on November 12, 2018, 09:00:07 PM
150*10788/24/60/60 = 18 *hours* of video. 150*15 = 94 days of computer time. Wait, what?!

15 hours on this clip => about 4-5 seconds per frame in octave.
Avisynth has a median filter, too.

Alternative: the above filter written in some fast language, possibly as ffmpeg plugin, possibly with GPU acceleration. Not an expert with these either.

Not all videos are the same length. Yesterday I done 3 more, which was 1 or 2 minutes long. Overall the speed is 11-14 picture /minute. (Ryzen5 1600x).

A will try to look after a faster but same quality solution.
#4
General Chat / Re: Edge emphasis screwup
November 12, 2018, 07:52:17 PM
Quote from: a1ex on November 12, 2018, 07:38:38 PM
Would this work any better? Just a guess; not tested; based on this guide:

ffmpeg -framerate 23.976 -i fixed%07d.png -i 140.MOV -vcodec mjpeg -q 0 -acodec copy -map 0:v:0 -map 1:a:0 140_fixed.avi


Whoaaaa, this is it!!
Thank you, thank you, thank you! You are the KING!

I now have a usable video finally!
Now I just need to do this procedure again about 150 more times.... (That is the amount of video files which I did with edge emphasis turned on...) :(
#5
General Chat / Re: Edge emphasis screwup
November 12, 2018, 07:20:25 PM
Quote from: Danne on November 12, 2018, 07:12:59 PM
Working?
Could you upload the octave script you are using too?

This is the script which works for me - but only with the installed octave. The command line version constantly gives error that cant find the image package.

  pkg load image

# frame numbers hardcoded for the test clip
for k = 1:10788

  # read frame k
  a = im2double(imread(sprintf('image-%07d.png', k)));

  # 5x5 median filter
  am55 = a;
  for i = 1:3
    am55(:,:,i) = medfilt2(a(:,:,i), [5 5]);
  end

  # limit fine detail to +/- 0.05 around the 5x5 median filtered image
  delta3 = min(max(a - am55, -0.05), 0.05);
  fixed3 = am55 + delta3;

  # save the fixed frame
  imwrite(im2uint8(fixed3), sprintf('fimage-%07d.png', k));
end
#6
General Chat / Re: Edge emphasis screwup
November 12, 2018, 07:19:01 PM
Hi!

Thans - this is doing the trick, but something wrong with it... :( The output file now 23.98 but still out of sync, and when generating the ffmpeg constantly gives these messages:

Past duration 0.917595 too large
Past duration 0.958397 too large  13578kB time=00:00:01.83 bitrate=60619.4kbits/s dup=0 drop=1 speed=1.81x
Past duration 0.999199 too large
Past duration 0.651985 too large  18186kB time=00:00:02.41 bitrate=61594.3kbits/s dup=0 drop=1 speed=1.58x
Past duration 0.692787 too large
Past duration 0.733589 too large
Past duration 0.774391 too large
Past duration 0.815193 too large
Past duration 0.855995 too large
Past duration 0.896797 too large
Past duration 0.937599 too large
Past duration 0.978386 too large
Past duration 0.671989 too large  22026kB time=00:00:02.91 bitrate=61811.6kbits/s dup=0 drop=2 speed=1.43x
Past duration 0.712791 too large
Past duration 0.753593 too large  26378kB time=00:00:03.58 bitrate=60252.8kbits/s dup=0 drop=3 speed=1.41x
Past duration 0.794395 too large
#7
General Chat / Re: Edge emphasis screwup
November 12, 2018, 06:54:41 PM
The input pngs time is different than the original. This is only the fps difference?

Input #0, image2, from 'fimage-%07d.png':
  Duration: 00:07:11.52, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: png, rgb24(pc), 1920x1080, 25 fps, 25 tbr, 25 tbn, 25 tbc
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '140.MOV':
  Metadata:
    major_brand     : qt
    minor_version   : 537331968
    compatible_brands: qt  CAEP
    creation_time   : 2018-08-03T15:58:02.000000Z
  Duration: 00:07:29.95, start: 0.000000, bitrate: 47321 kb/s
    Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 45783 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 48k tbc (default)
    Metadata:
      creation_time   : 2018-08-03T15:58:02.000000Z
    Stream #1:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
#8
General Chat / Re: Edge emphasis screwup
November 12, 2018, 06:45:58 PM
Quote from: a1ex on November 11, 2018, 05:14:08 PM
You need octave and ffmpeg; the procedure is performed on the command line (regardless of the operating system).

- ffmpeg to split the video into frames -> [1] in the notebook
- octave script to apply the correction -> [16] in the notebook
- ffmpeg to re-assemble the video -> [18] in the notebook

That's it.

Can you help me a bit please? After 15 hours of "cleaning" i tried to re-assemble the video, and everything went okay, except that the frame rate is 25fps (the original was 23.98fps), so the audio is out of sync. How can I modify this command for 23.98fps out file?

ffmpeg -i fixed%07d.png -i 140.MOV -vcodec mjpeg -q 0 -acodec copy -map 0:v:0 -map 1:a:0 140_fixed.avi

Thank you
#9
General Chat / Re: Edge emphasis screwup
November 11, 2018, 09:21:10 PM
I think I was able to get it work. Now it makes the output png-s. Fingers crossed :P
#10
General Chat / Re: Edge emphasis screwup
November 11, 2018, 08:33:34 PM
This command (ffmpeg -i 151.MOV image-%07d.png) done the trick. Now I have a few hundred png files.
But I cant make octave to work. I copied the command in a new.m file, but dont know what to do. If I starting the octave.vbs.... its a menu of something. I dont know what to do, please help :(
#11
General Chat / Re: Edge emphasis screwup
November 11, 2018, 08:25:50 PM
Quote from: a1ex on November 11, 2018, 05:14:08 PM
You need octave and ffmpeg; the procedure is performed on the command line (regardless of the operating system).

- ffmpeg to split the video into frames -> [1] in the notebook


When I wrote this command in command line: ffmpeg -loglevel quiet -hide_banner -i '151.MOV' frame%03d.png
Nothing happens :(
#12
General Chat / Re: Edge emphasis screwup
November 11, 2018, 04:46:32 PM
Quote from: a1ex on November 02, 2018, 02:17:55 PM
Sorry, didn't notice the issue back then. I know it's late, but... I think I've just found the magic trick.


Details: edge-emphasis-fix.html (11 MB)

I'll remove that feature; meanwhile, the fix might be helpful for other users with the same issue.


I need this fix so bad, but cant quite understand what I need to do. Is there a more straightforward to do list?
I have MOV files from my 550D - What tools I need to get rid of that edge emphasis?

Thank you!