[FFmpeg-user] SEGMENT_TYPE_FMP4 with HLS_SINGLE_FILE

2017-07-24 Thread pablo platt
Hi,

A recent commit added fmp4 support for HLS [1] but byte-range or
single-file isn't supported [2].
Being able to use a single mp4 file for both Dash and HLS will be super
useful.
Any plans to add it?
What's missing?
Is mp4 different than mpegts in regards to byte-range support?

[1]
https://github.com/FFmpeg/FFmpeg/commit/274bd1670b9c85e24f37d08f9043dd82e0a28c67

[2] https://patchwork.ffmpeg.org/patch/4221/

Thanks
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Streaming Syntax error

2017-07-24 Thread Mettavihari D
Greetings

Thank you for your interpretation.
It looks you are spot on.

> We need to see the proper *actual* command line used (minus your hidden
> output URL). You can add "-loglevel debug", that will (among others)
> display ffmpeg's option parsing. But the easiest way is to add the
> option "-report" to the command line, and then grab the resulting file
> "ffmpeg-20170724-162640.log" (or similar) and show us the top where it
> says:

I am not able to interpret the information below and would like to
have your advice
I have cut out the bulk of the data from the log file and given you a
head and tail of the file.

regards
Mettavihari


ffmpeg started on 2017-07-25 at 10:20:01
Report written to "ffmpeg-20170725-102001.log"
Command line:
/root/bin/ffmpeg -re -i
/media/data/video/yupptv/sutta/satipattana-15m.mp4 -report -acodec
libfdk_aac "-b:a 128k" -vcodec libx264 "-preset:v medium" "-b:v 1500k"
-f flv -metadata "streamName=xlarge" rtmp://site
ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
  configuration: --prefix=/root/ffmpeg_build
--extra-cflags=-I/root/ffmpeg_build/include
--extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin
--pkg-config-flags=--static --enable-gpl --enable-nonfree
--enable-libfdk_aac --enable-libfreetype --enable-libmp3lame
--enable-libvorbis --enable-libvpx --enable-libx264
  libavutil  55. 62.100 / 55. 62.100
  libavcodec 57. 95.101 / 57. 95.101
  libavformat57. 72.101 / 57. 72.101
  libavdevice57.  7.100 / 57.  7.100
  libavfilter 6. 89.100 /  6. 89.100
  libswscale  4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc54.  6.100 / 54.  6.100
Splitting the commandline.
Reading option '-re' ... matched as option 're' (read input at native
frame rate) with argument '1'.
Reading option '-i' ... matched as input url with argument
'/media/data/video/yupptv/sutta/satipattana-15m.mp4'.
Reading option '-report' ... matched as option 'report' (generate a
report) with argument '1'.
Reading option '-acodec' ... matched as option 'acodec' (force audio
codec ('copy' to copy stream)) with argument 'libfdk_aac'.
Reading option '-b:a 128k' ... matched as option 'b' (video bitrate
(please use -b:v)) with argument '-vcodec'.
Reading option 'libx264' ... matched as output url.
Reading option '-preset:v medium' ... matched as AVOption 'preset:v
medium' with argument '-b:v 1500k'.
Reading option '-f' ... matched as option 'f' (force format) with
argument 'flv'.
Reading option '-metadata' ... matched as option 'metadata' (add
metadata) with argument 'streamName=xlarge'.
Reading option 'rtmp://site' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url
/media/data/video/yupptv/sutta/satipattana-15m.mp4.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: /media/data/video/yupptv/sutta/satipattana-15m.mp4.
[file @ 0x3f16300] Setting default whitelist 'file,crypto'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Format mov,mp4,m4a,3gp,3g2,mj2
probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Offset DTS by ctts[0].duration: 2
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Processing st: 0, edit list 0 -
media time: 2, duration: 109194
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 0 @
0, ctts: 2, ctts_count: 60872
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 1 @
0, ctts: 2, ctts_count: 60872
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 2 @
1, ctts: 3, ctts_count: 60872

[...]

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts:
109192 @ 60871, ctts: 2, ctts_count: 60872
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts:
109193 @ 60871, ctts: 2, ctts_count: 60872
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Processing st: 1, edit list 0 -
media time: 0, duration: 192619274
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Before
avformat_find_stream_info() pos: 4185665 bytes read:4207516 seeks:0
nb_streams:2
[h264 @ 0x3f17360] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x3f17360] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x3f17360] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x3f17360] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x3f17360] user data:"x264 - core 124 r2197 69a0443 -
H.264/MPEG-4 AVC codec - Copyleft 2003-2012 -
http://www.videolan.org/x264.html - options: cabac=1 ref=5
deblock=1:0:0 analyse

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Moritz Barsnick
On Mon, Jul 24, 2017 at 16:07:00 -0600, Ute Willmore wrote:
> confirm a bug. VLC allows you to use ffmpeg to convert a video from the
> command line and I want to see what the output looks like before I report a
> bug.

Actually, vlc (or the command line version cvlc) has its own "engine"
for conversion of videos. It does make use of libavformat/libavcodec, I
believe, but not exclusively. So vlc could be used to convert, instead
of ffmpeg, or at least to remux for ffmpeg's use.

I personally have a lot of trouble wrapping my head around vlc's
command line syntax though, I'm hardly of any help. (One of many guides
is here: https://wiki.videolan.org/Transcode/)

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Ute Willmore
Gyan,
thanks for getting back to me and taking the time to explain.

I am not sure how they are produced, except that someone takes a video, it
may be stored on a DVR before it is downloaded to a PC, but it could be
downloaded from the camera straight to the PC as well. This is for a
commercial product so all kinds of video cameras are used, whatever the
client wants to use. I don't know if the problem happens only when they are
stored on a DVR before they are downloaded to the PC or not.

I am a software person! So I know very little about the hardware involved
in this. I just write the code for the software that uses the videos. :-)

I'll try to find out though and let you know when I do.

