Click here to Skip to main content
15,569,547 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi, I am trying to convert files from a Chinese manufactured birdbox camera which also has a microphone. The camera records files with the extension .h264 and until recently, the only way I had found to convert them to a format I could play on Windows was using software they supplied (videoconver.exe) to convert to mp4 (video and sound). videoconver lacks any documentation and delivers video which runs at double speed. I also really need a way of batching the conversion of all the files which I am sending to an ftp server.

I then discovered ffmpeg and found I could convert these files using

ffmpeg -r 12 -i atest.h264 -c copy ffatest.mp4

...but only the video comes across. I tried the solution above but the audio extraction doesn't work and I get lots of error messages and no output file. The following shows the command and relevant output:

ffmpeg -i atest.h264 -c:a copy -vn -sn ffatest.m4a

[h264 @ 000002218326ce00] Format h264 detected only with low score of 1, misdetection possible!
[extract_extradata @ 0000022183255b00] Invalid NAL unit 0, skipping.
Last message repeated 4 times
[h264 @ 000002218326dd40] Invalid NAL unit 0, skipping.
Last message repeated 36 times
[h264 @ 000002218326ce00] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, h264, from 'atest.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (Main), yuv420p(progressive), 2288x1288, 24 fps, 24 tbr, 1200k tbn
Output #0, ipod, to 'ffatest.m4a':
Output file #0 does not contain any stream

What I think is going on here is that the format they are using is proprietary (I read somewhere that this could be to avoid licence fees). It definitely contains both video and audio.

Does anyone have any advice on how to convert these files - I suspect that millions of people have these cameras (mine is made or oem'd by Golbong but I suspect others are using this format too judging by a bit of googling).



What I have tried:

Have tried Ffmpeg as above and many other converters as well as vlc and many other video players and editors.
Updated 14-Mar-22 4:55am

You could try to get the RTSP stream directly of the camera using these commands:
Connect to Golbong cameras[^]
These are from the open-source iSpy video surveillance database.

I was going to suggest ONVIF, but this probably will not work either, see:
List Of Manufacturers Faking ONVIF Conformance[^]
Share this answer
MP4 is an audio video container format, H264 is a video stream format with no audio.
To create a audio and video file, you need a container (MP4, MKV, etc.) which holds both and coordinates tham.

I'm not an ffmpeg expert, but I've used it a fair amount and foudn biost taht worked for me.
ffmpeg can extract streams from a file, and the -c switch tells it which stream type to extract: -c:a is audio, -c:v is video.
Once extracted, they can be combined into a MP4 file very easily:
Extract Audio stream:
ffmpeg -i GoodAudioInput.mp4 -c:a copy -vn -sn audio.m4a

Extract Video stream:
ffmpeg -i GoodVideoInput.mp4 -c:v copy -sn -an video.mp4

Merge the two:
ffmpeg -i video.mp4 -i audio.m4a -c:v copy -c:a aac -strict experimental merged.mp4
The -c:a aac -strict experimental part is to convert the audio to AAC and "magic stuff" that worked when I needed it to and I haven't experimented further to find out if I don't need it any more ...

If that doesn't do it, you probably need to visit an ffmpeg site, or talk to the camera manufacturer - this is a software development site, so you are lucky that anyone has a real clue about what you are doing!
Share this answer
You could try videotovideo or shutterendcoder - I believe they are like frontend gui to FFmpeg

I found videotovideo when trying to convert jvc mts file to a different format.

And shutterendcoder when videotovideo couldn't cater for h265 - a codec used by cctv.

Video to Video Converter - truly free video converter - convert to MP4, AVI, MKV, MOV, M2TS, TS, 3GP,WMV...[^]
Shutter Encoder encoding|converting video FREE PC|Mac[^]
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900