sout.cpp 15.9 KB
Newer Older
zorglub's avatar
zorglub committed
1
/*****************************************************************************
2
 * sout.cpp : Stream output dialog ( old-style )
zorglub's avatar
zorglub committed
3
 ****************************************************************************
4
 * Copyright ( C ) 2006 the VideoLAN team
5
 * $Id$
zorglub's avatar
zorglub committed
6
7
 *
 * Authors: Clément Stenac <zorglub@videolan.org>
8
9
 *          Jean-Baptiste Kempf <jb@videolan.org>
 *          Jean-François Massol <jf.massol -at- gmail.com>
zorglub's avatar
zorglub committed
10
11
12
13
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
14
 * ( at your option ) any later version.
zorglub's avatar
zorglub committed
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#include "dialogs/sout.hpp"
#include "qt4.hpp"
#include <vlc_streaming.h>

30
31
#include <iostream>
#include <QString>
zorglub's avatar
zorglub committed
32
33
#include <QFileDialog>

34
35
SoutDialog::SoutDialog( QWidget *parent, intf_thread_t *_p_intf,
                     bool _transcode_only ) : QVLCDialog( parent,  _p_intf )
zorglub's avatar
zorglub committed
36
{
37
    setWindowTitle( qtr( "Stream output" ) );
38

39
40
    b_transcode_only = _transcode_only;

zorglub's avatar
zorglub committed
41
    /* UI stuff */
42
    ui.setupUi( this );
43

44
45
    ui.UDPEdit->hide(); ui.UDPLabel->hide();
    ui.UDPPort->hide(); ui.UDPPortLabel->hide();
46
47
48
49
50
51
52
53
/* ADD HERE for new profiles */
#define ADD_PROFILE( name, shortname ) ui.profileBox->addItem( qtr( name ), QVariant( QString( shortname ) ) );
    ADD_PROFILE( "Custom" , "Custom" )
    ADD_PROFILE( "IPod (mp4/aac)", "IPod" )
    ADD_PROFILE( "XBox", "XBox" )
    ADD_PROFILE( "Windows (wmv/asf)", "Windows" )
    ADD_PROFILE( "PSP", "PSP")
    ADD_PROFILE( "GSM", "GSM" )
54

55
#define ADD_VCODEC( name, fourcc ) ui.vCodecBox->addItem( name, QVariant( fourcc ) );
56
57
58
59
60
61
62
63
64
65
66
67
68
    ADD_VCODEC( "MPEG-1", "mp1v" )
    ADD_VCODEC( "MPEG-2", "mp2v" )
    ADD_VCODEC( "MPEG-4", "mp4v" )
    ADD_VCODEC( "DIVX 1" , "DIV1" )
    ADD_VCODEC( "DIVX 2" , "DIV1" )
    ADD_VCODEC( "DIVX 3" , "DIV1" )
    ADD_VCODEC( "H-263", "H263" )
    ADD_VCODEC( "H-264", "h264" )
    ADD_VCODEC( "WMV1", "WMV1" )
    ADD_VCODEC( "WMV2" , "WMV2" )
    ADD_VCODEC( "M-JPEG", "MJPG" )
    ADD_VCODEC( "Theora", "theo" )

69
#define ADD_ACODEC( name, fourcc ) ui.aCodecBox->addItem( name, QVariant( fourcc ) );
70
71
    ADD_ACODEC( "MPEG Audio", "mpga" )
    ADD_ACODEC( "MP3", "mp3" )
72
73
    ADD_ACODEC( "MPEG 4 Audio ( AAC )", "mp4a" )
    ADD_ACODEC( "A52/AC-3", "a52" )
74
75
76
77
78
79
    ADD_ACODEC( "Vorbis", "vorb" )
    ADD_ACODEC( "Flac", "flac" )
    ADD_ACODEC( "Speex", "spx" )
    ADD_ACODEC( "WAV", "s16l" )
    ADD_ACODEC( "WMA", "wma" )

80
#define ADD_SCALING( factor ) ui.vScaleBox->addItem( factor );
81
82
83
84
85
86
87
88
89
    ADD_SCALING( "0.25" )
    ADD_SCALING( "0.5" )
    ADD_SCALING( "0.75" )
    ADD_SCALING( "1" )
    ADD_SCALING( "1.25" )
    ADD_SCALING( "1.5" )
    ADD_SCALING( "1.75" )
    ADD_SCALING( "2" )

90
91
    ui.mrlEdit->setToolTip ( qtr( "Stream output string.\n This is automatically generated "
                                                "when you change the above settings,\n but you can update it manually." ) ) ;