For now, I hope I can replace ffmpeg with mp4box. I thought the version on

On Mon, Jul 24, 2017 at 1:57 PM, Gyan  wrote:

> On Tue, Jul 25, 2017 at 1:10 AM, Ute Willmore 
> wrote:
>
> >
> > What is non-standard about my input video?
> >
>
> That I don't know. Only that ffmpeg doesn't decode most of the frames from
> the original file.
>
>
> > I ran many conversion commands, and listed several of them in my original
> > message. Which one did you use?
> >
>
> 'ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4'
>
> What does "Muxing to TS" mean and why/how did you do that? What does
> > "Invalid NAL warnings mean?
> >
>
> H.264 data is stored in chunks called NAL units. I transferred the contents
> to another container format just to test the result, so you can ignore this
> part.
>
>
>
> > Is this the one you are using?
> > https://www.videohelp.com/software/MP4Box
> >
>
> Yes, but this is the download page at the official site:
> https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/
>
> mp4box is one of the tools bundled.
>
>
> > Do you have any idea what needs to be done to
> > produce a standard avi video in the first place?
> >
>
> How are these AVIs produced?
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Ute Willmore
Thank you Moritz! I will at least consider doing that, but I was beginning
to suspect a bug myself. I just need to find a solution or work around
first before I can take the time to do some more testing with VLC to
confirm a bug. VLC allows you to use ffmpeg to convert a video from the
command line and I want to see what the output looks like before I report a
bug.

Ute

On Mon, Jul 24, 2017 at 2:05 PM, Moritz Barsnick  wrote:

> On Tue, Jul 25, 2017 at 00:25:36 +0530, Gyan wrote:
> > Running your conversion command on your source, I see
> >
> > Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
> > decoded;
> >
> > Muxing to TS and playing that throws invalid NAL warnings.
>
> But that was a conversion, right?
>
> > mp4box -aviraw video hd.avi
> >
> > which produced hd_video.h264. This plays fine with ffplay.
>
> That was remuxing, right?
>
> > As best as I can tell, ffmpeg does have issues with parsing non-standard
> > H.264 bitstreams. It's certainly not as resilient as other decoders.
>
> I did a different test:
> - Playing the original video with ffplay produces the peculiar image
>   Ute is probably seeing.
> - Playing with mplayer produces an acceptable image. (mplayer uses
>   ffmpeg's libavcodec for decoding the video..)
> - Playing with "mplayer -demuxer lavf" produces the same junk as
>   ffplay.
>
> So I come to the conclusion that ffmpeg/libavformat has an issue
> demuxing the file. mplayer's native AVI demuxer doesn't. The latter is
> also probably valid for VLC, if that works for Ute. mp4box also doesn't
> have an issue. So, I think this is worth tracking as an ffmpeg bug (on
> trac.ffmpeg.org), providing the sample as an attachment, the command
> line and the complete, uncut console output.
>
> My $0.02,
> Moritz
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] hoping for help developing a process

2017-07-24 Thread d
so i've recently received a few corrupted videos that i'm trying to help 
some friends recover.



the videos are encoded in ProRes 422 and encapsulated in .mov


these videos have anywhere from a few to many damaged frames. some 
damaged frames simply have a few small colored blocks, and others have 
huge horizontal tears. when played in VLC, it shows the problematic 
frames as duplicates of the last good frame, which is why i turned to 
ffmpeg in the hope that it might allow me to script a conversion that 
would allow them to be watchable, even if not perfectly.



i can't seem to figure out which options under ffmpeg would allow me to 
replicate that functionality of vlc. it would also be wonderful if there 
were a way to log all of the places where there were problems, as i do 
have access to adobe premier and could then use that to 'morph cut' and 
give a better final result. better than that would be a filter that 
would allow me to morph from last good frame to next good frame over an 
equivalent count of the damaged frames.



many thanks to the experts out there for your help in advance


d


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Error:Impossible to convert between the formats supported by the filter..

2017-07-24 Thread James Girotti
On Mon, Jul 24, 2017 at 11:15 AM, tasos  wrote:

> Hello.
> I'm using
>
>> ffmpeg -y  -c:v h264_cuvid -deint 1 -vsync 1 -timeout 99 -i foo \
>> -map 0:v -c:v h264_nvenc -preset slow -profile:v high -b:v 1300k -pix_fmt
>> yuv420p -map 0:a -c:a libfdk_aac \
>> -ac 2 -b:a 64k -strict experimental -f mpegts foobar
>>
> and everything works fine.
> When i add -hwaccel cuvid
>
> ffmpeg -y -hwaccel cuvid -c:v h264_cuvid .. the same as above
>>
> I get
>
>> Impossible to convert between the formats supported by the filter
>> 'Parsed_null_0' and the filter 'auto_scaler_0'
>> Error reinitializing filters!
>> Failed to inject frame into filter network: Function not implemented
>> Error while processing the decoded data for stream #0:4
>>
>
I have run into the same many times trying to do stuff with nvenc and
hwaccel. You're trying to apply a software filter, but you're telling
ffmpeg to do everything in hardware (-hwaccel), so it cannot apply the
filter hence the error. Doesn't matter though, as from what I can tell
nvenc will not change pixel formats for you. Your source is yuv420p, output
will be yuv420p. If you want to change output pixel format to yuv444p, you
could do something like:

ffmpeg -hwaccel cuvid -c:v h264_cuvid -i foo -c:v h264_nvenc -preset slow
-profile:v high444p \
-vf "hwdownload,format=nv12,format=yuv444p,hwupload_cuda" -an -f mpegts
./foobar.ts

This would do the pixel format conversion in software (you could do the
same for any software filter you might want to use). Nvenc then outputs in
yuv444p pixel format.

Of course if you convert to anything but yuv420p, then decoding with cuvid
will not work because only yuv420p is supported in hardware.
https://developer.nvidia.com/nvidia-video-codec-sdk#NVDECFeatures

