I am trying to import a video as frames.

47 views
Skip to first unread message

Chris Miller- Pogue Planetarium

unread,
Feb 18, 2016, 2:58:25 PM2/18/16
to Blendertarium
The issue I am having is that this is a music video, and when I add the sound, it doesn't match the video.  The video is done at 24 fps.  How can I convert it to 30 fps so that it will match the sound?

Scott Sumner

unread,
Feb 18, 2016, 3:27:44 PM2/18/16
to blende...@googlegroups.com

Ffmpeg can fix that for you, I will try to get a command for you this evening

On Feb 18, 2016 1:58 PM, "Chris Miller- Pogue Planetarium" <unka...@gmail.com> wrote:
The issue I am having is that this is a music video, and when I add the sound, it doesn't match the video.  The video is done at 24 fps.  How can I convert it to 30 fps so that it will match the sound?

--
You received this message because you are subscribed to the Google Groups "Blendertarium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blendertariu...@googlegroups.com.
Visit this group at https://groups.google.com/group/blendertarium.
To view this discussion on the web visit https://groups.google.com/d/msgid/blendertarium/51721ef8-aaf6-45ed-b18c-79218e34fde4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Sumner

unread,
Feb 19, 2016, 2:57:39 AM2/19/16
to blende...@googlegroups.com
Chris,

I haven't tested this entire workflow but it should be pretty close.  If you hit a snag let me know and we'll see what got hung up.

Start by running this ffmpeg command, replacing input.avi with the original video you have.  This will generate an AVI and a separate WAV file for the sound track, both at 30 FPS

ffmpeg -r 24 -i input.avi -r 30 output.avi -r 30 output.wav

Here's what's happening with the FFmpeg command
  • -r 24 -- this is a 24 fps source
  • -i input.avi -- the file that I want to process at 24 FPS
    • Now that I've specified an input source all parameters are reset until the next input (or output) is provided
  • -r 30 -- make a 30 fps sequence
    • Even though the command is the same it now applies to the next file it finds
  • output.avi -- call it output.avi
    • Now that I've specified an output destination all parameters are reset until the next input (or output) is provided
  • -r 30 -- make a 30 fps sequence
  • output.wav -- generate a file called output.wav
    • Since I've specified an audio file type (wav) only the audio data will be exported.

Then follow the steps in the attached PNGs to format your video in Blender.

Once your render is complete use this FFMPEG command to put everything back together

ffmpeg -i output.wav -f image2 -r 30 -i okgo_%05d.jpg -vcodec libx264 -qscale 12 finished.avi

  • -i output.wav -- use output.wav (generated from the previous FFmpeg command) as one of the input sources
    • Now that I've specified an input source all parameters (even though there weren't any on this file) are reset until the next input (or output) is provided
  • -f image2 -- the input source is a sequence of still images
  • -r 30 -- treat this sequence of still images as frames at 30 fps
  • -i okgo_%05d.jpg
    • This is a file name filter which needs its own explanation
    • okgo_ -- this will be the filename you specify in blender for output frames
    • %05d -- this is a format code for how the frame numbers are formatted.  It breaks down as follows:
      • % -- this is a format code
      • 0 -- pad non-existant digits with a 0 (even if we're on frame 3 blender still names the file 00003)
      • 5 -- how many digits the frame number should consist of.
      • d -- this is a decimal number
    • .jpg -- Now we're back to just matching the output file name, in this case .jpg because that's what we asked Blender to render
    • That was a filename so now all parameters are reset for the next file
  • -vcodec libx264 -- The video codec should be H264
  • -qscale 12 -- the overall quality of the output video.  This number ranges from 2 - 31 with lower being better quality.  We usually use 12 - 15 for the Noble, your mileage may vary
  • finished.avi -- this is the filename where your finished video will show up.
Hope this helps, good luck!  Awesome video by the way, if you haven't already seen it also check out the making of here https://www.youtube.com/watch?v=pnTqZ68fI7Q

Scott


step 1.png
step 2.png
step 3.png
step 4.png
step 5.png
step 6.png

Chris Miller

unread,
Feb 22, 2016, 9:00:22 AM2/22/16
to Blendertarium

Chris Miller

unread,
Feb 22, 2016, 9:06:49 AM2/22/16
to Blendertarium

I tried your suggestion Scott, and I got different results, but still not a match between images and sound.  Still working on it.
Do you know how to output an .avi file from Blender instead of using ffmpeg?  I think I might be able to get the frames for the images and the sound to match in Blender and render them together, but I don't know how to take those resulting frames and turn them into a .avi movie.

Ken Murphy

unread,
Feb 22, 2016, 4:00:43 PM2/22/16
to Blendertarium
Chris,

This might not be it but it's worth a shot.  I've noticed that if I am trying to match up an animation with sound, the two don't stay in step.  So I have to keep stopping/restarting and they start out in sync but then quickly start drifting.  If my machine is slow and the animation is complex it drifts quickly.  When I do the final render everything is fine as long as it synced things properly. I'm not sure if it works that way with your video but it's worth a check.

Ken



On Thursday, February 18, 2016 at 1:58:25 PM UTC-6, Chris Miller- Pogue Planetarium wrote:

Scott Sumner

unread,
Feb 22, 2016, 4:02:26 PM2/22/16
to blende...@googlegroups.com
Next to the play controls at the bottom of the blender window there's a "Sync mode" selection.  It may say "none" initially.  They have "drop frame" and "AV sync".  Selecting "AV sync" should keep previews in sync in blender and reflect the actual rendered animation.

Scott


--
You received this message because you are subscribed to the Google Groups "Blendertarium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blendertariu...@googlegroups.com.
Visit this group at https://groups.google.com/group/blendertarium.

Scott Sumner

unread,
Feb 22, 2016, 4:04:12 PM2/22/16
to blende...@googlegroups.com
IN the same dropdown where you select PNG or JPEG select H264 instead.  Then right underneath it in the audio tab choose MP3 as the audio compression method.  That should give you a video file out of blender.  But make sure that Blender doesn't crash / laptop batteries don't die, if the render crashes the entire file will be unplayable and you'll have to start over on the render.

Scott


On Mon, Feb 22, 2016 at 8:06 AM, Chris Miller <poguepla...@gmail.com> wrote:

I tried your suggestion Scott, and I got different results, but still not a match between images and sound.  Still working on it.
Do you know how to output an .avi file from Blender instead of using ffmpeg?  I think I might be able to get the frames for the images and the sound to match in Blender and render them together, but I don't know how to take those resulting frames and turn them into a .avi movie.

--
You received this message because you are subscribed to the Google Groups "Blendertarium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blendertariu...@googlegroups.com.
Visit this group at https://groups.google.com/group/blendertarium.
Reply all
Reply to author
Forward
0 new messages