92
93

//     /* Connect everything to the updateMRL function */
94
 #define CB( x ) CONNECT( ui.x, toggled( bool ), this, updateMRL() );
95
96
97
 #define CT( x ) CONNECT( ui.x, textChanged( const QString ), this, updateMRL() );
 #define CS( x ) CONNECT( ui.x, valueChanged( int ), this, updateMRL() );
 #define CC( x ) CONNECT( ui.x, currentIndexChanged( int ), this, updateMRL() );
98
99
//     /* Output */
     CB( fileOutput ); CB( HTTPOutput ); CB( localOutput );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
100
101
102
     CB( RTPOutput ); CB( MMSHOutput ); CB( rawInput ); CB( UDPOutput );
     CT( fileEdit ); CT( HTTPEdit ); CT( RTPEdit ); CT( MMSHEdit ); CT( UDPEdit );
     CS( HTTPPort ); CS( RTPPort ); CS( MMSHPort ); CS( UDPPort );
103
//     /* Transcode */
104
105
     CC( vCodecBox ); CC( subsCodecBox ); CC( aCodecBox ) ;
     CB( transcodeVideo ); CB( transcodeAudio ); CB( transcodeSubs );
106
//     CB( sOverlay );
107
     CS( vBitrateSpin ); CS( aBitrateSpin ); CS( aChannelsSpin ); CC( vScaleBox );
108
109
110
111
112
//     /* Mux */
     CB( PSMux ); CB( TSMux ); CB( MPEG1Mux ); CB( OggMux ); CB( ASFMux );
     CB( MP4Mux ); CB( MOVMux ); CB( WAVMux ); CB( RAWMux ); CB( FLVMux );
//     /* Misc */
     CB( soutAll ); CS( ttl ); CT( sapName ); CT( sapGroup );
113
//
114
115
116
117
118
119
    CONNECT( ui.profileBox, activated( const QString & ), this, setOptions() );
    CONNECT( ui.fileSelectButton, clicked() , this, fileBrowse()  );
    CONNECT( ui.transcodeVideo, toggled( bool ), this, setVTranscodeOptions( bool ) );
    CONNECT( ui.transcodeAudio, toggled( bool ), this, setATranscodeOptions( bool ) );
    CONNECT( ui.transcodeSubs, toggled( bool ), this, setSTranscodeOptions( bool ) );
    CONNECT( ui.rawInput, toggled( bool ), this, setRawOptions( bool ) );
zorglub's avatar
zorglub committed
120

121
    okButton = new QPushButton( qtr( "&Stream" ) );
122
123
124
125
126
127
    QPushButton *cancelButton = new QPushButton( qtr( "&Cancel" ) );

    okButton->setDefault( true );
    ui.acceptButtonBox->addButton( okButton, QDialogButtonBox::AcceptRole );
    ui.acceptButtonBox->addButton( cancelButton, QDialogButtonBox::RejectRole );

128
129
    BUTTONACT( okButton, ok() );
    BUTTONACT( cancelButton, cancel() );
130

131
    if( b_transcode_only ) toggleSout();
zorglub's avatar
zorglub committed
132
133
}

134
135
136
137
138
QString SoutDialog::getMrl()
{
    return this->mrl;
}

zorglub's avatar
zorglub committed
139
void SoutDialog::fileBrowse()
140
141
{
    ui.tabWidget->setTabEnabled( 0,false );
142
143
144
    QString fileName = QFileDialog::getOpenFileName( this, qtr( "Save file" ), "",
        qtr( "Containers (*.ps *.ts *.mpg *.ogg *.asf *.mp4 *.mov *.wav *.raw *.flv)" ) );
    ui.fileEdit->setText( fileName );
zorglub's avatar
zorglub committed
145
146
147
    updateMRL();
}

148
void SoutDialog::setVTranscodeOptions( bool b_trans )
149
{
150
151
152
153
    ui.vCodecLabel->setEnabled( b_trans );
    ui.vCodecBox->setEnabled( b_trans );
    ui.vBitrateLabel->setEnabled( b_trans );
    ui.vBitrateSpin->setEnabled( b_trans );
154
    ui.vScaleLabel->setEnabled( b_trans );
155
    ui.vScaleBox->setEnabled( b_trans );
156
157
}

158
void SoutDialog::setATranscodeOptions( bool b_trans )
159
{
160
161
162
163
164
165
    ui.aCodecLabel->setEnabled( b_trans );
    ui.aCodecBox->setEnabled( b_trans );
    ui.aBitrateLabel->setEnabled( b_trans );
    ui.aBitrateSpin->setEnabled( b_trans );
    ui.aChannelsLabel->setEnabled( b_trans );
    ui.aChannelsSpin->setEnabled( b_trans );
166
167
}