HTH,
-James
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Quick (I hope) CLI question

2017-07-24 Thread Cley Faye
2017-07-24 22:24 GMT+02:00 Eric Downing :

> Hi!
>
> I have a folder of mixed format video files. I would like to:
>
> • copy video format
> • apply "ffmpeg-normalize" to the audio track(s), whilst preserving
> encoding
> • batch process so I can run the same command on the root folder
>
> For example:
> video1.mp4 (aac 5.1)
> video2.mkv (2 ch stereo)
>
>
> The issue is that I have a bunch of video files in varying video and audio
> formats that need loudness normalization. They number into the hundreds so
> running a single command to accommodate each files particular encoding is
> cumbersome. I want to preserve formatting for audio and video and apply
> normalization to the audio - in batch. Surely there must be a way to script
> this.
>
> I have found and understand the CLI language to do these things one by one,
> however I'm having a hard time concatenating these commands into a one
> liner. It seems that each time the CLI wants me to define an output format
> for the audio.
>
> Thank you for any suggestions.
>

​I'm not sure what you mean exactly, but if I understand correctly, here
are some pieces that might help you:

- If you don't specify an output codec (for either video or audio), it will
use some default settings
- If you specify "-c:a copy" (for audio) or "-c:v copy" (for video), you
can't use filtering as it will copy the stream as-is
- You can get file informations using ffprobe, in a script-friendly format
(like json)

By combining that, you can make a script that take a file, pass it to
ffprobe, get the audio codec and settings, and replicate an ffmpeg command
line that will copy video "-c:v copy" and use the appropriate audio codec.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Quick (I hope) CLI question

2017-07-24 Thread Eric Wilde

At 04:24 PM 7/24/2017 -0400, you wrote:

I want to preserve formatting for audio and video and apply
normalization to the audio - in batch. Surely there must be a way to script
this.




Here's the code that I use for both boosting and companding.  If $Compressor
is 1, it makes up parameters for mencoder.  If $Compressor is not 1, it
makes up parameters for ffmpeg.

#
# If the user wants the input volume boosted by a fixed amount, just set
# the boost volume to that amount.
#
if [ ${FixedBoost} -ne 0 ]; then
BoostVol=${FixedBoost}
#
# Otherwise, if the user wants the input volume boosted so that the peak is
# near 0dB, we need to figure out how much boost is necessary.
#
else
#
# Note that we must use ffmpeg to detect the volume of the input file
# because ffprobe doesn't offer this feature.  So, even if the
# compressor being used is mencoder, ffmpeg is still required to use
# this feature.  Also, we look at the first 300 seconds (five minutes)
# of the input file to get an accurate picture of the maximum volume.
# This takes about 20-30 seconds but gives a much better idea of what
# the maximum volume really is.
#
# Once we have a boost volume amount, we can apply it with the volume
# filter
#
if [[ ${AudioBoost} -ne 0 && -x ${CompressFFMpeg} ]]; then
BoostVol=`${CompressFFMpeg} -i $2 -af "volumedetect" -to 300 
-nostats -f null -y /dev/null 2>&1 | grep -e '^\\[Parsed.*max_volume' | sed 
's/^.*max_volume:\\s-\\([0-9\\.]*\\).*$/\\1/g'`


BoostTrue=`echo "${BoostVol} > 1" | bc`
if [ ${BoostTrue} -ne 0 ]; then
BoostVol=`echo "scale=1; ${BoostVol} - 1" | bc`
else
BoostVol=0
fi
else
BoostVol=0
fi
fi
 .
 .
 .
#
# If we are boosting the audio, set the audio filter to boost it by the
# amount that we pre-calculated.  Note that this has no effect on dynamic
# range, it just makes everything louder.
#
BoostTrue=`echo "${BoostVol} > 0" | bc`
if [ $BoostTrue -ne 0 ]; then
if [ $Compressor == 1 ]; then
AudioFilter="-af volume=+${BoostVol}dB"
else
AudioFilter="-af volume=${BoostVol}dB"
fi
fi
#
# If we are normalizing the audio, set the audio filter to lessen the
# dynamic range.
#
# For mencoder, the volume normalization filter seems to work well (having
# tried it on quite a bit of recorded TV, which has much too high dynamic
# range in many cases).
#
# For ffmpeg, the compand filter with the parameters shown seems to work
# well also.  Here's the note from tugshank at forum.videohelp.com:
#
#  -af "aformat=channel_layouts=stereo,
#compand=0 0:1 1:-90/-900 -70/-70 -30/-9 0/-3:6:0:0:0"
#
#  channel_layouts=stereo forces mono to stereo, just in case
#
#  compander (compressor/expander):
#
#   attack - 0
#   release - 1
#   -90 dB in, infinity out
#   -70 dB in, -70 dB out
#   -30 dB in, -9 dB out
#   0 dB in, -3 dB out,
#   soft knee 6
#   0 dB makeup gain
#   input level 0 dB
#   lookahead 0.
#
#  Specifically made for 'whisper+explosion' scenes.
#
# For publishing video, EBU R128 is currently the preferred standard.  To
# use EBU R128, one must build ffmpeg with libebur128.  Normally, this
# isn't the default so you must use "--enable-libebur128" when you run
# configure.  Then, the "loudnorm" audio filter can be used, as in
# "-af loudnorm".  To figure out if loudnorm is available, use the
# following:
#
#  ffmpeg -filters 2>/dev/null | grep loudnorm
#
if [ ${AudioNorm} -ne 0 ]; then
if [ $Compressor == 1 ]; then
AudioFilter="-af volnorm=2:0.75"
else
AudioFilter="-af \"aformat=channel_layouts=stereo,compand=0 0:1 
1:-90/-900 -70/-70 -30/-9 0/-3:6:0:0:0\""

fi
fi


___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Quick (I hope) CLI question

2017-07-24 Thread Eric Downing
Hi!

I have a folder of mixed format video files. I would like to:

