C:v copy h264 to mp4 blured frames problem

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

C:v copy h264 to mp4 blured frames problem

Johanna Nilson
Good day!

I try to convert h264 file to mp4 without converting video data. I use this
command line:

ffmpeg -y -f h264 -i input.h264 -c:v copy output.mp4
or
ffmpeg -y -f h264 -i input.h264 -c:v copy output.avi

Output:
ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers

  built with gcc 9.1.1 (GCC) 20190807

  configuration: --enable-gpl --enable-version3 --enable-sdl2
--enable-fontconfig --enable-
gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray
--enable-libfree
type --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-lib
openjpeg --enable-libopus --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-li
btheora --enable-libtwolame --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-l
ibx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma
--enable-zlib --ena
ble-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
--enable-libmysofa -
-enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
--enable-amf --enable-ffn
vcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec
--enable-dxva2 --enabl
e-avisynth --enable-libopenmpt

  libavutil      56. 31.100 / 56. 31.100

  libavcodec     58. 54.100 / 58. 54.100

  libavformat    58. 29.100 / 58. 29.100

  libavdevice    58.  8.100 / 58.  8.100

  libavfilter     7. 57.100 /  7. 57.100

  libswscale      5.  5.100 /  5.  5.100

  libswresample   3.  5.100 /  3.  5.100

  libpostproc    55.  5.100 / 55.  5.100

Input #0, h264, from '1920x1080.h264':

  Duration: N/A, bitrate: N/A

    Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 30
fps, 30 tbr, 1200k
 tbn, 60 tbc

Output #0, mp4, to 'output.mp4':

  Metadata:

    encoder         : Lavf58.29.100

    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661),
yuv420p(progressive), 1920x1080, q
=2-31, 30 fps, 30 tbr, 1200k tbn, 1200k tbc

Stream mapping:

  Stream #0:0 -> #0:0 (copy)

Press [q] to stop, [?] for help

[mp4 @ 000000143378e900] Timestamps are unset in a packet for stream 0.
This is deprecated
and will stop working in the future. Fix your code to set the timestamps
properly
frame=  271 fps=0.0 q=-1.0 Lsize=    7360kB time=00:00:09.00
bitrate=6694.0kbits/s speed= 3
76x

video:7356kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0
.049757%

Link to input.h264 <https://ufile.io/nu973jrm> (https://ufile.io/nu973jrm)
Link to output.mp4 <https://ufile.io/aavprii7> (https://ufile.io/aavprii7)

But the output.mp4 and output.avi files have bad quality in every nth
frame, they are blured.

But when I use command line:

ffmpeg -f h264 -i input.h264 -c:v copy output.h264

I have no problems with corrupted frames. Can anyone from skilled ffmpeg
specialists explain the nature of this problem and advice what can I do to
get a good copy of this file in mp4 format, so that all frames are not
blurred. The same problem I have with streams from h264 to mpegts. And it
is very important to copy (-c:v copy) h264 data, not to convert.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: C:v copy h264 to mp4 blured frames problem

Carl Eugen Hoyos-2
Am Sa., 28. Sept. 2019 um 17:58 Uhr schrieb Johanna Nilson <[hidden email]>:

>
> Good day!
>
> I try to convert h264 file to mp4 without converting video data. I use this
> command line:
>
> ffmpeg -y -f h264 -i input.h264 -c:v copy output.mp4
> or
> ffmpeg -y -f h264 -i input.h264 -c:v copy output.avi
>
> Output:
> ffmpeg version 4.2 Copyright (c) 2000-2019 the FFmpeg developers

For future questions:
Please remember that only current FFmpeg git head is supported here.

>   built with gcc 9.1.1 (GCC) 20190807
>
>   configuration: --enable-gpl --enable-version3 --enable-sdl2
> --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray
> --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
> --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy
> --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack
> --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma
> --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc
> --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx
> --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec
> --enable-dxva2 --enable-avisynth --enable-libopenmpt
>   libavutil      56. 31.100 / 56. 31.100
>   libavcodec     58. 54.100 / 58. 54.100
>   libavformat    58. 29.100 / 58. 29.100
>   libavdevice    58.  8.100 / 58.  8.100
>   libavfilter     7. 57.100 /  7. 57.100
>   libswscale      5.  5.100 /  5.  5.100
>   libswresample   3.  5.100 /  3.  5.100
>   libpostproc    55.  5.100 / 55.  5.100
> Input #0, h264, from '1920x1080.h264':
>   Duration: N/A, bitrate: N/A
>     Stream #0:0: Video: h264 (High), yuv420p(progressive), 1920x1080, 30
> fps, 30 tbr, 1200k tbn, 60 tbc
> Output #0, mp4, to 'output.mp4':
>   Metadata:
>     encoder         : Lavf58.29.100
>     Stream #0:0: Video: h264 (High) (avc1 / 0x31637661),
> yuv420p(progressive), 1920x1080, q=2-31, 30 fps, 30 tbr, 1200k tbn, 1200k tbc
> Stream mapping:
>   Stream #0:0 -> #0:0 (copy)
> Press [q] to stop, [?] for help
>
> [mp4 @ 000000143378e900] Timestamps are unset in a packet for stream 0.
> This is deprecated
> and will stop working in the future. Fix your code to set the timestamps
> properly
> frame=  271 fps=0.0 q=-1.0 Lsize=    7360kB time=00:00:09.00
> bitrate=6694.0kbits/s speed= 376x
> video:7356kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: 0.049757%
>
> Link to input.h264 <https://ufile.io/nu973jrm> (https://ufile.io/nu973jrm)
> Link to output.mp4 <https://ufile.io/aavprii7> (https://ufile.io/aavprii7)
>
> But the output.mp4 and output.avi files have bad quality in every nth
> frame, they are blured.

As does your input sample (as expected since remuxing cannot change
the video quality).

> But when I use command line:
>
> ffmpeg -f h264 -i input.h264 -c:v copy output.h264

This command line produces a bit-identical copy of the input
file and this output file (also) has the same quality issues as
your input file.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: C:v copy h264 to mp4 blured frames problem

Johanna Nilson
Sorry, didn't want to bother with stupid questions. I've examined that
there is no problems with input.h264 file in VLC player. After your answer
I looked input.h264 in ffplay and found the same quality issues with
blurred frames that was in output.mp4. So, the question is closed, now I
understand the source of the problem and it is not connected with ffmpeg.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: C:v copy h264 to mp4 blured frames problem

Micael Silva
On Sat, 28 Sep 2019, 14:34 Johanna Nilson, <[hidden email]> wrote:

> Sorry, didn't want to bother with stupid questions. I've examined that
> there is no problems with input.h264 file in VLC player. After your answer
> I looked input.h264 in ffplay and found the same quality issues with
> blurred frames that was in output.mp4. So, the question is closed, now I
> understand the source of the problem and it is not connected with ffmpeg.
>

As far as I know h264 raw files does not contain information like framerate
and timestamp, to convert or repackage them with ffmpeg you I'll need to
manually inform framerate and maybe size and timebase. Maybe tools like
MP4Box can do these job more efficiently

>
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: C:v copy h264 to mp4 blured frames problem

Carl Eugen Hoyos-2
Am So., 29. Sept. 2019 um 22:37 Uhr schrieb Micael Silva
<[hidden email]>:

> As far as I know h264 raw files does not contain information like framerate
> and timestamp

I think this is not generally true (but unrelated to this thread).

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".