[FFmpeg-user] Mux encoded video data directly into mp4 files

fernando.takeshi fernando.takeshi at seventh.com.br
Wed Sep 17 18:13:14 CEST 2014


Hi, thank you for your time and response.

What I meant is, with the linked sample data I supplied previously, I tried
the following:

D:\ffmpeg\bin>ffmpeg -i h264.hex -vcodec copy h264.mp4
ffmpeg version N-61444-gf3d3e3f Copyright (c) 2000-2014 the FFmpeg
developers
  built on Mar 13 2014 22:24:23 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
--enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca
--enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavp
ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
--enable
-zlib
  libavutil      52. 66.101 / 52. 66.101
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 34.101 / 55. 34.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, h264, from 'h264.hex':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p, 800x592, 25
fps, 2
5 tbr, 1200k tbn, 50 tbc
Output #0, mp4, to 'h264.mp4':
  Metadata:
    encoder         : Lavf55.34.101
    Stream #0:0: Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 800x592,
q=2-31,
 25 fps, 1200k tbn, 1200k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 1101 fps=0.0 q=-1.0 Lsize=    5950kB time=00:00:44.00
bitrate=1107.9kbits
/s
video:5945kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead
0.09
1430%





D:\ffmpeg\bin>ffmpeg -i mpeg.hex -vcodec copy mpeg.mp4
ffmpeg version N-61444-gf3d3e3f Copyright (c) 2000-2014 the FFmpeg
developers
  built on Mar 13 2014 22:24:23 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
--enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca
--enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavp
ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
--enable
-zlib
  libavutil      52. 66.101 / 52. 66.101
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 34.101 / 55. 34.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
Input #0, m4v, from 'mpeg.hex':
  Duration: N/A, start: 0.333333, bitrate: N/A
    Stream #0:0: Video: mpeg4, yuv420p, 320x240 [SAR 1:1 DAR 4:3], 12 tbr,
1200k
 tbn, 12 tbc
Output #0, mp4, to 'mpeg.mp4':
  Metadata:
    encoder         : Lavf55.34.101
    Stream #0:0: Video: mpeg4 ( [0][0][0] / 0x0020), yuv420p, 320x240 [SAR
1:1 D
AR 4:3], q=2-31, 1200k tbn, 1200k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame=  827 fps=0.0 q=-1.0 Lsize=     418kB time=00:01:08.83 bitrate= 
49.7kbits
/s
video:415kB audio:0kB subtitle:0 data:0 global headers:0kB muxing overhead
0.730
787%





D:\ffmpeg\bin>ffmpeg -i mjpeg.hex -vcodec copy mjpeg.mp4
ffmpeg version N-61444-gf3d3e3f Copyright (c) 2000-2014 the FFmpeg
developers
  built on Mar 13 2014 22:24:23 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads
--enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls
--enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca
--enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame
--ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr
--enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
--enable-libwavp
ack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid
--enable
-zlib
  libavutil      52. 66.101 / 52. 66.101
  libavcodec     55. 52.102 / 55. 52.102
  libavformat    55. 34.101 / 55. 34.101
  libavdevice    55. 11.100 / 55. 11.100
  libavfilter     4.  3.100 /  4.  3.100
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 18.100 /  0. 18.100
  libpostproc    52.  3.100 / 52.  3.100
mjpeg.hex: Invalid data found when processing input


But that was just a simple test. I need to do this programatically. What I'm
really looking for is the sequence of commands required to mux raw data
(h264, mpeg and mjpeg frames) into mp4 video files, skipping encoding so the
output is produced as fast as possible. It seems every search I do on the
topic turns up different functions and orders to accomplish this!



--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/Mux-encoded-video-data-directly-into-mp4-files-tp4667372p4667393.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.


More information about the ffmpeg-user mailing list