Skip to content

Commit

Permalink
Allow to set the libav format to none
Browse files Browse the repository at this point in the history
  • Loading branch information
Lillifee committed Mar 4, 2024
1 parent a931268 commit ce6e8b3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/server/control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ const modeHelper: {
...stream.convert(),
};

stream.read().player === 'Broadway' && (settings.profile = 'baseline');

return {
command: 'libcamera-vid',
settings: {
Expand Down
10 changes: 9 additions & 1 deletion src/shared/settings/stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const streamSettingDesc = {
* Set the libav output format to use. These output formats can be specified as containers (e.g. mkv, mp4, avi)
* or stream output (e.g. h264 or mpegts). If this option is not provided, libav tries to deduce the output format from the filename specified by the -o command line argument.
*/
'libav-format': enumSetting('libav-format', ['h264'], 'h264'),
'libav-format': enumSetting('Libav format', ['none', 'h264'], 'h264'),

/** Player for H264 stream */
player: enumSetting('Player', ['Broadway', 'JMuxer'], 'JMuxer'),
Expand All @@ -72,5 +72,13 @@ export const streamSettingConverter = (
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { player, ...passThroughSettings } = settings;

if (player === 'Broadway') {
passThroughSettings.profile = 'baseline';
}

if (passThroughSettings['libav-format'] === 'none') {
passThroughSettings['libav-format'] = undefined;
}

return passThroughSettings;
};
10 changes: 4 additions & 6 deletions src/site/components/main/settings/StreamSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ export const StreamSettings: React.FC<StreamSettingsProps> = ({ stream, updateSt
<React.Fragment>
<NumberSetting {...stream.bitrate} update={updateStreamField('bitrate')} />
<EnumDropdownSetting {...stream.player} update={updateStreamField('player')} />
{stream.codec.value === 'LIBAV' && (
<EnumDropdownSetting
{...stream['libav-format']}
update={updateStreamField('libav-format')}
/>
)}
<EnumDropdownSetting
{...stream['libav-format']}
update={updateStreamField('libav-format')}
/>
<EnumDropdownSetting {...stream.profile} update={updateStreamField('profile')} />
<EnumDropdownSetting {...stream.level} update={updateStreamField('level')} />
</React.Fragment>
Expand Down

0 comments on commit ce6e8b3

Please sign in to comment.