[FFmpeg-user] Quicktime IMX encode failing on v2.1

Steve Kelly steve at aatw.com
Thu Dec 5 22:54:05 CET 2013


On 22 Nov 2013, at 09:58, Tim Nicholson <nichot20 at yahoo.com> wrote:

> On 21/11/13 20:04, Steve Kelly wrote:
>> Thanks for that, had a look another look at the options list and by adjusting, I've go the video to encode by using:
>> 
>> /usr/local/bin/ffmpeg -i "Input.mpg" -vf "scale=720:576:1,pad=720:608:0:32" -vcodec mpeg2video -r 25 -pix_fmt yuv422p -minrate 50000k -maxrate 50000k -b:v 50000k -intra -flags +ildct+low_delay -dc 10 -intra_vlc 0 -non_linear_quant 0 -qmin 1 -qmax 3 -top 1 -bufsize 2000000 -rc_init_occupancy 2000000 -an -y "Output.m2v"
>> 
>> ie -flags2 was removed. I'm not sure if this is correct, but either way it works.
> 
> Well since you didn't specify any valid flags to go with it, that sounds
> about right.

Have the flags changed between the builds? I've looked but can't find a change log which would indicate what got deprecated/removed and what it should be replaced with if it has

> 
>> 
>> The audio is then generated with:
>> 
>> /usr/local/bin/ffmpeg -i  "Input.mpg" -vn -ar 48000 -acodec pcm_s16le -y "Output.wav"
>> 
>> However the mux stage generates a file which is no longer a valid IMX file. The MUX command is: 
>> 
>> /usr/local/bin/ffmpeg -i "Output.m2v" -i "Output.wav" -c:v copy -c:a copy -vtag mx5p -vbsf imxdump -y "Output_IMX.mov"
>> 
>> Although this command generates an output that can be played, this used to generate a valid IMX D10 Quicktime file and it no longer does. The video codec shows as mpeg2video not mx5p
> 
> 
> Why not do the audio and video in one go and set the vtag there?

Doesn't work either. Using this command:

# /usr/local/bin/ffmpeg -i "Input.mpg" -map 0:v -map 0:a -vf "scale=720:576:1,pad=720:608:0:32:black" -c:v mpeg2video -r 25 -aspect 4:3 -pix_fmt yuv422p -minrate 50000k -maxrate 50000k -b:v 50000k -intra -flags +ildct+ilme+low_delay -intra_vlc 0 -non_linear_quant 0 -ps 1 -qmin 1 -qmax 3 -top 1 -dc 10 -bufsize 2000000 -rc_init_occupancy 2000000 -rc_buf_aggressivity 0.25 -c:a pcm_s16le -ar 48000 -tag:v mx5p -vbsf imxdump -y "Output_IMX.mov"

Produces this output:

# /usr/local/bin/ffmpeg -i "Input.mpg" -map 0:v -map 0:a -vf "scale=720:576:1,pad=720:608:0:32:black" -c:v mpeg2video -r 25 -aspect 4:3 -pix_fmt yuv422p -minrate 50000k -maxrate 50000k -b:v 50000k -intra -flags +ildct+ilme+low_delay -intra_vlc 0 -non_linear_quant 0 -ps 1 -qmin 1 -qmax 3 -top 1 -dc 10 -bufsize 2000000 -rc_init_occupancy 2000000 -rc_buf_aggressivity 0.25 -c:a pcm_s16le -ar 48000 -tag:v mx5p -vbsf imxdump -y "Output_IMX.mov"
ffmpeg version 2.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Nov 20 2013 18:32:36 with gcc 4.2.1 (GCC) 20070831 patched [FeeBSD]
  configuration: --enable-libaacplus --disable-indev=alsa --disable-outdev=alsa --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-libass --disable-libcdio --disable-libcelt --disable-libfaac --disable-libfdk-aac --enable-ffserver --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-gnutls --disable-libgsm --enable-iconv --disable-indev=jack --enable-libmp3lame --disable-libbluray --enable-libv4l2 --disable-libmodplug --disable-openal --disable-indev=openal --enable-libopencv --enable-libopenjpeg --disable-libopus --disable-libpulse --disable-indev=pulse --disable-outdev=pulse --disable-librtmp --enable-libschroedinger --disable-libspeex --enable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvpx --enable-libx264 --enable-libxvid --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --disable-libsoxr --cc=cc --extra-cflags='-msse -I/usr/local/include/vorbis -I/usr/local/include' --extra-ldflags='-L/usr/local/lib ' --extra-libs=-pthread --disable-debug --disable-ffplay --disable-outdev=sdl --enable-nonfree
  libavutil      52. 48.100 / 52. 48.100
  libavcodec     55. 39.100 / 55. 39.100
  libavformat    55. 19.104 / 55. 19.104
  libavdevice    55.  5.100 / 55.  5.100
  libavfilter     3. 90.100 /  3. 90.100
  libavresample   1.  1.  0 /  1.  1.  0
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[pcm_dvd @ 0x808903b20] block_size has changed
[mpeg @ 0x8088e1420] Stream #1: not enough frames to estimate rate; consider increasing probesize
Guessed Channel Layout for  Input Stream #0.1 : stereo
Input #0, mpeg, from 'Input.mpg':
  Duration: 00:05:26.12, start: 0.957178, bitrate: 52933 kb/s
    Stream #0:0[0x1e0]: Video: mpeg2video (4:2:2), yuv422p(tv), 720x576 [SAR 16:15 DAR 4:3], max. 50000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc
    Stream #0:1[0xa0]: Audio: pcm_dvd, 48000 Hz, stereo, s16, 1536 kb/s