• copy video format
• apply "ffmpeg-normalize" to the audio track(s), whilst preserving encoding
• batch process so I can run the same command on the root folder

For example:
video1.mp4 (aac 5.1)
video2.mkv (2 ch stereo)


The issue is that I have a bunch of video files in varying video and audio
formats that need loudness normalization. They number into the hundreds so
running a single command to accommodate each files particular encoding is
cumbersome. I want to preserve formatting for audio and video and apply
normalization to the audio - in batch. Surely there must be a way to script
this.

I have found and understand the CLI language to do these things one by one,
however I'm having a hard time concatenating these commands into a one
liner. It seems that each time the CLI wants me to define an output format
for the audio.

Thank you for any suggestions.

Eric


--
   *eric downing • 786.431.7918 <786.431.7918>*
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Moritz Barsnick
On Tue, Jul 25, 2017 at 00:25:36 +0530, Gyan wrote:
> Running your conversion command on your source, I see
> 
> Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
> decoded;
> 
> Muxing to TS and playing that throws invalid NAL warnings.

But that was a conversion, right?

> mp4box -aviraw video hd.avi
> 
> which produced hd_video.h264. This plays fine with ffplay.

That was remuxing, right?

> As best as I can tell, ffmpeg does have issues with parsing non-standard
> H.264 bitstreams. It's certainly not as resilient as other decoders.

I did a different test:
- Playing the original video with ffplay produces the peculiar image
  Ute is probably seeing.
- Playing with mplayer produces an acceptable image. (mplayer uses
  ffmpeg's libavcodec for decoding the video..)
- Playing with "mplayer -demuxer lavf" produces the same junk as
  ffplay.

So I come to the conclusion that ffmpeg/libavformat has an issue
demuxing the file. mplayer's native AVI demuxer doesn't. The latter is
also probably valid for VLC, if that works for Ute. mp4box also doesn't
have an issue. So, I think this is worth tracking as an ffmpeg bug (on
trac.ffmpeg.org), providing the sample as an attachment, the command
line and the complete, uncut console output.

My $0.02,
Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Gyan
On Tue, Jul 25, 2017 at 1:10 AM, Ute Willmore 
wrote:

>
> What is non-standard about my input video?
>

That I don't know. Only that ffmpeg doesn't decode most of the frames from
the original file.


> I ran many conversion commands, and listed several of them in my original
> message. Which one did you use?
>

'ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4'

What does "Muxing to TS" mean and why/how did you do that? What does
> "Invalid NAL warnings mean?
>

H.264 data is stored in chunks called NAL units. I transferred the contents
to another container format just to test the result, so you can ignore this
part.



> Is this the one you are using?
> https://www.videohelp.com/software/MP4Box
>

Yes, but this is the download page at the official site:
https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/

mp4box is one of the tools bundled.


> Do you have any idea what needs to be done to
> produce a standard avi video in the first place?
>

How are these AVIs produced?
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Ute Willmore
Gyan,

I am still very new to video conversion and ffmpeg, so I don't understand
parts of your reply. Please explain:

What is non-standard about my input video?

I ran many conversion commands, and listed several of them in my original
message. Which one did you use?

What does "Muxing to TS" mean and why/how did you do that? What does
"Invalid NAL warnings mean?

I gather mp4box is another tool to use when dealing with videos and there
are all kinds of version available.

Is this the one you are using?
https://www.videohelp.com/software/MP4Box

I think you are saying that no matter what I will have to use MP4Box or
something similar to make a "standard" avi video and then convert that new
video to mp4 using the ffmpeg command you used. Is that correct?

Obviously, I would prefer not to process the video twice, because the real
video can be quite large. Do you have any idea what needs to be done to
produce a standard avi video in the first place?

Thanks

urw

On Mon, Jul 24, 2017 at 12:55 PM, Gyan  wrote:

> On Mon, Jul 24, 2017 at 11:56 PM, Ute Willmore 
> wrote:
>
> > Hi everyone,
> >
> > I am hoping someone on this list can help me with a problem I am having
> > when converting a .avi video to .mp4 using FFmpeg. The output I get
> starts
> > out looking good, but then degrades and by the time the 18 second video
> > finishes it is hard to recognize what's on the screen. The colors are all
> > off, some areas are just single color blobs where there used to be trees.
> >
>
> Running your conversion command on your source, I see
>
> Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
> decoded;
>
> Muxing to TS and playing that throws invalid NAL warnings.
>
> So I ran
>
> mp4box -aviraw video hd.avi
>
> which produced hd_video.h264. This plays fine with ffplay.
>
> Running
>
> ffmpeg  -v verbose -i hd_video.h264 -i hd.avi -map 0 -map 1:a -vf
> scale=640:480 out.mp4
>
> produces an undistorted output.
>
> As best as I can tell, ffmpeg does have issues with parsing non-standard
> H.264 bitstreams. It's certainly not as resilient as other decoders.
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Ute Willmore
crf stands for constant rate factor. Allowed values are between 0 and 51,
default is 23. To get better quality, use a lower number. The recommended
start value, if the default does not work for you, is 18. 0 is lossless.

You can read on the topic here: https://trac.ffmpeg.org/wiki/Encode/H.265

URW

On Mon, Jul 24, 2017 at 12:57 PM, Phil Rhodes <
phil_rhodes-at-rocketmail@ffmpeg.org> wrote:

> I'd be interested to know what "crf 23" actually means.
> How do I get it to do, say, 2.5Mbps?
> P
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Gyan
On Mon, Jul 24, 2017 at 11:56 PM, Ute Willmore 
wrote:

> Hi everyone,
>
> I am hoping someone on this list can help me with a problem I am having
> when converting a .avi video to .mp4 using FFmpeg. The output I get starts
> out looking good, but then degrades and by the time the 18 second video
> finishes it is hard to recognize what's on the screen. The colors are all
> off, some areas are just single color blobs where there used to be trees.
>

Running your conversion command on your source, I see

Input stream #0:0 (video): 856 packets read (18695093 bytes); 104 frames
decoded;

Muxing to TS and playing that throws invalid NAL warnings.

So I ran

mp4box -aviraw video hd.avi

which produced hd_video.h264. This plays fine with ffplay.

Running

ffmpeg  -v verbose -i hd_video.h264 -i hd.avi -map 0 -map 1:a -vf
scale=640:480 out.mp4

produces an undistorted output.

As best as I can tell, ffmpeg does have issues with parsing non-standard
H.264 bitstreams. It's certainly not as resilient as other decoders.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Phil Rhodes
I'd be interested to know what "crf 23" actually means.
How do I get it to do, say, 2.5Mbps?
P
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Gyan
On Tue, Jul 25, 2017 at 12:15 AM, Reindl Harald 
wrote:


> ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4
>
>
>
> without a bitrate param the results are poor because of ridiculous low
> bitrate defaults, at least that was the case many years ago as we
> implemented our php-wrapper
>

Not an issue here, as MP4 defaults to libx264, when available, which in
turn defaults to CRF 23.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Reindl Harald



Am 24.07.2017 um 20:26 schrieb Ute Willmore:

I am hoping someone on this list can help me with a problem I am having
when converting a .avi video to .mp4 using FFmpeg. The output I get starts
out looking good, but then degrades and by the time the 18 second video
finishes it is hard to recognize what's on the screen. The colors are all
off, some areas are just single color blobs where there used to be trees.

I am really hoping someone here will be able to help.

I have the latest version 20170718-012620a of ffmpeg. This is the static 64
bit version for Windows running on Windows 10 Pro.

I started out using the following command to convert the video:

ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4


without a bitrate param the results are poor because of ridiculous low 
bitrate defaults, at least that was the case many years ago as we 
implemented our php-wrapper

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] Poor quality output when converting avi to mp4

