FORUMS: list search recent posts

Total newbie :(

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Thomas Monk
Total newbie :(
on Apr 2, 2013 at 4:16:03 pm

I must be thick, because I just can't get my head around ffmpeg. Here's what I'm trying to do:

I have a folder "C:frames" that contains 58656 jpg images (1920x1080). These images are named "frame-000000.jpg" to "frame-58655.jpg". These images are not interlaced.

I would like to be able to convert a consecutive number of these frames into both HD mpeg4 1920x1080 format and PAL mpeg2 DVD 720x576 format at high quality.

Although the images are in 16x9 format, the image is actually 4x3 with black bars to each side. When converting to 720x576 I would like to crop the side bars.

I've managed to create a movie with a single frame, but that's about it. Please help.


Return to posts index

Lou Logan
Re: Total newbie :(
on Apr 2, 2013 at 5:24:51 pm

[Thomas Monk] "When converting to 720x576 I would like to crop the side bars."

How much from each side would you like to crop?


Return to posts index

Thomas Monk
Re: Total newbie :(
on Apr 3, 2013 at 8:17:24 am

210 pixels from each side.


Return to posts index


Thomas Monk
Re: Total newbie :(
on Apr 3, 2013 at 1:43:05 pm

Sorry, I left a zero out my last frame number, should be "frame-000000.jpg" to "frame-058655.jpg".


Return to posts index

Jim Sustacek
Re: Total newbie :(
on Apr 3, 2013 at 1:53:40 pm

Amending my other post, which assumed 240 pixel cropping, here's a 210 pixel crop:
ffmpeg -f image2 -r 25 -i frame-%05d.jpg <b>filter="-vf crop=1500:1080:210:0"</b> -target pal-dvd output.mpg


Return to posts index

Thomas Monk
Re: Total newbie :(
on Apr 3, 2013 at 3:53:36 pm

Thanks for your help Jim. Do I need to specify the full path; i.e. C:\frames\frame-%05d.jpg ? And in light of my slight filename amendment; i.e. frame-000000.jpg to frame-058655.jpg do I need to put frame-%06d.jpg ?


Return to posts index


Lou Logan
Re: Total newbie :(
on Apr 5, 2013 at 6:29:45 pm

[Jim Sustacek] "filter="-vf crop=1500:1080:210:0"

filter= and its associated quotation marks should be removed.


Return to posts index

Jim Sustacek
Re: Total newbie :(
on Apr 3, 2013 at 1:51:13 pm

Here's a basic command to concatenate your images into a movie, based on this blog post about time-lapse movies:
ffmpeg <b>-f image2</b> -r 25 <b>-i frame-%05d.jpg</b> -c:v libx264 output.mp4
"-r 25" is your frame rate, and "-c:v libx264" would be your codec/quality settings. Feel free to adjust those or swap in other codec/quality settings you may find around the web.

You should also be able to use the crop filter (format width:height:x:y, see filtering guide here) and the "pal-dvd" target for your PAL DVD encode like this (although I haven't tried it yet):
ffmpeg -f image2 -r 25 -i frame-%05d.jpg <b>filter="-vf crop=1440:1080:240:0"</b> -target pal-dvd output.mpg


Return to posts index

Thomas Monk
Re: Total newbie :(
on Apr 3, 2013 at 7:35:47 pm

Sorry Jim, but this doesn't seem to work at all. I think something has gone awry with spurious formatting such as " ".


Return to posts index


Reuben Martin
Re: Total newbie :(
on Apr 4, 2013 at 1:22:03 am

Don't copy the html "bold" tags that got placed in there for some reason.


Return to posts index

Thomas Monk
file not found?
on Apr 4, 2013 at 2:43:53 pm

I'm running the following single line in a batch file (run.bat):

ffmpeg -f image2 -start_number 7723 -r 25 -i /tmp/img%05d.jpg filter="-vf crop=1500:1080:210:0" -target pal-dvd output.mpg

But ffmpeg keeps reporting that it cannot find the file:

/tmp/imgC:Program Filesffmpegbinrun.bat05d.jpg

For some reason % is being replaced by the path and name of my batch file.

This is driving me bonkers!


Return to posts index

Reuben Martin
Re: file not found?
on Apr 4, 2013 at 10:36:57 pm

Using ffmpeg within a bat script is quite messy. It parses text differently than a posix compliant shell does.

You will have to escape the "%" character in order to use it within a bat script. It's been a long time since I've used bat files, but if I remember correctly you can escape that character by doubling it up. ("%%" in place of "%")

You might save yourself a lot of trouble by installing a windows port of bash, and using that to write shell scripts rather than bat scripts.


Return to posts index


Thomas Monk
Off and running...
on Apr 6, 2013 at 10:40:48 am

Okay, thanks guys. That double %% did the trick and I also had to put path names in 8.3 format; e.g. "Program Files" became "Progra~1".

I have some issues with output format/quality and cropping at the moment, but I'm sure I'll get that sorted now I'm actually generating a movie.

Here's the basic batch file entry I'm using at present:

ffmpeg -f image2 -r 24 -i C:\Progra~1\ffmpeg\frames\reel_1\frame-0%%05d.jpg -target pal-dvd movie.mpg

The -start_number option works, although I can't find it mentioned anywhere. I was trying to find if there's an equivalent -end_number option. I'll have an experiment.


Return to posts index

Reuben Martin
Re: Off and running...
on Apr 6, 2013 at 4:14:25 pm

There is a "-t" option to specify duration from the start point, or there is a "-to" option to specify the stop point.

The official documentation can be found here: http://ffmpeg.org/ffmpeg.html


Return to posts index

Lou Logan
Re: Off and running...
on Apr 7, 2013 at 7:10:57 pm

Additional documentation is here: http://ffmpeg.org/documentation.html


Return to posts index


Thomas Monk
Re: Off and running...
on Apr 8, 2013 at 8:03:03 am

Thanks Lou :)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]