168
void SoutDialog::setSTranscodeOptions( bool b_trans )
169
{
170
171
    ui.subsCodecBox->setEnabled( b_trans );
    ui.subsOverlay->setEnabled( b_trans );
172
173
}

174
void SoutDialog::setRawOptions( bool b_raw )
175
{
176
177
178
179
180
181
182
183
    if ( b_raw )
    {
        ui.tabWidget->setDisabled( true );
    }
    else
    {
        SoutDialog::setOptions();
    }
184
185
}

186
int indexFromItemData( QComboBox *aCombo, QString aString )
187
{
188
    for( int i=0; i < aCombo->count(); i++ )
189
    {
190
        if( aCombo->itemData( i ).toString() == aString ) return i;
191
    }
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
    return -1;
}

void SoutDialog::setOptions()
{
    QString profileString = ui.profileBox->itemData( ui.profileBox->currentIndex() ).toString();
    msg_Dbg( p_intf, "Profile Used: %s",  qta( profileString ));
    int index;

#define setProfile( muxName, hasVideo, vCodecName, hasAudio, aCodecName ) \
    { \
        ui.muxName ##Mux->setChecked( true ); \
        \
        ui.transcodeAudio->setChecked( hasAudio ); \
        index = indexFromItemData( ui.aCodecBox, vCodecName );  \
        if( index >= 0 ) ui.aCodecBox->setCurrentIndex( index ); \
        \
        ui.transcodeVideo->setChecked( hasVideo ); \
        index = indexFromItemData( ui.aCodecBox, vCodecName );  \
        if( index >=0 ) ui.vCodecBox->setCurrentIndex( index ); \
212
    }
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229

    /* ADD HERE the profiles you want and need */
    if( profileString == "IPod" ) setProfile( MP4, true, "mp4a", true, "mp4v" )
    else if( profileString == "XBox" ) setProfile( ASF, true, "wma", true, "WMV2" )

        /* If the profile is not a custom one, then disable the tabWidget */
        if ( profileString == "Custom" )
        {
            ui.tabWidget->setEnabled( true );
        }
        else
        {
            ui.tabWidget->setDisabled( true );
        }

    /* Update the MRL !! */
    updateMRL();
230
231
}

232
233
void SoutDialog::toggleSout()
{
234
    //Toggle all the streaming options.
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
235
236
237
238
239
    TOGGLEV( ui.HTTPOutput ) ; TOGGLEV( ui.RTPOutput ) ; TOGGLEV( ui.MMSHOutput ) ; TOGGLEV( ui.UDPOutput ) ;
    TOGGLEV( ui.HTTPEdit ) ; TOGGLEV( ui.RTPEdit ) ; TOGGLEV( ui.MMSHEdit ) ; TOGGLEV( ui.UDPEdit ) ;
    TOGGLEV( ui.HTTPLabel ) ; TOGGLEV( ui.RTPLabel ) ; TOGGLEV( ui.MMSHLabel ) ; TOGGLEV( ui.UDPLabel ) ;
    TOGGLEV( ui.HTTPPortLabel ) ; TOGGLEV( ui.RTPPortLabel ) ; TOGGLEV( ui.MMSHPortLabel ) ; TOGGLEV( ui.UDPPortLabel )
    TOGGLEV( ui.HTTPPort ) ; TOGGLEV( ui.RTPPort ) ; TOGGLEV( ui.MMSHPort ) ; TOGGLEV( ui.UDPPort ) ;
240
241
242
243

    TOGGLEV( ui.sap ); TOGGLEV( ui.sapName );
    TOGGLEV( ui.sapGroup ); TOGGLEV( ui.sapGroupLabel );
    TOGGLEV( ui.ttlLabel ); TOGGLEV( ui.ttl );
244
245
246
247

    if( b_transcode_only ) okButton->setText( "&Save" );
    else okButton->setText( "&Stream" );

248
    updateGeometry();
249
250
}

zorglub's avatar
zorglub committed
251
252
void SoutDialog::ok()
{
zorglub's avatar
zorglub committed
253
254
    mrl = ui.mrlEdit->text();
    accept();
zorglub's avatar
zorglub committed
255
256
257
}
void SoutDialog::cancel()
{
zorglub's avatar
zorglub committed
258
259
    mrl = ui.mrlEdit->text();
    reject();
zorglub's avatar
zorglub committed
260
261
262
263
}