2017-07-24 Thread Ute Willmore
Hi everyone,

I am hoping someone on this list can help me with a problem I am having
when converting a .avi video to .mp4 using FFmpeg. The output I get starts
out looking good, but then degrades and by the time the 18 second video
finishes it is hard to recognize what's on the screen. The colors are all
off, some areas are just single color blobs where there used to be trees.

I am really hoping someone here will be able to help.

I have the latest version 20170718-012620a of ffmpeg. This is the static 64
bit version for Windows running on Windows 10 Pro.

I started out using the following command to convert the video:

ffmpeg  -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4

After some research and reading on various websites, I tried this:

ffmpeg   -v verbose -i hd.avi -c:v h264  -crf 19 -preset slow
 scaledoutput.mp4

I tried different crf and preset values but nothing made a difference.
Eventually I tried to just copy the video using this command:

ffmpeg   -v verbose -i hd.avi -c copy -map 0  scaledoutput.mp4

and the result was just as bad.

Next I started looking for another converter to see if I could get better
results and found that Adobe and VLC work just fine. There are others as
well, but I need a converter is free and can be run from the command line,
because the conversion will be done in a .NET Desktop application. VLC
seems to fit the bill best, at least for now.

I really would like to do this with ffmpeg for a number of reasons,
including the speed of ffmpeg. It is so much faster and can do so much more
than any other media converter, but if I can't get it to produce a decent
quality video when converting avi to mp4  I may end up using something else.

BTW, when I run ffprobe on the output file produced by ffmpeg and on the
output file produced by VLC,  I get get the same information for the video
stream. The video stream is stream 0, 0, the encode is h264 and pixel
 format is yuv420p. Here is the relevant output from ffprobe:

For the output created by VLC:
Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 6378 kb/s, 50 fps, 50 tbr, 1000k tbn, 100 tbc (default)

For the output created by ffmpeg:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 8482 kb/s, 50 fps, 50 tbr, 12800 tbn, 100 tbc (default)

The meta data encode used by the 2 converters is different and audio is
handled differently as well, but that should not impact the video quality,
right?

The file produced by VLC looks great when I run it but the file produced by
ffmpeg is really very poor quality,

If you need to see the files I am working with, try getting them from
Dropbox.com

Here is the link to the input file:
dropbox.com/s/dw6ml8iwnnkmoz9/hd.avi?dl=0

and the output file is here:
dropbox.com/s/p19vsn9iasb99km/scaledoutput.mp4?dl=0


If that does not work for you, let me know if I can post videos to the list
and I will try that. I have not found any method for doing so, but maybe I
overlooked something or I am too new to the list?

Anyway, if anyone can help figure this out, I would be very grateful. If
more details are needed, please let me know what I missed and I will try to
provide it.

TIA

urw
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Streaming Syntax error

2017-07-24 Thread Moritz Barsnick
On Mon, Jul 24, 2017 at 19:00:42 +0530, Mettavihari D wrote:
> I do not understand where you get that from.
> I have different versions on the machine, but I have given the path to
> the latest version in the script.

Well, I was wondering why it worked on the command line, but not in the
script. But actually: I read the error message incorrectly. Sorry. :-(

> [root@spancro /]# which libx264

That's not a binary, so "which" won't find it. (Nevermind, you gave
enough info by listing your files.)

> [root@spancro ~]# ffmpeg -encoders

I seriously hope you're not running your conversion as root!

>  V. libx264  libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 
> 10 (codec h264)

That's fine.

This is what I missed to interpret correctly:
> [NULL @ 0x3ca53a0] Unable to find a suitable output format for 'libx264'
> libx264: Invalid argument

It means ffmpeg sees "libx264" in your command line as an output
"file"/URI. Unfortunately, we can't read the complete command line from
this:

> ffmpeg_pids.append(subprocess32.Popen([args['ffmpeg_path'], '-re',
> '-i',   args['content_dir']+'/'+args['channel_dir']+"/"+dharmavahini,
> '-acodec', 'libfdk_aac', '-b:a 128k', '-vcodec', 'libx264', '-b:v
> 1500k', '-minrate 1500k -maxrate 1500k -bufsize 1500k', '-f', 'flv',
> '-metadata', 'streamName=xlarge', 'rtmp://site']))

(BTW, you merge some arguments, and some not. Even if it works, that's
inconsistent.)

We need to see the proper *actual* command line used (minus your hidden
output URL). You can add "-loglevel debug", that will (among others)
display ffmpeg's option parsing. But the easiest way is to add the
option "-report" to the command line, and then grab the resulting file
"ffmpeg-20170724-162640.log" (or similar) and show us the top where it
says:

Command line:
ffmpeg -report [...]
ffmpeg version N-86781-gd8f1982 Copyright (c) 2000-2017 the FFmpeg developers

That should give us an indication of what ffmpeg is interpreting.

Cheers,
Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] Streaming Syntax error

