recording H264 : How to merge audio + video ?

430 views
Skip to first unread message

yarek chmielewski

unread,
Dec 3, 2018, 10:13:45 AM12/3/18
to meetecho-janus
My feeds are using h264 and recording seems ok

/opt/janus/bin/janus-pp-rec $dir/$filename-video.mjr $dir/$filename.mp4 : gives me a mp4 file
/opt/janus/bin/janus-pp-rec $dir/$filename-audio.mjr $dir/$filename.mp3 : gives me a mp3 file




My recording are >20 seconds

However merging audio + video with a simple command:

ffmpeg -i video.mp4 -i audio.mp3 output.mp4

Gives error

 Missing key frame while reordering index according to edit list
Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 640x480, 130 kb/s): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' options


Unable to parse option value "-1" as pixel format
Error setting option pix_fmt to value -1.

Error applying options to the filter.


This does not happen with webm and opus (when recording is vp8)
Any idea ?



Mayank Aggarwal

unread,
Dec 3, 2018, 2:16:50 PM12/3/18
to yar...@gmail.com, meetech...@googlegroups.com
Hi,

Is it mandatory to convert audio to .mp3 format? Don't convert the audio mjr file to .mp3. Instead convert it .opus and then try merging to form .mp4 file.

-Mayank

--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

yarek chmielewski

unread,
Dec 3, 2018, 2:46:53 PM12/3/18
to meetecho-janus
1) yes it is mandatory: you cannot merge mp4 and opus

2) problem comes from the MP4 : I cannot extract neither a JPEG thumb from it: I got exactly the same error
 ffmpeg -y -i "yarek.mp4" -ss "1" -vframes 1 -q:v 2 output.jpg

gives : 
[buffer @ 0x55739bd36420] Unable to parse option value "-1" as pixel format
    Last message repeated 1 times
[buffer @ 0x55739bd36420] Error setting option pix_fmt to value -1.
[graph 0 input from stream 0:0 @ 0x55739bd15d60] Error applying options to the filter.
Error opening filters!

Mayank Aggarwal

unread,
Dec 4, 2018, 4:43:16 PM12/4/18
to yar...@gmail.com, meetech...@googlegroups.com
Adding Janus group.

-Mayank

On Mon, Dec 3, 2018 at 3:55 PM Mayank Aggarwal <maggarwal....@gmail.com> wrote:
Hi,

I tried merging .opus and .mp4 to form a mp4 file and it works for me. Just set the audio codec in the video room as opus and video codec as h264. Then convert mjr files to .mp4 and .opus and use them to form .mp4. I tried it and it works for me.

I used your command - ffmpeg -i video.mp4 -i audio.mp3 output.mp4

-Mayank
Reply all
Reply to author
Forward
0 new messages