how to change the default bitrate for video encoding
Where can I find the default bitrate for video encoding so I can change it? Because when I add video_bitrate option in ffmpeg options, it causes the video encoding to fail. The default 512k is making the 2160p videos distorted.
-
- · Baloo
- ·
Hello, in table sys_transcoder_filters I see this, then the bitrate would be 480?
('bx_albums_video_poster_big', 'Poster', 'a:2:{s:1:\"h\";s:3:\"480\";s:10:\"force_type\";s:3:\"jpg\";}', 0),
('bx_albums_video_mp4', 'Mp4', 'a:2:{s:1:\"h\";s:3:\"480\";s:10:\"force_type\";s:3:\"mp4\";}', 0),
('bx_albums_video_webm', 'Webm', 'a:2:{s:1:\"h\";s:3:\"480\";s:10:\"force_type\";s:4:\"webm\";}', 0), -
- · Genesis
- ·
The 480 is the resolution. Like 1080p or 4k. The default bitrate in UNA is 512kbps so if I change the 480p to something bigger, the videos will look more distorted instead of turning into beautifully clear 4k movies.
In a previous post, Alex T⚜️ told me to use the code below, but the video_bitrate option is making the encoding for mp4 videos fail so I need to change the default bitrate in all of UNA so I don't need to use the video_bitrate option.
a:3:{s:1:"h";s:4:"2160";s:10:"force_type";s:3:"mp4";s:14:"ffmpeg_options";a:2:{s:7:"threads";i:4;s:13:"video_bitrate";s:5:"2048k";}}
EDIT: Here is the previous post => https://una.io/page/view-discussion?id=1627
-
-
-
- · Genesis
-
·
In reply to LeonidS
- ·
I tried all that but this line is making the videos fail to encode:
'video_bitrate' => '128k',
Where can I find the default bitrate in the UNA system itself without using this serialized transcoder filter so I can change the default bitrate for everything.
-
- · Genesis
-
·
In reply to LeonidS
- ·
Ok I'm crazy. I found it in /inc/classes/BxDolTranscoderVideo.php. Is this the only code that I need to change to raise the 512 bitrate?
Lines 156 -168:
protected function applyFilter_Mp4 ($sFile, $aParams)
{
return $this->_convertVideo($sFile, $sFile, '.mp4', $aParams, array (
'strict' => 'experimental',
'vcodec' => 'libx264',
's' => $this->_getOptionSizeForVideo ($sFile, $aParams),
'b:v' => isset($aParams['video_bitrate']) ? $aParams['video_bitrate'] . 'k' : '512k',
'movflags' => '+faststart',
'acodec' => 'aac',
'ar' => '44100',
'b:a' => isset($aParams['audio_bitrate']) ? $aParams['audio_bitrate'] . 'k' : '128k',
));
}
-
- · Mark Dent
- ·
When I upload a video it does work , just displays three large white dots? thoughts?
-
-
·
LeonidS
-
·
In reply to Mark Dent
- ·
Hi Mark!
First of all, it is necessary to check if your Cron Jobs work, it can be done via Studio->Dashboard->Server Audit, the line Last Cron Jobs launch. So this time should be very very recent, almost right now.
-
·
LeonidS
-
- · Mark Dent
- ·
Hi, yes it is
-
- · Mark Dent
- ·
That all it displays
-
- · Baloo
-
·
In reply to Genesis
- ·
So in the end did you get good results, if so, what settings did you change?
-
- · Genesis
-
·
In reply to Baloo
- ·
4k is too much for streaming so I used 1080p. I changed 512k to 4000k and then I updated the database with:
Serialized MySQL query:
UPDATE `sys_transcoder_filters`
SET `filter_params` = 'a:3:{s:1:"h";s:4:"1080";s:10:"force_type";s:3:"mp4";s:14:"ffmpeg_options";a:1:{s:7:"threads";i:14;}}'
WHERE `transcoder_object` = 'bx_videos_video_mp4' AND `filter` = 'Mp4';
Unserialized MySQL query:
array (
'h' => '1080',
'force_type' => 'mp4',
'ffmpeg_options' =>
array (
'threads' => 14,
),
);
-
- · Baloo
-
·
In reply to Genesis
- ·
Thank you