2017-07-24 Thread Mettavihari D
Greetings

Thank you for the mail.

On Mon, Jul 24, 2017 at 2:46 PM, Moritz Barsnick  wrote:
> On Mon, Jul 24, 2017 at 09:30:38 +0530, Mettavihari D wrote:
>> when I run this on the command line it is working.
> [...]
>> When I run this in a script I get errors.
>
> Apparently, you use a differently built ffmpeg in the script.

I do not understand where you get that from.
I have different versions on the machine, but I have given the path to
the latest version in the script.

>> --enable-libvorbis --enable-libvpx --enable-libx264
> [...]
>> [NULL @ 0x3ca53a0] Unable to find a suitable output format for 'libx264'
>> libx264: Invalid argument
>>
>> A hint on where to read more on this is very useful.
>
> Though your ffmpeg's configure command line told it to build with
> libx264, that apparently didn't work, and this ffmpeg doesn't support
> libx264. (You can double-check with "ffmpeg -encoders".)

Thank you for this info.
I have pasted the output below.


> Can you not use the same ffmpeg as you use "on the command line" for
> your script?

That is what I think I have done but you may see a fault that I do not see.

> Otherwise, you need to rebuild that ffmpeg which is called from the
> script in presence of the "libx264-devel" package, or you need to build
> libx264 yourself beforehand, and make sure it is found while
> configuring, see this section of the RedHat compilation guide:
> https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#libx264

I have put my compilation below and the other info also below.
I very much appreciate you help with this, since it is troubling me
for a long time.

Mettavihari


This is my .bash_histry file

cat readme.txt
cd ffmpeg
PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure
--prefix="$HOME/ffmpeg_build"
--extra-cflags="-I$HOME/ffmpeg_build/include"
--extra-ldflags="-L$HOME/ffmpeg_build/lib -ldl" --bindir="$HOME/bin"
--pkg-config-flags="--static" --enable-gpl --enable-nonfree
--enable-libfdk_aac --enable-libfreetype --enable-libmp3lame
--enable-libvorbis --enable-libvpx --enable-libx264
make
make install

To my understanding I have done it correct.
But you may find some error in it.

[root@spancro /]# which x264
/root/bin/x264
[root@spancro /]# which libx264
/usr/bin/which: no libx264 in
(/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/ant/bin:/usr/local/ant/bin:/root/bin)

These are some of the files in my pc.

./usr/lib64/pkgconfig/x264.pc
./usr/lib64/libx264.so.142
./usr/lib64/libx264.so
./usr/include/x264_config.h
./usr/include/x264.h

./root/bin/x264
./root/ffmpeg_build/lib/pkgconfig/x264.pc
./root/ffmpeg_build/lib/libx264.a
./root/ffmpeg_build/include/x264.h
./root/ffmpeg_build/include/x264_config.h

path /bin/
lrwxrwxrwx. 1 root root 16 Jul 24 18:14 ffmpeg -> /root/bin/ffmpeg
-rwxr-xr-x. 1 root root 88 Sep  5  2015 ffmpeg-old
-rwxr-xr-x. 1 root root 123368 Sep  5  2015 ffplay
-rwxr-xr-x. 1 root root 143104 Sep  5  2015 ffprobe
-rwxr-xr-x. 1 root root 140752 Sep  5  2015 ffserver

path /root/bin/
-rwxr-xr-x.  1 root root 22390168 May 15 11:05 ffmpeg
-rwxr-xr-x.  1 root root 22312312 May 15 11:05 ffprobe
-rwxr-xr-x.  1 root root 20232248 May 15 11:05 ffserver
-rwxr-xr-x.  1 root root   484480 May 15 10:18 lame
-rwxr-xr-x.  1 root root  2565892 May 15 09:53 vsyasm
-rwxr-xr-x.  1 root root  1401416 May 15 10:02 x264
-rwxr-xr-x.  1 root root  2563135 May 15 09:53 yasm
-rwxr-xr-x.  1 root root  2540064 May 15 09:53 ytasm

In my script I give the path to ffmpeg binaries as
/opt/dls/play.py --content-dir /media/data --ffmpeg-path
/root/bin/ffmpeg --segment.etc


[root@spancro ~]# ffmpeg -encoders
ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11)
  configuration: --prefix=/root/ffmpeg_build
--extra-cflags=-I/root/ffmpeg_build/include
--extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin
--pkg-config-flags=--static --enable-gpl --enable-nonfree
--enable-libfdk_aac --enable-libfreetype --enable-libmp3lame
--enable-libvorbis --enable-libvpx --enable-libx264
  libavutil  55. 62.100 / 55. 62.100
  libavcodec 57. 95.101 / 57. 95.101
  libavformat57. 72.101 / 57. 72.101
  libavdevice57.  7.100 / 57.  7.100
  libavfilter 6. 89.100 /  6. 89.100
  libswscale  4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc54.  6.100 / 54.  6.100
Encoders:
 V. = Video
 A. = Audio
 S. = Subtitle
 .F = Frame-level multithreading
 ..S... = Slice-level multithreading
 ...X.. = Codec is experimental
 B. = Supports draw_horiz_band
 .D = Supports direct rendering method 1
 --
 V. a64multi Multicolor charset for Commodore 64
