1

I have a video file (with no audio stream) taken from a Lorex CCTV DVR. The video file has a suffix of ".264" which I assume means its format is raw h264. I cannot play this video on certain media players including the default player on an Apple tablet. I would like to convert the file to another format that is more universally useable, for example mp4. I tried the following command at Linux terminal:

avconv -i ~/somePath/foo.264 -vcodec libx264 -f mp4 ~/somePath/foo.mp4

but the output mp4 file was basically empty, with a total size of 285 bytes. Furthermore, when I tried to play it using the Ubuntu Videos application the application returned a widow containing the error message: "An error occurred This file contains no playable streams."

Would somebody instruct me how to convert the .264 file to a .mp4?

  • have you tried running file --mime-type foo.264? or mediainfo foo.264? That will tell you if the file really is a valid video file. If you don't already have it installed and it isn't available as a package for your system, the mediainfo web site has packages for windows, mac, several linux distros, and FreeBSD, as well as source code. – cas May 17 '16 at 2:39
  • I have not tried either of those commands. But I do know that it is a valid video file because I have watched it on mplayer with the command: mplayer -fps 30 ~/somePath/foo.264 – EricVonB May 17 '16 at 3:19
  • Those commands will also tell you what kind of video file it is. Actual facts are better than assumptions - there's no guarantee that a .264 "extension" means that it is h.264. It might be, or it might not be. BTW, try handbrake to convert it to an mp4. – cas May 17 '16 at 4:02
  • The command [file --mime-type ~/somePath/foo.264] returns [~/somePath/foo.264: application/octet-stream]. And [bar@host:~$ mediainfo ~/somePath/foo.264] returns a lot, including: Format:AVC; Format profile:Baseline@L2; Width:352 pixels; Height:240 pixels – EricVonB May 17 '16 at 5:03
  • I tried converting it with handbrake. The only destination format available (to the best of my knowledge) was MKV. The MKV file that was produced is another essentially empty file, size 4.54 KiB. The source file, foo.264, has size 79.1 MiB. – EricVonB May 17 '16 at 5:19
0

How to Play and Convert .264 files to mp4:

How to play .264 files:

  • Install VLC if you dont have it
  • run vlc
  • Select "All" to show all nest preference settings
  • In "input / codecs" column, select "Demuxers"; Demuxers are used to separate audio and video streams.
  • Changing the default setting [Automatic] to [H264 video demuxer]
  • Open the .264 file, making sure to select "All Files"

How to convert the .264 video files to MP4 files:

  • Select [Convert/Save...] from the drop menu of Media
  • A [Open Media] window will pop-up, click "Add" to add the .264 file needs to convert. Then, click "Convert/Save" button to continue.
  • Selecting " Video - H.264 + MP3 (MP4)" in Profile list, click "Config" icon to config the profile setting.
  • Selecting the "MPEG-TS", not the MP4/MOV (default), then go to "Audio codec" to disable audio.
  • Go to "Video codec" tab, choosing "H-264" in Codec listing, then select/check "Keep original video track". This step is very important.
  • Clicking "Save" to save the profile setting, then click "Browser" to select the directory where the generated file need to be stored. Thereafter, click "Start" to proceed file generating. Just several seconds, you will get files with .ts file extension.
  • Run the Handbrake software, import the .ts file to convert.

From Here: https://www.unifore.net/ip-video-surveillance/how-to-play-264-video-files-from-ip-cameras-dvrs.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.