Comments (9)
Show me the command line you used that did generate a .webm
properly for you on your setup?
from craft-transcoder.
Here's the command: ffmpeg -i Input.mp4 -c:v libvpx -c:a libvorbis -quality good -cpu-used 0 Output.webm
from craft-transcoder.
And what is the command that Transcoder is outputting when you try to use it? It should be in your config/logs/web.log
assuming devMode
is on.
from craft-transcoder.
Here's the command that gets logged:
/usr/bin/ffmpeg -i '/var/www/html/web/uploads/videos/Racewell-Sheep-Handler/Dagging.mp4' -vcodec libvpx -quality good -cpu-used 0 -bufsize 1000k -threads 0 -vf "scale=300:240,unsharp=5:5:1.0:5:5:0.0" -c:a copy -f webm -y '/var/www/html/web/transcoder/video/Racewell-Sheep-Handler/Dagging_300w_240h.webm'
If I run that command, I get this error:
"Rate control parameters set without a bitrate. Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height"
I haven't modified the transcoder.php config file, so it should use the default values.
from craft-transcoder.
The default parameters that are in Transcoder definitely worked at one point for webm -- my guess is that something (whether ffmpeg
itself, or the libvpx
codex) changed in the interim.
The major different I can see between the command that worked, and the one that did not is the audio codec setting: -c:a copy
is used as a default in Transcoder, and your example is explicitly using -c:a libvorbis
from craft-transcoder.
If you remove -bufsize 1000k
, the command throws a different error:
Only VP8 or VP9 or AV1 video and Vorbis or Opus audio and WebVTT subtitles are supported for WebM. Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 --
If you swap -c:a copy
with -c:a libvorbis
or -c:a libopus
the conversion succeeds.
/usr/bin/ffmpeg \
-i '/var/www/html/web/uploads/videos/Racewell-Sheep-Handler/Dagging.mp4' \
-c:v libvpx \
-c:a libvorbis \
-quality good \
-cpu-used 0 \
-threads 0 \
-vf "scale=300:240,unsharp=5:5:1.0:5:5:0.0" \
-f webm \
-y \
'/var/www/html/web/transcoder/video/Racewell-Sheep-Handler/Dagging_300w_240h.webm'
from craft-transcoder.
I tried the command with -bufsize 1000k
and -b:v 2M
, and it worked. Looks like you have to set the target average bitrate for the bufsize flag to work.
I don't know what a reasonable default would be.
https://trac.ffmpeg.org/wiki/Limiting%20the%20output%20bitrate
from craft-transcoder.
Maybe best to just remove the -bufsize
flag entirely then, and let ffmpeg figure it out.
My guess is the reason why copy
doesn't work is the encoding on the audio track is such that isn't supported in webm
somehow.
In any event, glad you got it working!
from craft-transcoder.
It looks like the -bufsize
flag is hardcoded into the FFmpeg command:
Is that something you could remove? Or is there a way I can override it?
from craft-transcoder.
Related Issues (20)
- Need information before I commit to this plugin HOT 6
- Feature request: Store transcoded files in external source HOT 1
- [FR]: Switch all exec calls to proc_open HOT 3
- Transcoder produces an error when using environment variables for the asset volume file system path HOT 3
- Suggestion: Reduce the 'timeInSecs' default for thumbnail options to prevent CP thumbnail errors HOT 2
- Doesn't work :( HOT 5
- [FR] GraphQL Support HOT 9
- timeInSecs of 20 seems to be the only value that works HOT 2
- Transcoder doesn't create thumbs of videos in portrait orientation HOT 2
- Videos not loading HOT 9
- AWS Elemental MediaConvert integration
- Can't get Admin CP Thumbnails generating/showing HOT 19
- [FR] - AWS S3 Storage HOT 3
- Craft 4 support HOT 3
- Feature request: encoding process via queue HOT 1
- Thumbnails stopped working in the CP HOT 1
- Add possibility to check for encoded videos via CURL/HTTP instead of local paths
- Add option to remove audio channel from video file HOT 2
- Craft 5 Support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-transcoder.