Output #0, mov, to 'Output_IMX.mov':
  Metadata:
    encoder         : Lavf55.19.104
    Stream #0:0: Video: mpeg2video (mx5p / 0x7035786D), yuv422p, 720x608 [SAR 152:135 DAR 4:3], q=1-3, 50000 kb/s, 12800 tbn, 25 tbc
    Stream #0:1: Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg2video -> mpeg2video)
  Stream #0:1 -> #0:1 (pcm_dvd -> pcm_s16le)
Press [q] to stop, [?] for help
[pcm_dvd @ 0x808903b20] block_size has changed
frame= 8153 fps= 54 q=1.6 Lsize= 2051878kB time=00:05:26.12 bitrate=51542.2kbits/s    
video:1990479kB audio:61148kB subtitle:0 global headers:0kB muxing overhead 0.012275%


Output file mediainfo is:

# mediainfo Output_IMX.mov
General
Complete name                            : Output_IMX.mov
Format                                   : MPEG-4
Format profile                           : QuickTime
Codec ID                                 : qt  
File size                                : 1.96 GiB
Duration                                 : 5mn 26s
Overall bit rate mode                    : Constant
Overall bit rate                         : 51.5 Mbps
Writing application                      : Lavf55.19.104

Video
ID                                       : 1
Format                                   : m2v1
Codec ID                                 : m2v1
Duration                                 : 5mn 26s
Bit rate mode                            : Constant
Bit rate                                 : 50.0 Mbps
Width                                    : 720 pixels
Height                                   : 608 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Scan type                                : Interlaced
Scan order                               : Top Field First
Bits/(Pixel*Frame)                       : 4.569
Stream size                              : 1.90 GiB (97%)
Language                                 : English

Audio
ID                                       : 2
Format                                   : PCM
Format settings, Endianness              : Little
Format settings, Sign                    : Signed
Codec ID                                 : sowt
Duration                                 : 5mn 26s
Bit rate mode                            : Constant
Bit rate                                 : 1 536 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Stream size                              : 59.7 MiB (3%)
Language                                 : English

File is not (and rightly so) recognised as an IMX file.

Valid IMX file mediainfo output is (this is from a totally different piece of media btw, hence the size differences etc):

# mediainfo FFMPEG_07_IMX.mov
General
Complete name                            : FFMPEG_07_IMX.mov
Format                                   : MPEG-4
Format_Commercial_IfAny                  : IMX 50
Format profile                           : QuickTime
Codec ID                                 : qt  
File size                                : 1.39 GiB
Duration                                 : 3mn 51s
Overall bit rate mode                    : Constant
Overall bit rate                         : 51.5 Mbps
Writing application                      : Lavf52.111.0

Video
ID                                       : 1
Format                                   : MPEG Video
Format_Commercial_IfAny                  : IMX 50
Format version                           : Version 2
Format profile                           : 4:2:2 at Main
Format settings, BVOP                    : No
Format settings, Matrix                  : Default
Format settings, GOP                     : N=1
Muxing mode                              : MXF
Codec ID                                 : mx5p
Duration                                 : 3mn 51s
Bit rate mode                            : Constant
Bit rate                                 : 50.0 Mbps
Width                                    : 720 pixels
Height                                   : 576 pixels
Original height                          : 608 pixels
Display aspect ratio                     : 1.184
Frame rate mode                          : Constant
Frame rate                               : 25.000 fps
Standard                                 : PAL
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 4.823
Stream size                              : 1.35 GiB (97%)
Language                                 : English

Audio
ID                                       : 2
Format                                   : PCM
Format settings, Endianness              : Little
Format settings, Sign                    : Signed
Codec ID                                 : sowt
Duration                                 : 3mn 51s
Bit rate mode                            : Constant
Bit rate                                 : 1 536 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 KHz
Bit depth                                : 16 bits
Stream size                              : 42.4 MiB (3%)
Language                                 : English

The MPEG2 encode step does not look like it produces the same format file as previous versions have to start with so I can't even be sure if the mux stage is working or not. Has something fundamentally changed in the mpeg2video codec?

Thanks

> 
>> [..]
> 
> 
> -- 
> Tim
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list