Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Recording aac/mp4 audio



  • I can record and play aac/mp4 files with gst-launch like

    gst-launch-1.0 audiotestsrc wave=sine num-buffers=100 ! audioconvert ! faac ! mp4mux ! filesink location=a.mp4
    gst-launch-1.0 filesrc location=a.mp4 ! decodebin ! audioconvert ! pulsesink
    

    But I don't understand how to do the same with Qt
    From QAudioRecorder I can take next supported info

    supported codecs for recorder: 
    ("audio/x-adpcm, layout=(string)dvi", "audio/x-alaw", "audio/mpeg, mpegversion=(int)4", "audio/x-flac", "audio/x-gsm", "audio/mpeg, mpegversion=(int)1, layer=(int)3", "audio/x-mulaw", "audio/x-opus", "audio/x-speex", "audio/mpeg, mpegversion=(int)1, layer=(int)2", "audio/x-vorbis", "audio/AMR", "audio/x-ac3", "audio/x-adpcm, layout=(string)adx", "audio/x-adpcm, layout=(string)quicktime", "audio/x-adpcm, layout=(string)microsoft", "audio/x-adpcm, layout=(string)swf", "audio/x-adpcm, layout=(string)yamaha", "audio/x-alac", "audio/x-dts", "audio/x-eac3", "audio/G722", "audio/x-adpcm, layout=(string)g726", "audio/x-mlp", "audio/x-nellymoser", "audio/x-pn-realaudio, raversion=(int)1", "audio/x-dpcm, layout=(string)roq", "audio/x-smpte-302m", "audio/x-true-hd", "audio/x-tta", "audio/x-wma, wmaversion=(int)1", "audio/x-wma, wmaversion=(int)2", "audio/mpeg, mpegversion=(int)2", "audio/AMR-WB", "audio/x-siren")
    
    supported containers for recorder: 
    ("video/quicktime, variant=(string)3gpp", "audio/x-aiff", "video/x-ms-asf", "video/x-msvideo", "video/x-flv", "video/quicktime, variant=(string)iso-fragmented", "video/x-matroska", "video/x-matroska-3d", "audio/x-matroska", "video/mj2", "video/quicktime, variant=(string)iso", "video/mpeg, mpegversion=(int)2, systemstream=(boolean)true", "video/mpegts, systemstream=(boolean)true", "application/mxf", "application/ogg", "audio/ogg", "video/ogg", "video/quicktime, variant=(string)apple", "video/quicktime", "audio/x-wav", "audio/x-rf64", "video/webm", "audio/webm", "video/quicktime, variant=(string)3g2", "application/x-gst-av-a64", "application/x-gst-av-adx", "audio/x-amr-nb-sh", "application/x-gst-av-apng", "application/x-gst-av-ast", "audio/x-au", "application/x-gst-av-avm2", "application/x-gst-av-bit", "application/x-gst-av-caf", "application/x-gst-av-codec2", "application/x-gst-av-dash", "application/x-gst-av-daud", "video/x-dv, systemstream=(boolean)true", "application/x-gst-av-dvd", "application/x-gst-av-f4v", "application/x-gst-av-film_cpk", "application/x-gst-av-filmstrip", "application/x-gst-av-fits", "application/gxf", "application/x-gst-av-hash", "application/x-gst-av-hds", "application/x-gst-av-hls", "application/x-gst-av-ico", "application/x-gst-av-ilbc", "video/quicktime, variant=(string)ipod", "application/x-gst-av-ircam", "application/x-gst-av-ismv", "video/x-ivf", "application/x-gst-av-latm", "application/x-gst-av-md5", "application/x-gst-av-mkvtimestamp_v2", "application/x-gst-av-mmf", "video/mpeg, systemstream=(boolean)true", "application/x-gst-av-mxf_opatom", "application/x-gst-av-nut", "application/x-gst-av-oga", "application/x-gst-av-ogv", "application/x-gst-av-oma", "application/x-gst-av-opus", "video/quicktime, variant=(string)psp", "application/x-pn-realmedia, systemstream=(boolean)true", "application/x-gst-av-rso", "application/x-gst-av-rtsp", "application/x-gst-av-sap", "application/x-gst-av-singlejpeg", "application/x-gst-av-smjpeg", "application/x-gst-av-smoothstreaming", "application/x-gst-av-sox", "application/x-gst-av-spdif", "application/x-gst-av-spx", "application/x-gst-av-svcd", "application/x-shockwave-flash", "audio/x-ttafile", "application/x-gst-av-uncodedframecrc", "application/x-gst-av-vc1test", "application/x-gst-av-vcd", "application/x-gst-av-vidc", "application/x-gst-av-vob", "audio/x-voc", "application/x-gst-av-w64", "application/x-gst-av-webp", "application/x-gst-av-wtv", "audio/mpeg, mpegversion=(int)1")
    

    I tried various combinations of codec/container but none of them allow me to write what I need. Usually I get next error

    QMediaRecorder::FormatError : Not compatible codecs and container format.
    

    Since Qt uses gstreamer on Linux I believe it has to be possible somehow. Does anyone have any idea?


  • Banned

    This post is deleted!

Log in to reply