(codec a64_multi)
 V. a64multi5Multicolor charset for Commodore 64,
extended with 5th color (colram) (codec a64_multi5)
 V. alias_pixAlias/Wavefront PIX image
 V. amv

[FFmpeg-user] Fill up dropped/missing UDP TS packets with still image? DVB encoding

2017-07-24 Thread ffmpeg
Is there a way to fill up the TS stream during encoding with an still image (or 
also an other TS) if packets during a UDP transmission (perhaps because of bat 
DVB signal) are lost? Together with ffplay? 

Currently I do something like this: ffmpeg -i 
"udp://224.1.2.1:10001?overrun_nonfatal=1_size=5000" -map 0:3 -map 0:4 
-s 1280x720 -af apad -acodec aac -b:a 192k -ab 48k -ac 2 -vcodec h264 -preset:v 
medium -r 50 -g 100 -vb 320 -y -fflags +genpts -f segment -segment_time 60 
-segment_atclocktime 1 -strftime 1 "/videofiles/DVB_HD_%Y-%m-%d_%H-%M-%S.ts"

If a DVB signal problem arise ... the TS is bad and encoding could hang. 
Thanks for a solution idea,
Best, Fox
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] h264 mkvs fail on TV/gigablue after conversion

2017-07-24 Thread Moritz Barsnick
On Mon, Jul 24, 2017 at 10:29:18 +0200, Frank Steiner wrote:

> Do you have any idea what could go wrong here? What I could change in
> converting to avoid that little "whatever" that disturbs the
> (obviously older) codecs on my TV and the Gigablye box? What kind of
> problem could cause the video stream to freeze?

TVs and hardware decoders often have a limited set of codec features
which they can decode. Back in the days of XviD, it was a bit of a
matter of luck of getting them to work. In these modern days, profiles
and levels describe the capabilities and features.

> ffmpeg -i test_works.mkv -c:v libx264 -preset veryslow -crf 20 -tune filme 
> -c:a copy -c:s copy test_fails.mkv
[...]
> Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1044, 
> SAR 1:1 DAR 160:87, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
(There's something here ffmpeg doesn't tell us here by default. I used
mediainfo to tell, but ffprobe -show_streams also works.)

> [libx264 @ 0x12cdca0] profile High, level 5.1

This is it. Your working input video is profile High, level 4.1. ffmpeg
is choosing profile High, level 5.1.[*] It is a choice implied by the
"veryslow" preset, but you can override it specifically by adding
  "-profile high -level 4.1"
(or whatever your hardware player at max supports) to your ffmpeg
command line, while keeping the preset.

This is my best guess... Something worth trying.

[*] Technical jibber: Most notably, the number of reference frames (4
vs. 16) and the number of B-frames (5 vs. 8) is different. Those things
matter to a HW decoder, IIUC.

Cheers,
Moritz

> [libx264 @ 0x12cdca0] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 
> 2003-2016 - http://www.videolan.org/x264.html - options: cabac=1 ref=16 
> deblock=1:-1:-1 analyse=0x3:0x133 me=umh subme=10 psy=1 psy_rd=1.00:0.15 
> mixed_ref=1 me_range=24 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 
> fast_pskip=1 chroma_qp_offset=-3 threads=12 lookahead_threads=2 
> sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 
> constrained_intra=0 bframes=8 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 
> weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=23 scenecut=40 
> intra_refresh=0 rc_lookahead=60 rc=crf mbtree=1 crf=20.0 qcomp=0.60 qpmin=0 
> qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
> Output #0, matroska, to 'test_fails.mkv':
>   Metadata:
> encoder : Lavf57.56.101
> Chapter #0:0: start 0.00, end 123.54
> Metadata:
>   title   : 00:00:00.000
> Chapter #0:1: start 123.54, end 264.139000
> Metadata:
>   title   : 00:02:03.540
> Chapter #0:2: start 264.139000, end 437.312000
> Metadata:
>   title   : 00:04:24.139
> Chapter #0:3: start 437.312000, end 650.984000
> Metadata:
>   title   : 00:07:17.312
> Chapter #0:4: start 650.984000, end 814.397000
> Metadata:
>   title   : 00:10:50.984
> Chapter #0:5: start 814.397000, end 952.827000
> Metadata:
>   title   : 00:13:34.397
> Chapter #0:6: start 952.827000, end 1144.894000
> Metadata:
>   title   : 00:15:52.827
> Chapter #0:7: start 1144.894000, end 1362.611000
> Metadata:
>   title   : 00:19:04.894
> Chapter #0:8: start 1362.611000, end 1484.191000
> Metadata:
>   title   : 00:22:42.611
> Chapter #0:9: start 1484.191000, end 1604.394000
> Metadata:
>   title   : 00:24:44.191
> Chapter #0:10: start 1604.394000, end 1764.513000
> Metadata:
>   title   : 00:26:44.394
> Chapter #0:11: start 1764.513000, end 1983.773000
> Metadata:
>   title   : 00:29:24.513
> Chapter #0:12: start 1983.773000, end 2098.346000
> Metadata:
>   title   : 00:33:03.773
> Chapter #0:13: start 2098.346000, end 2196.444000
> Metadata:
>   title   : 00:34:58.346
> Chapter #0:14: start 2196.444000, end 2463.336000
> Metadata:
>   title   : 00:36:36.444
> Chapter #0:15: start 2463.336000, end 2755.044000
> Metadata:
>   title   : 00:41:03.336
> Chapter #0:16: start 2755.044000, end 2993.199000
> Metadata:
>   title   : 00:45:55.044
> Chapter #0:17: start 2993.199000, end 3222.344000
> Metadata:
>   title   : 00:49:53.199
> Chapter #0:18: start 3222.344000, end 3549.004000
> Metadata:
>   title   : 00:53:42.344
> Chapter #0:19: start 3549.004000, end 3662.993000
> Metadata:
>   title   : 00:59:09.004
> Chapter #0:20: start 3662.993000, end 3879.876000
> Metadata:
>   title   : 01:01:02.993
> Chapter #0:21: start 3879.876000, end 4014.761000
> Metadata:
>   title   : 01:04:39.876
> Chapter #0:22: start 4014.761000, end 4344.632000
> Metadata:
>   title   : 01:06:54.761
> Chapter #0:23: start 4344.632000, end 4572.902000
> 

