Problems during recording live shows
  • First of all hello to everyone and congratulations on the excellent work done by Dev Team of AirTime, and to the community members.

    After installing a troubled... i managed to get everything working on a vps.... but i'm having a problem in the recording of live shows.
    I used this little hack hoping that everything was working smoothly: Simple method for recording and broadcasting simultaneously. Sound card not necessarily required.

    But you can see from the logs that the recording is not saved in the library because the file is corrupted (sorry if almost everything is localized in Italian):



    2016-01-27 12:17:00,017 INFO - [recorder.py : record_show() : line 102] - starting record
    2016-01-27 12:17:00,017 INFO - [recorder.py : record_show() : line 103] - command /usr/bin/sox -t ogg http://localhost:8000/recording -C6 /var/tmp/airtime/show-recorder/2016-01-27-12:17:00.ogg trim 0 180
    2016-01-27 12:19:58,173 INFO - [recorder.py : record_show() : line 115] - finishing record, return code 0
    2016-01-27 12:19:58,174 INFO - [recorder.py : run() : line 177] - Preparing to upload /var/tmp/airtime/show-recorder/2016-01-27-12:17:00.ogg
    2016-01-27 12:19:58,175 INFO - [recorder.py : set_metadata_and_save() : line 154] - time: 12:17:00
    2016-01-27 12:19:58,248 DEBUG - [api_client.py : upload_recorded_show() : line 273] - http://localhost:80/api/upload-file/format/json/api_key/15CV20ZQSG08DTSEL4S4
    2016-01-27 12:19:58,248 DEBUG - [api_client.py : upload_recorded_show() : line 276] - Upload attempt: 1
    2016-01-27 12:19:58,752 INFO - [api_client.py : upload_recorded_show() : line 282] - uploaded show result {"jsonrpc":"2.0","error":{"code":110,"message":"Il file risulta corrotto e non sar\u00c3  aggiunto nella biblioteca."}}



    The mod:
            ......
            ss = config["record_sample_size"]

            #-f:16,2,44100
            #-b:256
            #command = "ecasound -f:%s,%s,%s -i alsa -o %s,%s000 -t:%s" % \
            #                        (ss, c, sr, filepath, br, length)

            #command = "/usr/local/bin/ripstream.sh http://vmi59743.contabo.host:8000/recording %s %s" % (length,filepath)
            #command = "streamripper http://vmi59743.contabo.host:8000/recording -s -A -a %s -l %s" % (filepath,length)

            command = "/usr/bin/sox -t ogg http://vmi59743.contabo.host:8000/recording -C6 %s trim 0 %s" % \
                                    (filepath, length)


            args = command.split(" ")
            ......

    The folder permissions:

    # ls -lh /var/tmp/airtime/
    total 16K
    drwxr-xr-x  2 root root 4.0K Jan  8 21:49 media-monitor
    drwxr-xr-x  6 pypo pypo 4.0K Jan  9 11:57 pypo
    drwxr-xr-x 18 root root 4.0K Jan 26 23:40 rips
    drwxr-xr-x  2 pypo pypo 4.0K Jan 27 12:19 show-recorder

    # ls -lh /var/tmp/airtime/show-recorder/
    total 1.7M
    -rw-r--r-- 1 root root 1.7M Jan 27 00:18 2016-01-26-23:50:00.ogg

    # ls -lh /srv/airtime/stor/
    total 16K
    drwxr-sr-x 13 www-data www-data 4.0K Jan  9 10:12 imported
    drwxrwxr-x  2 www-data www-data 4.0K Jan 20 13:24 organize
    drwxr-sr-x  2 www-data www-data 4.0K Jan  8 21:49 problem_files
    drwxr-sr-x  2 www-data www-data 4.0K Jan 26 23:30 recorded


    Maybe it's just a question of folder permissions
  • 3 Comments sorted by
  • UPDATE: The file while recording is created and it seems correct



    # soxi /var/tmp/airtime/show-recorder/2016-01-27-13\:50\:00.ogg

    Input File     : '2016-01-27-13:50:00.ogg'
    Channels       : 2
    Sample Rate    : 44100
    Precision      : 16-bit
    Duration       : 00:01:50.48 = 4872384 samples = 8286.37 CDDA sectors
    File Size      : 1.79M
    Bit Rate       : 130k
    Sample Encoding: Vorbis
    Comments       :
    TITLE=Unknown
    ENCODER=Liquidsoap/1.1.1 (Unix; OCaml 4.01.0)

  • I created a Airtime output stream in mp3:

    http://vmi59743.contabo.host:8000/recording

    I have installed the mp3 handler for sox:


    aptitude install libsox-fmt-all

    I edited my record command to:

    command = "/usr/bin/sox -t mp3 http://vmi59743.contabo.host:8000/recording -C6 -t mp3 %s trim 0 %s" % \
                                    (filepath, length)

    But i still do not have any new files in the library, even if the temporary file is created and deleted immediately after the end of the show

    Log:

    2016-01-27 15:15:00,014 INFO - [recorder.py : record_show() : line 102] - starting record
    2016-01-27 15:15:00,015 INFO - [recorder.py : record_show() : line 103] - command /usr/bin/sox -t mp3 http://vmi59743.contabo.host:8000/recording -C6 -t mp3 /var/tmp/airtime/show-recorder/2016-01-27-15:15:00.mp3 trim 0 300
    2016-01-27 15:19:58,602 INFO - [recorder.py : record_show() : line 115] - finishing record, return code 0
    2016-01-27 15:19:58,604 INFO - [recorder.py : run() : line 177] - Preparing to upload /var/tmp/airtime/show-recorder/2016-01-27-15:15:00.mp3
    2016-01-27 15:19:58,604 INFO - [recorder.py : set_metadata_and_save() : line 154] - time: 15:15:00
    2016-01-27 15:19:58,661 DEBUG - [api_client.py : upload_recorded_show() : line 273] - http://vmi59743.contabo.host:80/api/upload-file/format/json/api_key/15CV20ZQSG08DTSEL4S4
    2016-01-27 15:19:58,661 DEBUG - [api_client.py : upload_recorded_show() : line 276] - Upload attempt: 1
    2016-01-27 15:19:59,072 INFO - [api_client.py : upload_recorded_show() : line 282] - uploaded show result []
  • SOLVED