3

How using FFMPEG do I convert a video file to a sequence of images that is equal in duration/frames to the original video file?

I'm trying to import video into the non comercial version of Nuke on Linux which refuses to accept h.264 and doesn't have handy a list of accepted codecs that I can find...but plays nice with images sequences...but I can't get the sound to line up with the image sequence.

I tried getting a look at the framerate with:

ffprobe -v 0 -of compact=p=0 -select_streams 0 -show_entries stream=r_frame_rate Forest.mp4 

which returns:

r_frame_rate=30/1

and then I run

ffmpeg -i Forest.mp4 -r 30/1 forest/jpegs%06d.jpg
Jeremy
  • 645
  • 7
  • 19

2 Answers2

4

Assuming your video is constant frame rate (avg_frame_rate should be same as r_frame_rate),

use

ffmpeg -i Forest.mp4 -vsync 0 forest/jpegs%06d.jpg
Gyan
  • 85,394
  • 9
  • 169
  • 201
2

NUKE Non-commercial is functionally restricted in the following ways:

-Output resolution is limited to HD (1920 x 1080).

-2D format support is disabled for MPEG4 and H264.

-etc...

NUKE 10.5 NC functional restrictions

So you should go this way to make image sequence:

ffmpeg -i Forest.mp4 image%04d.tif

Don't forget to setup frame rate (fps=30) in NUKE Project Settings.

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
  • I don't see a reason to do 2 passes when a single pass with `-crf` should suffice. – llogan Mar 01 '17 at 18:32
  • I don't see a reason to do any transcoding if the app accepts MP4s. – Gyan Mar 01 '17 at 19:17
  • @Mulvya There are two reasons why MP4 is bad for Nuke: it's 8bit per channel (not good for CC and grading) and mp4 video is slower than image sequence when playing back and compositing. – Andy Jazz Mar 01 '17 at 19:33
  • Ok, but the OP already has a H.264 stream. Unless libx264 was set to 10-bit during compile, your command is transcoding to another 8-bit H.264 stream (forced to 2 mbps). That's one generation loss added. The container (MP4) doesn't really matter. – Gyan Mar 01 '17 at 19:54