Page 1 of 1

Problem with transcoding a .flv file

PostPosted: Thu Jun 07, 2012 9:13 am
by Rheingold
Hi,

while trancoding some .flv files I realised the following problem with downloaded files. Other .flv Files played without problems.
Perhaps somebody can help.

Here are the logs when I tested the file with the cmd-shell

(this is the command from the serviio ffmpeg-wrapper.log)

ffmpeg.exe "-i" "f:\# TV\test.flv" "-y" "-async" "1" "-vcodec" "copy" "-vbsf" "h264_mp4toannexb" "-copyts" "-acodec" "ac3" "-ab" "384k" "-ac" "2" "-map" "0:0" "-map" "0:1" "-sn" "-f" "mpegts" "v:\Serviio\transcoding-temp-918-MPEG2TS.stf"

(and that was the output in the shell)

....

[mpegts @ 02279aa0] muxrate VBR, pcr every 2 pkts, sdt every 200, pat/pmt every
40 pkts
Output #0, mpegts, to 'v:\Serviio\transcoding-temp-918-MPEG2TS.stf':
Metadata:
moovPosition : 28137881
avcprofile : 77
avclevel : 31
aacaot : 2
videoframerate : 25
audiochannels : 2
encoder : Lavf54.4.100
Stream #0:0: Video: h264, yuv420p, 960x544 [SAR 1:1 DAR 30:17], q=2-31, 90k
tbn, 25 tbc
Stream #0:1: Audio: ac3, 48000 Hz, stereo, flt, 384 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac -> ac3)
Press [q] to stop, [?] for help
[mpegts @ 02279aa0] Application provided invalid, non monotonically increasing d
ts to muxer in stream 0: 22950 >= 19800
av_interleaved_write_frame(): Invalid argument


THNX !

Re: Problem with transcoding a .flv file

PostPosted: Thu Jun 07, 2012 10:08 am
by Illico
What is your OS?
If linux, what is the ffmpeg version?

could you try locally the same "ffmepg" command line? and try with -copyts removed.

Re: Problem with transcoding a .flv file

PostPosted: Thu Jun 07, 2012 11:10 am
by Rheingold
Illico wrote:What is your OS?
If linux, what is the ffmpeg version?

could you try locally the same "ffmepg" command line? and try with -copyts removed.


Hi
The posted result was already the output from a locally ffmepg command line
My OS is XP SP 3
The ffmpeg version is
ffmpeg version N-40640-g5edd4fc Copyright (c) 2000-2012 the FFmpeg developers
built on May 13 2012 17:58:59 with gcc 4.6.3
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru
ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libass
--enable-libcelt --enable-libopencore-amrnb --enable-libopencore-amrwb --enable
-libfreetype --enable-libgsm --enable-libmp3lame --enable-libnut --enable-libope
njpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libth
eora --enable-libutvideo --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-
libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --e
nable-zlib
libavutil 51. 50.100 / 51. 50.100
libavcodec 54. 21.101 / 54. 21.101
libavformat 54. 4.100 / 54. 4.100
libavdevice 53. 4.100 / 53. 4.100
libavfilter 2. 72.105 / 2. 72.105
libswscale 2. 1.100 / 2. 1.100
libswresample 0. 11.100 / 0. 11.100
libpostproc 52. 0.100 / 52. 0.100

I tryed without the -copyts parameter. result are many dropping warnings and an error:

DTS 1220, next:1285317 st:1 invalid dropping
PTS 1220, next:1285317 invalid dropping st:1
DTS 1241, next:1306650 st:1 invalid dropping
PTS 1241, next:1306650 invalid dropping st:1
DTS 1260, next:1335000 st:0 invalid dropping

[mpegts @ 02279aa0] pts (117000) < dts (120150) in stream 0
av_interleaved_write_frame(): Invalid argument

Re: Problem with transcoding a .flv file

PostPosted: Thu Jun 07, 2012 3:03 pm
by zip
this doesn't look like Serviio distributed FFmpeg, can you try with that one? In any case, the file seems to be dodgy

Re: Problem with transcoding a .flv file

PostPosted: Thu Jun 07, 2012 6:52 pm
by Illico
Rheingold wrote:...
I tryed without the -copyts parameter. result are many dropping warnings and an error:

DTS 1220, next:1285317 st:1 invalid dropping
PTS 1220, next:1285317 invalid dropping st:1
DTS 1241, next:1306650 st:1 invalid dropping
PTS 1241, next:1306650 invalid dropping st:1
DTS 1260, next:1335000 st:0 invalid dropping

[mpegts @ 02279aa0] pts (117000) < dts (120150) in stream 0
av_interleaved_write_frame(): Invalid argument


Timestamps seems to be dodgy.

Can try with some options for testing:
# fixed timestamp with frame rate 25 fps
"-setpts=N/(25*TB)"
or : Frames will be duplicated and dropped to achieve exactly the requested constant framerate.
"-vsync 1"
or : The time base is copied to the output encoder from the corresponding input demuxer. This is sometimes required to avoid non monotonically increasing timestamps when copying video streams with variable frame rate.
"-copytb 1"

Re: Problem with transcoding a .flv file

PostPosted: Fri Jun 08, 2012 7:08 am
by Rheingold
I played a little bit with the parameters and I found that I get a transcoded file when i delete "-vcodec" "copy" "-vbsf" "h264_mp4toannexb"
(The quality of the transcoded video was not really good)

Now I wonder how to change the transcoding parameters of serviio - is this possible?

What influense has the choice "Produce the best video quality" on the tab "Transcoding" in the console of serviio?

Re: Problem with transcoding a .flv file

PostPosted: Fri Jun 08, 2012 8:00 am
by Illico
Rheingold wrote:I played a little bit with the parameters and I found that I get a transcoded file when i delete "-vcodec" "copy" "-vbsf" "h264_mp4toannexb"

So for this source file .flv, you have to force mpeg2video transcoding.
What is your device? What is the profile selected on serviio console?

Re: Problem with transcoding a .flv file

PostPosted: Fri Jun 08, 2012 5:02 pm
by Rheingold
My device is Sony Bravia KDL 40EX505
and the Profile is therefor SONY Bravia (2010)

Edit 9.6.12
I just commented out the FLV line with H264 <!--Matches container="flv" vCodec="h264" --> in the parent profile nr. 9 of the SONY Bravia 2010 profile (nr 19) and the video plays perfect.
Now all .flv with codec h264 are transcoded and not only remuxed!

Thank to Illico for the help and the last tipp!