Khstapp
Posts: 5
Joined: Thu Dec 31, 2015 12:27 am

AVCONV syntax - missing code

Thu Dec 31, 2015 1:23 am

1 - I'm a total noob with raspberry
2 - Using PI 2 model B using Wheezy 7.8
3 - Attempting the stop motion learning lesson with my son
https://www.raspberrypi.org/learning/pu ... worksheet/

Everything works fine up until we try to convert the .jpg files into a video using avconv:
avconv -r 10 -qscale 2 -i animation/%O3d.jpg animation.mp4

We get the following error message: Could not find codec parameters (Video: mjpeg)

First the obvious things we've tried:
1 - file names are frame001.jpg thru frame010.jpg
2 - opened the files using the image viewer to confirm they are valid image files
3 - confirmed the file path. Full path is /home/pi/animation. Verified the files are in the directory.
avconv -r 10 -qscale 2 -i /home/pi/animation/%O3d.jpg animation.mp4
4 - We tried to convert just one image file:
avconv -r 10 -qscale 2 -i /home/pi/animation/frame001.jpg animation.mp4

That worked but obviously a time lapse of one frame is worthless but at least it showed the directory path and file is valid. We then tried each frame one at a time to make sure the source files are valid.

Each file processed but when we tried to view the video with omxplayer no video played - had to cntl-c to stop.

I've searched the forums and Google for the error message but didn't find anything so any guidance is appreciated.

Navyscourge
Posts: 258
Joined: Sat Oct 24, 2015 1:50 pm

Re: AVCONV syntax - missing code

Thu Dec 31, 2015 10:40 am

I have not tried this yet, but I think the avconv command is wrong (and wrong in the worksheet). The input filename pattern is wrong for the files that you have; the command should be

Code: Select all

avconv -r 10 -qscale 2 -i animation/frame%O3d.jpg animation.mp4
Happy to be proven wrong :D - the error message might be misleading

Khstapp
Posts: 5
Joined: Thu Dec 31, 2015 12:27 am

Re: AVCONV syntax - missing code

Thu Dec 31, 2015 5:43 pm

Yep, that worked. The syntax for the file names was incorrect. Avconv created the .mp4 file. Haven't been able to get omxplayer to run it yet but that is a problem for another post.

Thanks for the help.

User avatar
ben_nuttall
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 231
Joined: Sun Aug 19, 2012 11:19 am
Location: Cambridge, UK
Contact: Website

Re: AVCONV syntax - missing code

Fri Jan 01, 2016 4:13 pm

I've fixed the worksheet - the avconv command was missing the word "frame".

It could do with more explanation too. Will return to it when I get chance.
Community Manager - Raspberry Pi Foundation
Author of GPIO Zero and creator of piwheels

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: AVCONV syntax - missing code

Fri Jan 01, 2016 4:26 pm

Khstapp wrote:I've searched the forums and Google for the error message but didn't find anything so any guidance is appreciated.
I see that others helped figure at least most of what is going wrong out but I'd add that at least in some versions of Debian derived distributions, in my case it was Ubuntu 14.04 LTS, the version of avconv was claimed by some other software using it to be too old for whatever that software was trying to do. So I would go to the avconv website and make sure that the version you are running is either current or near current.

As a general rule, problems that seem like they shouldn't exist because you are doing everything right (as far as you can reasonably tell) could easily come from a bug due to using an old version of the software or a bug due to using some new way of doing things in a newer version of the software. This idea won't directly solve any problem but it will, if recalled in a time software crisis, help direct you to things to try, that is upgrade to latest version, downgrade to a version someone else had success running the software with. The third option is to complain a lot and wait for a bug fix in your distribution. The third option at least allows you to vent.

Return to “Troubleshooting”