VideoHelp Forum




+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 41 of 41
  1. Originally Posted by poisondeathray View Post
    Originally Posted by Bruce Wayne View Post

    At least it's not just me. I'm trying to figure out how to use ffmpeg. I downloaded Avanti (an ffmpeg GUI) but every time I try to use that, I just get error messages. I don't know what I'm doing wrong.


    It didn't matter if I re-encoded it to a lossless intermediate either, or slowed down the frame rate to 15, or resized to 1920x1080. It might have to do with duration and final filesize, my 1920x1080 test was shorter, final filesize was smaller. Eitherway, it's an unrealistic scenario



    Ok I posted the commandlines earlier, here are step by step for ffmpeg. Copy & paste these lines into notepad, so you can copy & paste easily into the command prompt. For this example, place ffmpeg.exe into the same folder as the video to be converted. Later on when you get more comfortable, you should set the directory path in the commandline, or use an environment variable so you can call ffmpeg from anywhere. And later on you should look into batch converting and scripts which automate many tasks instead of manually entering or right clicking etc...

    Code:
    ffmpeg -i "solveig non frame accurate test.mkv" -vf palettegen palette.png
    
    ffmpeg -i "solveig non frame accurate test.mkv" -i palette.png -lavfi paletteuse output.gif
    1) navigate to the folder with the video to be converted
    2) hold shift key, right mouse click, "open command window here", a black box will open, a command prompt
    3) go back to your notepad file, highlight the 1st line and right click, copy
    4) go back to the command prompt, with the cursor in the window somewhere, right click, paste. Then push enter. It will create palette.png
    5) go back to your notepad file, highlight the 2nd line, and right click, copy
    6) go back to the command prompt, right click, paste. Then push enter. It will create "output.gif" which was 125MB in this example, larger than the 115MB non functional solveigmm gif
    Thank you, thank you, thank you! I was just about to post here that I've got ffmpeg working! First, I followed this guy's instructions,

    Originally Posted by Chris K View Post
    Originally Posted by Bruce Wayne View Post
    Just installed Avanti but every time I open it, I get a dialog box saying the program can't start (it starts anyway) because avcodec-56.dll is missing. What do I do?
    You probably use a shared FFmpeg build (with separate dll's). Try the latest static Zeranoe build from here...

    https://ffmpeg.zeranoe.com/builds/

    Avanti may have issues with the latest builds. If so, try the last recommended version for Avanti 0.9.2 from the Zeranoe archive.
    This is "ffmpeg version N-71959-g9253cc4" Zeranoe archive date May 7, 2015

    https://ffmpeg.zeranoe.com/builds/win32/static/


    Chris
    and downloaded the May 7, 2015 version, then I followed the instructions from here,

    http://www.wikihow.com/Install-FFmpeg-on-Windows

    so I could call ffmpeg from anywhere, then I followed your instructions,

    Originally Posted by poisondeathray View Post
    The 1st command scans the file, generates a palette
    Code:
    ffmpeg -i input.ext -vf palettegen palette.png
    The 2nd command generate the actual gif, using the palette
    Code:
    ffmpeg -i input.ext -i palette.png -lavfi paletteuse output.gif
    and was able, finally, to produce a perfect gif from the clip that Solveig wouldn't.

    THANK YOU!

    Now I'm gonna test ffmpeg again on another clip that I know Solveig CAN make a gif from to see if it can do it better than Solveig.
    Quote Quote  
  2. Originally Posted by poisondeathray View Post
    Resizing to 1280x720 worked , so I'm guessing has to do with a final filesize (not necessarily dimensions) limitation for solveigmm. (And even that is unrealistic, nobody uses gif's that size)
    I don't think it has to do with file size either. The gif I just made with ffmpeg, that Solveig couldn't, was about 60 MB. The weirdly playable gif that Solveig was able to make from a reimported clip, but not from the video I cut out the clip from using Solveig, was about 250 MB. So if it's not a problem with dimensions or file size, I'm guessing it must have something to do with the actual videos.
    Quote Quote  
  3. Originally Posted by Bruce Wayne View Post
    Now I'm gonna test ffmpeg again on another clip that I know Solveig CAN make a gif from to see if it can do it better than Solveig.
    And that's a no. Pity. But at least now I have backup for when Solveig lets me down.

    Thanks again!
    Quote Quote  
  4. Originally Posted by Bruce Wayne View Post
    Originally Posted by Bruce Wayne View Post
    Now I'm gonna test ffmpeg again on another clip that I know Solveig CAN make a gif from to see if it can do it better than Solveig.
    And that's a no. Pity. But at least now I have backup for when Solveig lets me down.

    Thanks again!
    Really? How was it worse?

    On a few clips I tried, it was slightly better than solveig, especially in terms of gradients
    Quote Quote  
  5. Originally Posted by poisondeathray View Post
    Originally Posted by Bruce Wayne View Post
    Originally Posted by Bruce Wayne View Post
    Now I'm gonna test ffmpeg again on another clip that I know Solveig CAN make a gif from to see if it can do it better than Solveig.
    And that's a no. Pity. But at least now I have backup for when Solveig lets me down.

    Thanks again!
    Really? How was it worse?

    On a few clips I tried, it was slightly better than solveig, especially in terms of gradients
    Oh I didn't say it was worse, just not better. It's as good. I've got this clip that's a closeup of the face of a woman who's wearing red lipstick. In the gifs from both Solveig and ffmpeg, her lipstick comes out as kind of goldish. But no matter. Where gifs let ya down, there are always APNGs. They may display in only one type of browser but beggars can't be choosers.
    Quote Quote  
  6. Just tried creating a gif with an external encoder in vdub because I thought it might be easier than using the command prompt but I got the following error message,

    CLI: The multiplexing process failed with error code 1. Check the log for possible error messages.

    The log says,

    Mux: [Importer] Unknown input file type for test.gif.m4a
    Mux: Error importing test.gif.m4a. Requested URL is not valid or cannot be found.

    The program is C:\ffmpeg\bin\ffmpeg.exe and the command arguments are -f rawvideo -s %(width)x%(height) -r %(fpsnum)/%(fpsden) -i - -vf scale=640:-1: sws_dither=a_dither -r 10 -pix_fmt rgb8 -loop 0 "%(tempvideofile)"
    Last edited by Bruce Wayne; 11th Apr 2016 at 21:55.
    Quote Quote  
  7. Originally Posted by Bruce Wayne View Post

    Oh I didn't say it was worse, just not better. It's as good. I've got this clip that's a closeup of the face of a woman who's wearing red lipstick. In the gifs from both Solveig and ffmpeg, her lipstick comes out as kind of goldish. But no matter. Where gifs let ya down, there are always APNGs. They may display in only one type of browser but beggars can't be choosers.
    The color shift is because of the wrong matrix used (rec601) . Because gifs are meant to be tiny, most software assume SD colors. So the colors will be slightly off unless you adjust them coming from an HD source . For example, you might convert to RGB with the proper matrix (709 for HD sources) then feed that into whatever, or you could use a colormatrix filter and stay in YUV

    Not sure about vdub error, but you can make the conversion part easier by making a batch file, put it into your "send to folder". So you can right click and select it from the context menu to convert any video. Temp files can be deleted in the batch automatically
    Quote Quote  
  8. Originally Posted by poisondeathray View Post
    Originally Posted by Bruce Wayne View Post

    Oh I didn't say it was worse, just not better. It's as good. I've got this clip that's a closeup of the face of a woman who's wearing red lipstick. In the gifs from both Solveig and ffmpeg, her lipstick comes out as kind of goldish. But no matter. Where gifs let ya down, there are always APNGs. They may display in only one type of browser but beggars can't be choosers.
    The color shift is because of the wrong matrix used (rec601) . Because gifs are meant to be tiny, most software assume SD colors. So the colors will be slightly off unless you adjust them coming from an HD source . For example, you might convert to RGB with the proper matrix (709 for HD sources) then feed that into whatever, or you could use a colormatrix filter and stay in YUV

    Not sure about vdub error, but you can make the conversion part easier by making a batch file, put it into your "send to folder". So you can right click and select it from the context menu to convert any video. Temp files can be deleted in the batch automatically
    That all sounds great, but I'm afraid you're gonna have to spoonfeed me again. How do I "convert to RGB with the proper matrix (709 for HD sources)", and how do I make a batch file for ffmpeg?
    Quote Quote  
  9. I don't have time to spoonfeed tonight or get into batch files.

    Batch processing for videos, especially with ffmpeg , is discussed quite frequently here (and other forums), so you can start looking


    You can do the color conversion in avisynth, but I have a feeling you don't know how to use avisynth. One way you could do it in ffmpeg is with -vf colormatrix. Coming from an SD source, nothing needs to be done. So if coming from an HD source you would modify it slightly. A more advanced batch script would use logic if/then to detect if source is SD vs. HD and apply a different command accordingly

    Code:
    ffmpeg -i input.ext -vf colormatrix=bt709:bt601,palettegen palette.png
    
    ffmpeg -i input.ext -i palette.png -filter_complex "[0:v] colormatrix=bt709:bt601 [out1]; [out1][1:v] paletteuse=dither=none" output.gif

    The other possibility is that source had a wide range of colors, and "red" (I'm assuming that was the lipstick color) got bumped out in favor of orange, but the Rec709/601 mismatch occurs as well for sure
    Quote Quote  
  10. Originally Posted by poisondeathray View Post
    I don't have time to spoonfeed tonight or get into batch files.

    Batch processing for videos, especially with ffmpeg , is discussed quite frequently here (and other forums), so you can start looking


    You can do the color conversion in avisynth, but I have a feeling you don't know how to use avisynth. One way you could do it in ffmpeg is with -vf colormatrix. Coming from an SD source, nothing needs to be done. So if coming from an HD source you would modify it slightly. A more advanced batch script would use logic if/then to detect if source is SD vs. HD and apply a different command accordingly

    Code:
    ffmpeg -i input.ext -vf colormatrix=bt709:bt601,palettegen palette.png
    
    ffmpeg -i input.ext -i palette.png -filter_complex "[0:v] colormatrix=bt709:bt601 [out1]; [out1][1:v] paletteuse=dither=none" output.gif

    The other possibility is that source had a wide range of colors, and "red" (I'm assuming that was the lipstick color) got bumped out in favor of orange, but the Rec709/601 mismatch occurs as well for sure
    OK, thanks. I'll try having a look around and doing some trial and error experimenting. I'll let you know how it goes.

    EDIT: The video with the red lipstick problem is definitely not HD but I tried those ffmpeg commands anyway just to see what might happen. Nothing. Perfectly acceptable gif, just with orangey yellow lipstick.

    I'll try figuring out the batch process now.
    Last edited by Bruce Wayne; 11th Apr 2016 at 22:42.
    Quote Quote  
  11. Just looked up the media info on the original (red lipstick) video.

    Color range: Limited
    Color primaries: BT.601 NTSC
    Transfer characteristics: BT.601
    Matrix coefficients: BT.601

    EDIT: I must have been looking at the wrong file. The transfer characteristics are BT.601

    EDIT: Should probably just include all the video info.

    General
    Complete name : C:\Users\Bruce\Desktop\test.mkv
    Format : Matroska
    Format version : Version 2
    File size : 404 KiB
    Duration : 1s 320ms
    Overall bit rate : 2 506 Kbps
    Writing application : libmatroska 1.4.1
    Writing library : SolveigMM Matroska Muxer Version 1.0.1502.18

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L3.2
    Format settings, CABAC : Yes
    Format settings, ReFrames : 12 frames
    Codec ID : V_MPEG4/ISO/AVC
    Duration : 1s 320ms
    Bit rate : 2 072 Kbps
    Width : 720 pixels
    Height : 572 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 25.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.201
    Stream size : 334 KiB (83%)
    Language : English
    Default : No
    Forced : No
    Color range : Limited
    Color primaries : BT.601 NTSC
    Transfer characteristics : BT.601
    Matrix coefficients : BT.601
    Last edited by Bruce Wayne; 13th Apr 2016 at 18:52.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!