The film, released on Monday, shows militants standing behind the two men who are on their knees, their hands tied behind their backs, with one man standing over them, holding a knife.
One of the men is made to tell the camera that they had been paid by authorities to spy on the militant group, before the film moves to another scene showing their decapitated bodies. It was not possible to confirm the film’s authenticity or date.
The footage will stoke concerns that Boko Haram, which evolved out of a clerical movement focused on northeast Nigeria, is expanding its scope and seeking inspiration from global militant networks including al Qaeda and Islamic State.
The militants who have killed thousands and kidnapped hundreds in their bid to carve out an Islamist state, have in recent months stepped up cross-border raids into Cameroon, Chad and Niger.
President Goodluck Jonathan has said Boko Haram is allied to both al Qaeda and its offshoot Islamic State, though that has not been confirmed by the group itself.
The Boko Haram film’s use of graphics, the footage of black-clad militants with a black flag, and the editing to show only the aftermath of the beheading, were particularly reminiscent of footage from Islamic state, which has seized large parts of Iraq and Syria and killed several hostages.
In the film, one of the men says he comes from Baga in Borno State, and the other says he is from Michika in Adamawa State, both areas where the army says it has recently recaptured territory from Boko Haram.
Past Boko Haram films have been much cruder affairs, often featuring a man identified as leader Abubakar Shekau talking more about local gripes than global jihad. A number of recent releases have included much more gruesome footage of beheadings.