[FFmpeg-user] h264 mkvs fail on TV/gigablue after conversion

2017-07-24 Thread Frank Steiner
Hi,

I just realized that all movies that I converted down to 720p using h264 codec 
don't play neither on my TV nor my Gigablue Quad box, but work fine with 
mplayer/mpv/xine on my Linux system. On the TV/gigablue the video stream 
freezes after 2-3 seconds while the audio continues to play. It doesn't matter 
what kind of input codec I have.

I could track the problem down to a small test video. The input file is in h264 
format already, and after converting the "ffmpeg -i" output looks absolutely 
the same, apart from the bitrate. So the TV/Gigablue are able to play h264 
streams, but when I convert it with ffmpeg sth. must be changed that I can't 
figure out (and so don't know how to avoid it).

Below is the output of the conversion command. The two files can be downloaded 
from https://www.bio.ifi.lmu.de/~steiner/test_works.mkv (18 MB) and 
https://www.bio.ifi.lmu.de/~steiner/test_fails.mkv (8.9MB) in case you want to 
take a look at them.

Do you have any idea what could go wrong here? What I could change in 
converting to avoid that little "whatever" that disturbs the (obviously older) 
codecs on my TV and the Gigablye box? What kind of problem could cause the 
video stream to freeze?

cu,
Frank


ffmpeg -i test_works.mkv -c:v libx264 -preset veryslow -crf 20 -tune filme -c:a 
copy -c:s copy test_fails.mkv
ffmpeg version 3.2.6 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 4.8 (SUSE Linux)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 
--incdir=/usr/include/ffmpeg --extra-cflags='-fmessage-length=0 
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 
-funwind-tables -fasynchronous-unwind-tables -g' --optflags='-fmessage-length=0 
-grecord-gcc-switches -fstack-protector -O2 -Wall -D_FORTIFY_SOURCE=2 
-funwind-tables -fasynchronous-unwind-tables -g' --disable-htmlpages 
--enable-pic --disable-stripping --enable-shared --disable-static --enable-gpl 
--disable-openssl --enable-avresample --enable-libcdio --enable-gnutls 
--enable-ladspa --enable-libass --enable-libbluray --enable-libcelt 
--enable-libcdio --enable-libdc1394 --enable-libfreetype --enable-libgsm 
--enable-libopenjpeg --enable-libopus --enable-libpulse 
--enable-libschroedinger --enable-libspeex --enable-libtheora 
--enable-libvorbis --enable-libvpx --enable-libwebp --enable-netcdf 
--enable-vaapi --enable-vdpau --enable-libfdk_aac --enable-nonfree 
--enable-libmp3lame 
--enable-libtwolame --enable-libx264 --enable-libx265 --enable-libxvid 
--enable-x11grab
  libavutil  55. 34.101 / 55. 34.101
  libavcodec 57. 64.101 / 57. 64.101
  libavformat57. 56.101 / 57. 56.101
  libavdevice57.  1.100 / 57.  1.100
  libavfilter 6. 65.100 /  6. 65.100
  libavresample   3.  1.  0 /  3.  1.  0
  libswscale  4.  2.100 /  4.  2.100
  libswresample   2.  3.100 /  2.  3.100
  libpostproc54.  1.100 / 54.  1.100
Input #0, matroska,webm, from 'test_works.mkv':
  Metadata:
ENCODER : Lavf57.56.101
  Duration: 00:00:15.19, start: 0.00, bitrate: 9400 kb/s
Chapter #0:0: start 0.00, end 123.54
Metadata:
  title   : 00:00:00.000
Chapter #0:1: start 123.54, end 264.139000
Metadata:
  title   : 00:02:03.540
Chapter #0:2: start 264.139000, end 437.312000
Metadata:
  title   : 00:04:24.139
Chapter #0:3: start 437.312000, end 650.984000
Metadata:
  title   : 00:07:17.312
Chapter #0:4: start 650.984000, end 814.397000
Metadata:
  title   : 00:10:50.984
Chapter #0:5: start 814.397000, end 952.827000
Metadata:
  title   : 00:13:34.397
Chapter #0:6: start 952.827000, end 1144.894000
Metadata:
  title   : 00:15:52.827
Chapter #0:7: start 1144.894000, end 1362.611000
Metadata:
  title   : 00:19:04.894
Chapter #0:8: start 1362.611000, end 1484.191000
Metadata:
  title   : 00:22:42.611
Chapter #0:9: start 1484.191000, end 1604.394000
Metadata:
  title   : 00:24:44.191
Chapter #0:10: start 1604.394000, end 1764.513000
Metadata:
  title   : 00:26:44.394
Chapter #0:11: start 1764.513000, end 1983.773000
Metadata:
  title   : 00:29:24.513
Chapter #0:12: start 1983.773000, end 2098.346000
Metadata:
  title   : 00:33:03.773
Chapter #0:13: start 2098.346000, end 2196.444000
Metadata:
  title   : 00:34:58.346
Chapter #0:14: start 2196.444000, end 2463.336000
Metadata:
  title   : 00:36:36.444
Chapter #0:15: start 2463.336000, end 2755.044000
Metadata:
  title   : 00:41:03.336
Chapter #0:16: start 2755.044000, end 2993.199000
Metadata:
  title   : 00:45:55.044
Chapter #0:17: start 2993.199000, end 3222.344000
Metadata:
  title   : 00:49:53.199
Chapter #0:18: start 3222.344000, end 3549.004000
Metadata: