Opened 6 years ago

Closed 2 years ago

#7934 closed defect (wontfix)

encode_video_test.c example does not work with libx264

Reported by: maahn Owned by:
Priority: normal Component: documentation
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
Example encode_video_test.c creates invalid mp4 file.

How to reproduce:

doc/examples/encode_video_test test_libx264.mp4 libx264
cvlc -v test_libx264.mp4
VLC media player 3.0.4 Vetinari (revision 3.0.4-0-gf615db6332)
[0000558469a3a700] dummy interface: using the dummy interface module...
[00007ff278c182a0] ps demux warning: this does not look like an MPEG PS stream, continuing anyway
[00007ff278c182a0] ps demux warning: garbage at input from 509, trying to resync...

ffmpeg version 4.1.3 build from sources with

PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --pkg-config-flags="--static" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --extra-libs="-lpthread -lm" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libass \
  --enable-libfreetype \
  --enable-libvorbis \
  --enable-libvpx \
  --enable-libx264 \
  --enable-libx265 \
  --enable-nonfree && \
PATH="$HOME/bin:$PATH" make && \
make install && \
hash -z

built on Ubuntu 18.04

Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.

Change History (4)

comment:1 by Jun Zhao, 5 years ago

encode_video.c example just output the video with raw format, you can use the cmd like: ./encode_video test_libx264.h264 libx264 then try cvlc -v test_libx264.h264 is Ok.

BTW: when I used the cmd like: ./encode_video test_libx264.mp4 libx264, ffplay and mpv is Ok but cvlc is fail, so I think maybe is a issue about cvlc in this case.

Last edited 5 years ago by Jun Zhao (previous) (diff)

comment:2 by Carl Eugen Hoyos, 5 years ago

Component: undetermineddocumentation
Keywords: example removed
Version: 4.1unspecified

Is there an issue that is reproducible with current FFmpeg git head?

comment:3 by Stefano Sabatini, 2 years ago

encode_video.c is not supposed to generate a valid mp4 file (in fact it ignores the output file extension altogether), for that you need to check the muxing examples.

When encoding H.264 video, it outputs to raw H.264 container format, which might not be supported by all applications (while supported e.g. by ffplay).

We want to keep encode_video.c simple, so we don't plan to add support to muxing facilities since there are distinct examples for that.

comment:4 by Stefano Sabatini, 2 years ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.