void SoutDialog::updateMRL()
{
264
265
    sout_gui_descr_t sout;
    memset( &sout, 0, sizeof( sout_gui_descr_t ) );
266
    int counter = 0;
267
268
269
270
271

    sout.b_local = ui.localOutput->isChecked();
    sout.b_file = ui.fileOutput->isChecked();
    sout.b_http = ui.HTTPOutput->isChecked();
    sout.b_mms = ui.MMSHOutput->isChecked();
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
272
    sout.b_rtp = ui.RTPOutput->isChecked();
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
273
    sout.b_udp = ui.UDPOutput->isChecked();
274
275
    sout.b_sap = ui.sap->isChecked();
    sout.b_all_es = ui.soutAll->isChecked();
276
277
278
    sout.psz_vcodec = strdup( qtu( ui.vCodecBox->itemData( ui.vCodecBox->currentIndex() ).toString() ) );
    sout.psz_acodec = strdup( qtu( ui.aCodecBox->itemData( ui.aCodecBox->currentIndex() ).toString() ) );
    sout.psz_scodec = strdup( qtu( ui.subsCodecBox->itemData( ui.subsCodecBox->currentIndex() ).toString() ) );
279
280
281
    sout.psz_file = strdup( qtu( ui.fileEdit->text() ) );
    sout.psz_http = strdup( qtu( ui.HTTPEdit->text() ) );
    sout.psz_mms = strdup( qtu( ui.MMSHEdit->text() ) );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
282
    sout.psz_rtp = strdup( qtu( ui.RTPEdit->text() ) );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
283
    sout.psz_udp = strdup( qtu( ui.UDPEdit->text() ) );
284
285
    sout.i_http = ui.HTTPPort->value();
    sout.i_mms = ui.MMSHPort->value();
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
286
    sout.i_rtp = ui.RTPPort->value();
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
287
    sout.i_udp = ui.UDPPort->value();
288
289
290
291
    sout.i_ab = ui.aBitrateSpin->value();
    sout.i_vb = ui.vBitrateSpin->value();
    sout.i_channels = ui.aChannelsSpin->value();
    sout.f_scale = atof( qta( ui.vScaleBox->currentText() ) );
292
293
294
    sout.psz_group = strdup( qtu( ui.sapGroup->text() ) );
    sout.psz_name = strdup( qtu( ui.sapName->text() ) );

295
#define COUNT() \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
296
297
    { \
        if ( sout.b_local ) \
298
        counter += 1; \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
299
        if ( sout.b_file ) \
300
        counter += 1; \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
301
        if ( sout.b_http ) \
302
        counter += 1; \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
303
        if ( sout.b_mms ) \
304
        counter += 1; \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
305
        if ( sout.b_rtp ) \
306
        counter += 1; \
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
307
308
309
        if ( sout.b_udp ) \
        counter += 1; \
    }
310
311
312

COUNT()

313
#define SMUX( x, txt ) if( ui.x->isChecked() ) sout.psz_mux = strdup( txt );
314
315
316
317
318
319
320
321
322
323
    SMUX( PSMux, "ps" );
    SMUX( TSMux, "ts" );
    SMUX( MPEG1Mux, "mpeg" );
    SMUX( OggMux, "ogg" );
    SMUX( ASFMux, "asf" );
    SMUX( MP4Mux, "mp4" );
    SMUX( MOVMux, "mov" );
    SMUX( WAVMux, "wav" );
    SMUX( RAWMux, "raw" );
    SMUX( FLVMux, "flv" );
324
325
326
327

    bool trans = false;
    bool more = false;

328
    if ( ui.transcodeVideo->isChecked() || ui.transcodeAudio->isChecked() )
329
    {
330
        if ( ui.transcodeVideo->isChecked() )
331
        {
332
333
334
335
336
337
            mrl = ":sout=#transcode{";
            mrl.append( "vcodec=" );
            mrl.append( sout.psz_vcodec );
            mrl.append( "," );
            mrl.append( "vb=" );
            mrl.append( QString::number( sout.i_vb,10 ) );
338
            mrl.append( "," );
339
340
341
            mrl.append( "scale=" );
            mrl.append( QString::number( sout.f_scale ) );
            trans = true;
342
        }
343
344

        if ( ui.transcodeAudio->isChecked() )
345
        {
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
            if ( trans )
            {
                mrl.append( "," );
            }
            else
            {
                mrl = ":sout=#transcode{";
            }
            mrl.append( "acodec=" );
            mrl.append( sout.psz_acodec );
            mrl.append( "," );
            mrl.append( "ab=" );
            mrl.append( QString::number( sout.i_ab,10 ) );
            mrl.append( "," );
            mrl.append( "channels=" );
            mrl.append( QString::number( sout.i_channels,10 ) );
            trans = true;
363
        }
364
        mrl.append( "}" );
365
    }
366

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
367
    if ( sout.b_local || sout.b_file || sout.b_http || sout.b_mms || sout.b_rtp || sout.b_udp )
368
369
370
371
    {

#define ISMORE() if ( more ) mrl.append( "," );

372
373
374
375
#define ATLEASTONE() \
        if ( counter > 1 ) \
        { \
            mrl.append( "dst=" ); \
376
        }
377

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
378
379
380
381
382
383

        if ( trans )
        {
            mrl.append( ":" );
        }
        else
384
385
386
387
        {
            mrl = ":sout=#";
        }

388
389
390
391
392
        if ( counter > 1 )
        {
            mrl.append( "duplicate{" );
        }

393
394
395
        if ( sout.b_local )
        {
            ISMORE();
396
            ATLEASTONE()
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
397
                mrl.append( "display" );
398
399
400
401
402
403
            more = true;
        }

        if ( sout.b_file )
        {
            ISMORE();
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
404
405
            ATLEASTONE()
                mrl.append( "std{access=file,mux=" );
406
407
408
409
410
411
412
413
414
415
            mrl.append( sout.psz_mux );
            mrl.append( ",dst=" );
            mrl.append( sout.psz_file );
            mrl.append( "}" );
            more = true;
        }

        if ( sout.b_http )
        {
            ISMORE();
416
            ATLEASTONE()
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
417
                mrl.append( "std{access=http,mux=" );
418
419
420
421
422
423
424
425
426
427
428
429
            mrl.append( sout.psz_mux );
            mrl.append( ",dst=" );
            mrl.append( sout.psz_http );
            mrl.append( ":" );
            mrl.append( QString::number( sout.i_http,10 ) );
            mrl.append( "}" );
            more = true;
        }

        if ( sout.b_mms )
        {
            ISMORE();
430
            ATLEASTONE()
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
431
                mrl.append( "std{access=mmsh,mux=" );
432
433
434
435
436
437
438
439
440
            mrl.append( sout.psz_mux );
            mrl.append( ",dst=" );
            mrl.append( sout.psz_mms );
            mrl.append( ":" );
            mrl.append( QString::number( sout.i_mms,10 ) );
            mrl.append( "}" );
            more = true;
        }

Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
441
        if ( sout.b_rtp )
442
443
        {
            ISMORE();
444
            ATLEASTONE()
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
445
                mrl.append( "rtp{mux=" );
446
447
            mrl.append( sout.psz_mux );
            mrl.append( ",dst=" );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
448
            mrl.append( sout.psz_rtp );
449
            mrl.append( ":" );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
450
            mrl.append( QString::number( sout.i_rtp,10 ) );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
451
452
453
454
455
456
457
458
459
460
461
462
463
464
            mrl.append( "}" );
            more = true;
        }

        if ( sout.b_udp )
        {
            ISMORE();
            ATLEASTONE()
            mrl.append( "std{access=udp,mux=" );
            mrl.append( sout.psz_mux );
            mrl.append( ",dst=" );
            mrl.append( sout.psz_udp );
            mrl.append( ":" );
            mrl.append( QString::number( sout.i_udp,10 ) );
465
466
467
468
469
470
471
472
473
474
475
476
477
478
            if ( sout.b_sap )
            {
                mrl.append( ",sap," );
                mrl.append( "group=\"" );
                mrl.append( sout.psz_group );
                mrl.append( "\"," );
                mrl.append( "name=\"" );
                mrl.append( sout.psz_name );
                mrl.append( "\"" );
            }
            mrl.append( "}" );
            more = true;
        }

479
        if ( counter > 1 )
480
481
482
483
484
485
        {
            mrl.append( "}" );
        }
    }

    if ( sout.b_all_es )
486
        mrl.append( ":sout-all" );
487
488
489
490

    ui.mrlEdit->setText( mrl );
    free( sout.psz_acodec ); free( sout.psz_vcodec ); free( sout.psz_scodec );
    free( sout.psz_file );free( sout.psz_http ); free( sout.psz_mms );
Jean-Baptiste Kempf's avatar
Jean-Baptiste Kempf committed
491
    free( sout.psz_rtp ); free( sout.psz_udp ); free( sout.psz_mux );
492
    free( sout.psz_name ); free( sout.psz_group );
493
}